Clearcraft LabClearCraft AIAI workflows & integrations

Home / Practical guide

Defending Against Hidden Prompt Injection in Emails & PDFs: Four Non-Negotiable Rules

When an AI agent reads external emails and PDFs, how do you stop hidden instructions from hijacking the workflow? Inside our 4-rule guardrail architecture.

Editorial responsibility: ClearCraft AI team, operated by Clearcraft Lab. Revised 17 November 2026.

External emails and PDFs are untrusted inputs. ClearCraft AI isolates all outside text strictly as structured data fields—never as executable instructions—while enforcing least-privilege tool access, complete action logging, and human approval before any critical step.

Checks before implementation

  1. Identify source documents, required fields and data permissions.
  2. Separate deterministic rules from reading tasks that need AI.
  3. Define stop conditions for mismatches, missing data and uncertainty.
  4. Assign an authorised owner for approval, writes and replies.
  5. Test successful, exceptional and retry paths with redacted samples.
  6. Record the version, acceptance results and rollback process before launch.

Limited permissions, separation of data from instructions, human approval for critical actions and execution logs reduce risk. They do not eliminate every prompt-injection attempt or model error. Safeguards and testing are agreed for each project.

OWASP Top 10 for LLM Applications · Cloudflare Workers documentation

Figures are illustrative estimates or example targets, not verified client measurements. Actual time, error rates and cost depend on data, exceptions, human review and maintenance. The value of time released is not cash savings.

Next step: review your own workflow

Bring the tools you use, a sample with personal data removed, common exceptions and an owner. We first assess whether automation is worthwhile, then agree scope, pricing and acceptance. Do not submit client personal data or credentials through public chat.

Book a free consultation

Related reading