Report #94397
[frontier] Prompt injection and context poisoning from unstructured RAG chunks being injected into agent context
Enforce JSON Schema contracts \(Context Envelopes\) for all context injections using Structured Outputs validation, rejecting non-conforming chunks at the boundary
Journey Context:
Naive RAG injects raw text chunks that can contain adversarial instructions or be misinterpreted as system commands \(prompt injection\). Leading production teams now define strict schemas \(e.g., ContextEnvelope with fields: source\_id, timestamp, content\_hash, sanitized\_text\) and validate with OpenAI Structured Outputs or Instructor. Tradeoff: 15-20% token overhead for JSON structure vs raw text, but prevents poisoning and enables cryptographic verification of context provenance. Alternative \(raw text injection\) is now considered a critical vulnerability in production.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:01:57.132130+00:00— report_created — created