--- license: cc-by-4.0 pretty_name: PDF-Integrity-Bench language: - en tags: - pdf - document-forensics - tamper-detection - prompt-injection - redaction - synthetic size_categories: - 1K.pdf`: a file is named by the SHA-256 of its bytes. - `truth.jsonl`: one line a file: `key` (its SHA-256), `label` (`attack` or `benign`), `slice`, `attack_class`, `variant` (how exactly it was made), `writer` and `writer_version` (the library that wrote the bytes), `doc_type`, `pages`, `cluster_id` (files that share an issuer) and `parent_key` (the file it was made from). It says what a file is and how it was made, never what a checker should answer about a person. - `dataset.json`: the counts, every writer with its version, the seed (`0`), and `trial_index_sha256`, the SHA-256 of `truth.jsonl` (`sha256:5f6d738c0f083befe6f06448a0ed2338679bd4bdecbaef3e9f7a87ae3846077b`). - `answers/`: what each system of the published benchmark answered for every file. - `rivals/`: the two plain baseline scripts of the benchmark, each with its own lock file. - `score.py`: scores any answers file against `truth.jsonl`. ## Score a tool Write one JSON line a file, `{"key": "", "flagged": true}`, then: ```bash python3 score.py my-tool.jsonl ``` To check the published figures, score the recorded answers: ```bash python3 score.py answers/milliframe-doc-forensics.jsonl ``` To run a baseline yourself (needs [uv](https://docs.astral.sh/uv/)): ```bash ls -d "$PWD"/files/*.pdf > files.txt uv run --frozen --project rivals/pypdf-naive python rivals/pypdf-naive/detect.py --files-from files.txt --out pypdf-naive.jsonl python3 score.py pypdf-naive.jsonl ``` The published benchmark also states recall at a fixed 1% false-alarm rate with 95% intervals over issuer clusters; `score.py` gives the plain shares those figures rest on. ## Read this before quoting a figure - **The altered files come from one generator.** A tool that was written against the same techniques does well here by construction. A score on this pack says a tool does what this pack tests. It does not say how the tool fares on files altered in a way nobody has put into the pack. - **Every document is synthetic.** A false-alarm rate here is a rate on these five layouts and these writers, not on the PDFs of a real mailbox. - **Writers.** pikepdf 10.18.2 (libqpdf 12.4.2); pypdf 7.1.1; pypdf 7.1.1, cryptography 50.0.2; pypdfium2 5.15.2 (PDFium 159.0.8149.0@sourcebuild-toolchained); reportlab 5.1.2; 70 files are written directly by hand. There is no file written by Acrobat, LibreOffice, Chrome, Typst or WeasyPrint, and no PAdES signature (the signatures are detached PKCS#7 by a test identity). - **Not in the pack:** text hidden on a switched-off layer or cut away by a clipping area, white-out and retype, and anything flattened into pixels (a page that was printed and scanned). - Some writers do not repeat byte for byte (their files carry a random identifier or a date), so this build of the pack is the one `trial_index_sha256` names. ## Licence The files, `truth.jsonl`, `dataset.json`, `answers/`, `score.py` and the scripts under `rivals/` are released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Cite as: Milliframe, *PDF-Integrity-Bench* (seed 0), 2026. **Fonts and libraries.** Every PDF in this pack either names standard PDF Base-14 faces without embedding font data or embeds subsets of Bitstream Vera under the permissive Bitstream Vera licence (which permits embedding and redistribution). Zero proprietary operating-system fonts are embedded. The libraries the baseline scripts call (`pikepdf`, `pypdf`) are not part of this dataset and keep their own licences.