pdf-inspector
pdf-inspector: seguridad para PDFs no confiables
Sandbox, límites, egress OCR, retención y recuperación.

Qué aprenderás
- Trace detection and layout stages
- Run native extraction and OCR safely
- Design provenance checks
Antes de empezar
- Basic Git and command-line usage
- Comfort reading a project README
You can explain the project, run its documented first step, and decide what to verify before adopting it.
Conclusiones clave
- A PDF parser needs resource limits and isolation.
- Derived Markdown must retain page provenance.
- OCR fallback is an external data boundary.
Input isolation
Limita tamaño, páginas, tiempo, memoria y red, aísla PDFium/ONNX y conserva procedencia porque Markdown sigue siendo dato derivado.
Use the pinned source evidence, record versions and assumptions, and ask a qualified reviewer to validate the result before adopting it.
OCR and fallback
Keep PDFium/ONNX workers separated, restrict model caches and outbound traffic, and make hosted fallback explicit. Store per-page source and confidence so downstream users can see uncertainty.
Retention and response
Encrypt originals and extracted text, redact logs, define deletion windows, and rehearse cancellation, quarantine, cleanup, and restore. Treat Markdown as derived data, not a replacement for the original evidence.
Use the pinned source evidence, record versions and assumptions, and ask a qualified reviewer to validate the result before adopting it.
Cómo elegir
| Criterio | Opción A | Opción B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Pasos de implementación
- 1
Define input, output, and retention policy.
- 2
Sandbox parser and OCR workers.
- 3
Restrict links, egress, and caches.
- 4
Monitor, quarantine, delete, and restore.
Ejemplo para copiar
untrusted PDF -> sandbox limits -> parser
page evidence + confidence -> redacted Markdown
OCR/fallback -> approved egress + retention
incident -> stop/quarantine/delete/restorePreguntas frecuentes
Can pdf-inspector safely fetch links inside a PDF?
The parser should extract links as data; fetching them requires a separate, authorized component with allow-lists.
Should extracted text be kept forever?
No. Match retention to purpose and preserve only the evidence needed for the workflow.
Fuentes
- pdf-inspector README (captured 2026-08-31)Fuente verificada 2026-08-31
- pdf-inspector repositoryFuente verificada 2026-08-31