Prompt injection red team program
A program that avoids production data rests on four parts. Each is covered in the sections below.
- Isolated environmentProduction-shaped tools, retrieval, identities, and permissions with no regulated data.
- Synthetic and canary dataRealistic structure with planted tokens that make leakage detectable.
- Attack scenariosDirect and indirect injection aimed at exfiltration and unauthorized actions.
- Control evidencePolicy enforcement records, tool-call traces, and audit logs per test.
Treat the absence of production data as a design constraint
Testing without PHI or PII does not require testing a simplified system. The environment should match production in attack surface and differ only in the data it holds. That means the same tools, retrieval sources, identities, and permissions, filled with synthetic records and planted canary tokens.
Architect the isolated test environment
Keep the following elements aligned with production.
| Element | What to align |
|---|---|
| Network and tenancy isolation | Separate accounts or networks, no routes to production data stores, and tightly controlled egress so exfiltration attempts can be observed and contained. |
| Retrieval sources | Mirror index structure, chunking, metadata, and access filters. Seed documents include both benign content and attacker-controlled content for indirect injection. |
| Tools and MCP connections | Use the same tool schemas and server configurations, pointed at sandbox backends or stubs that record every call and argument. |
| Identities and permissions | Mirror production roles and scopes for agents and users. Overly broad test credentials hide the failures you are trying to find. |
| Model and prompt configuration | Match model versions, system prompts, guardrail settings, and context assembly logic. |
| Logging and access | Capture full traces in a restricted store with its own retention rule, and limit tester and reviewer access. |
Build synthetic and canary data that behaves like the real thing
Synthetic records should have realistic structure so the system handles them the way it would handle production records. Canary tokens planted in those records and in retrieval sources make leakage detectable: when a token appears where it should not, the test has found an exfiltration path.
Canary detection results then show where tokens did or did not appear, which gives each test a clear, observable outcome without exposing PHI or PII.
Define attack scenarios and success criteria before testing
Scenarios cover direct and indirect injection aimed at exfiltration and unauthorized actions. For indirect injection, attacker-controlled content is seeded into the retrieval sources described above.
Write down each scenario definition, injection payload, and expected control behavior before the test runs. Success is measured by whether runtime controls block exfiltration and unauthorized tool calls, and whether audit logs prove it.
Know where synthetic data falls short and compensate
Synthetic data cannot replicate every production property, so those gaps need compensating controls.
Evidence artifacts to retain for each test run
Each test should leave policy enforcement records, tool-call traces, and audit logs. Retain the following artifacts.
- Scenario definition, injection payload, and expected control behavior
- Environment configuration snapshot: model, prompts, tools, identities, and permissions
- Full tool-call traces with arguments, results, and allow or deny decisions
- Runtime policy enforcement records tied to each blocked or permitted action
- Canary detection results showing where tokens did or did not appear
- Audit log entries that attribute each action to an agent identity and a time