August 22, 2026 · Damien B., Founder of Redact PDF AI

How AI Agents Can Redact PDFs: API Guide + MCP (2026)

An AI agent can redact PII from a PDF in three API calls: upload the file, poll the job, download the permanently redacted output. The Redact PDF AI API is built for exactly this: automatic PII detection (names, emails, IBANs, addresses — 100+ languages, scanned files included), idempotent retries for autonomous loops, and rasterized output with nothing recoverable underneath. You can verify it works right now, without a key or signup:

# Keyless demo — a real redaction of a synthetic-PII sample
curl https://www.redact-pdf.ai/v1/demo
# → detected PII categories + a link to the redacted PDF

Why agents need a redaction step

Agents increasingly handle documents end-to-end: pull an attachment, extract data, file it, forward it. The moment a workflow shares a document onward — to another tool, another model, another person — unredacted PII becomes a liability. Text-scrubbing proxies exist for prompts, but they don't solve the document problem: the agent needs a redacted PDF file back, visually intact, with the sensitive content permanently removed.

That's a different job than masking strings. It needs OCR (scans and images), layout-preserving redaction, and irreversible output — if the "redacted" file still contains a hidden text layer, the agent just laundered a data leak into a workflow.

The agent-ready integration pattern

The full flow is three calls (plus an optional cleanup):

# 1. Upload — returns a job_id immediately (async)
curl -X POST 'https://www.redact-pdf.ai/v1/jobs' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'X-Idempotency-Key: agent-run-42' \
  -F 'files=@contract.pdf;type=application/pdf' \
  -F 'pii_categories=["Person","Email","PhoneNumber","IBAN"]'

# 2. Poll until status == "redacted"
curl 'https://www.redact-pdf.ai/v1/jobs/{job_id}' -H 'X-API-Key: YOUR_API_KEY'

# 3. Download the redacted PDF
curl -L 'https://www.redact-pdf.ai/v1/documents/{doc_id}/output' \
  -H 'X-API-Key: YOUR_API_KEY' -o contract-redacted.pdf

Four properties matter specifically for autonomous use:

  • Idempotency — pass X-Idempotency-Key and a retried request can't create a duplicate job or double-spend credits. Agents retry; the API should be safe when they do.
  • Ephemeral retention by default — originals are deleted after processing. The agent's upload doesn't become a second copy of the sensitive data sitting in someone's storage.
  • Irreversible output — pages are rasterized, so there is no hidden text layer. The agent can pass the result downstream without re-checking it.
  • Machine-readable docsllms.txt, Markdown docs, and an OpenAPI spec. An agent (or the developer's coding assistant) can read the whole integration surface without parsing HTML.

Large files have a direct-to-blob path (POST /v1/jobs/initPUT to a signed URL → commit) so gigabyte-scale uploads never stream through the API. Everything is documented in the developer docs.

What about MCP?

The Model Context Protocol is becoming the standard way to hand tools to Claude, ChatGPT, and other agents. Today's MCP redaction landscape is mostly text scrubbers — servers that mask PII in prompts and tool outputs. Useful, but they don't produce a redacted document.

An official Redact PDF AI MCP server is in development: it will wrap the API above as agent tools (redact_pdf, get_job_status, download_redacted), available both as a local server and a hosted remote connector. Until it ships, the REST API is the agent-ready path — and any agent framework that can make HTTP calls (LangChain, CrewAI, the OpenAI and Anthropic tool-use APIs, or a plain function) can use it today.

Choosing a redaction backend for your agent: a checklist

  1. Can you verify it without friction? A keyless test endpoint beats a sales call. Try /v1/demo.
  2. Is retry safe? Look for idempotency support — autonomous loops retry things.
  3. Is the output actually irreversible? Rasterized/flattened output, not annotation overlays.
  4. What happens to the uploaded original? Ephemeral retention should be the default, not a setting to find.
  5. Where does processing happen? For EU workloads: Redact PDF AI processes in Frankfurt and Switzerland on Azure, with no AI training on your documents.
  6. Does it handle scans? Agents receive photographed and scanned documents constantly; OCR must be built in.

Frequently asked questions

Can an AI agent redact a PDF without a human in the loop? Yes — the API detects PII automatically and returns a permanently redacted file. For high-stakes documents you can keep a human review step: retention=studio keeps masks editable in a review UI before export.

Is there an MCP server for PDF redaction? Current MCP "redaction" servers mostly scrub text in prompts. A dedicated Redact PDF AI MCP server (returning actual redacted PDF files) is in development; the REST API is the equivalent agent path today.

How does an agent test the API without an account? GET https://www.redact-pdf.ai/v1/demo runs a real redaction on a fixed synthetic-PII sample and returns the detected categories plus a link to the redacted output. No key, no upload, no user data.

Which PII types are detected? Person, Email, PhoneNumber, Address, Organization, Date, IBAN, CreditCard — across 100+ languages with automatic language detection, on both digital and scanned PDFs.

In summary

Agents that touch documents need a redaction step, and it has to be a document redaction step — OCR, layout-preserved, irreversible — not a text mask. The Redact PDF AI API gives an agent that in three calls, with a keyless demo to verify first and an MCP server on the way. Start with the developer docs or read how to redact a PDF for the fundamentals.