productinterview.tools
MenuClose

Run a Prompt-Injection Red Team and Write the Report

4 min readadvanced1–2 weekendsForAI Safety PMAI Product Engineer

Build with your agent

Copy the prompt, keep the brief as the source of truth

Paste it into Claude Code, Cursor, Codex or ChatGPT. It points your agent at this page and sets the working rules; the brief, steps and acceptance criteria stay in one place.

Read https://www.productinterview.tools/projects/prompt-injection-red-team-report/ and build it.
Follow the scope and acceptance criteria exactly.
Ask me up to five questions before starting.
Use synthetic or public data only.
Keep PLAN.md, DECISIONS.md and EVALS.md.
Do not add dependencies without asking.
Stop after each milestone and show me the evidence.
Finish with the deliverables and presentation described in the brief, including a one-page write-up and a 60-second demo script.
On this page
  1. What you'll build and why it impresses
  2. The brief
  3. Steps
  4. Acceptance criteria
  5. How to present it
  6. What interviewers will probe
  7. Variations

What you'll build and why it impresses

Every team shipping an agent says it is "guarded against prompt injection". Very few can show the attacks they tried, which ones worked, what they fixed and what risk remains.

This project produces that evidence. You will build or use a sandbox agent you control, run a structured red-team campaign against it, rank the findings by severity, apply mitigations, and retest. The report is the deliverable: reproducible prompts, observed behaviour, impact, fix and residual risk.

It is one of the strongest safety PMProduct Manager. Decides what a product should do, for whom, and why. Read the full explanation portfolio pieces because it shows judgment, not just concern. For an AI product engineer, it shows you can threat-model a system and harden it.

The brief

Target. An agent you built or a public sandbox you are authorised to test. Good choices: a support agent with a web-search tool, an email assistant that reads documents, or a RAGRetrieval-augmented generation. Fetching relevant documents and putting them in the model's context before it answers. Read the full explanation assistant over a shared drive. Do not test a third-party production system without written permission.

Capabilities. Give the agent at least one tool and one untrusted input channel (retrieved documents, web pages, emails or user-uploaded files). Prompt injection is mostly about untrusted content reaching the model, so a chat-only bot is a weaker target.

Scope. Define what counts as a security failure: leaking the system prompt, following instructions in a retrieved document, calling a tool with attacker-controlled arguments, exposing another user's data, or producing harmful content. State what is out of scope.

Ethics and safety. Use synthetic data and a sandbox account. Do not exfiltrate real data, attack real people, or publish a working exploit against a live service. If you find a real vulnerability in a third-party product, follow responsible disclosure.

Out of scope. A full penetration test, infrastructure attacks and model-weight extraction. Stay on the model and tool boundary.

Steps

  1. Threat-model the agent. Draw the data flows: user input, retrieved content, tool outputs, memory and the final answer. Mark every place untrusted text enters the model. This diagram is the backbone of the report.

  2. Write the attack taxonomy. Cover at least five categories:

    • Direct injection: the user tells the model to ignore its instructions.
    • Indirect injection: a document, web page or email contains instructions.
    • Tool abuse: the model is tricked into calling a tool with harmful arguments.
    • Data exfiltration: the model is asked to reveal other users' data, secrets or the system prompt.
    • Multi-turn manipulation: the attacker builds trust or context over several turns.
  3. Write 25–40 attack cases. For each: goal, input, expected safe behaviour, and the severity if it succeeds. Include simple and sophisticated versions. Keep them reproducible.

  4. Run the campaign. Record the exact prompt, the model and tool versions, the observed output and whether the attack succeeded. Save transcripts. Do not clean up the failures; the failures are the finding.

  5. Rate severity. Use impact × likelihood, not a vague high/medium/low. A leaked system prompt is usually lower severity than an unauthorised refund or a data leak. State the user harm and the business harm separately.

  6. Apply mitigations. Choose at least three and explain the trade-off:

    • separate instructions from untrusted content with clear delimiters;
    • require confirmation before high-impact tool calls;
    • least-privilege tools and scoped credentials;
    • output filtering and citation checks;
    • a classifier or guardrail on retrieved content;
    • a human approval step for sensitive actions.
  7. Retest. Run the same campaign against the hardened version. Report which attacks now fail, which still succeed, and whether the mitigation introduced new failures such as over-refusal or latency.

  8. Write the report. One page of findings, an appendix of transcripts, a severity table, the mitigations and the residual risk. End with a recommendation: ship, ship with constraints, or do not ship.

Acceptance criteria

  • A threat model diagram with every untrusted input marked.
  • 25+ reproducible attack cases across at least five categories.
  • Saved transcripts with model and tool versions.
  • A severity table with impact, likelihood and user harm.
  • At least three mitigations, each with its trade-off.
  • A retest showing which attacks are fixed and which remain.
  • A residual-risk statement and a launch recommendation.
  • An ethics note confirming sandbox use and responsible disclosure.

How to present it

In the report: lead with the attack that worked and what it would cost. Then the taxonomy, the severity table and the fix. Put transcripts in an appendix so the reader can verify.

In a safety interview: emphasise the threat model and the residual risk, not the cleverest prompt. Interviewers want to know whether you can prioritise and whether you would block a launch.

In an engineering interview: walk through the tool permissions and the confirmation step. The architectural fix matters more than the wording of a filter.

What interviewers will probe

  • What is prompt injection, in one sentence? Untrusted content changing the model's instructions or tool use. Distinguish direct from indirect. See prompt injection.
  • Why can't you just filter the input? Filters are bypassable and indirect content arrives through trusted channels. You need defence in depth. See AI guardrails.
  • Which finding would block a launch? An unauthorised high-impact action or a cross-user data leak. A leaked system prompt alone usually would not.
  • How did you measure severity? Impact × likelihood, with user and business harm separated.
  • What residual risk remains? Be specific: which attacks still work and what monitoring would catch them. See red-team before launch.
  • What would you do if this were a real third-party product? Stop, document, and disclose responsibly. Do not publish a live exploit.

Variations

Easier: one tool, 15 attacks, three categories, one mitigation. Still produce transcripts and a residual-risk note.

Harder: add a second model or a multi-agent system; test indirect injection through a real document pipeline; measure the false-positive cost of a guardrail; or build an automated regression suite from the attacks.

Team version: one person owns the threat model and attacks, one owns mitigations, one owns severity and the report. Present the disagreement about residual risk as the finding.