Skip to content
AI Engineer Guide.
staffReportedcurated

An agent reads retrieved documents and tool outputs and can take actions. How do you defend against indirect prompt injection, and why can't a better system prompt solve it?

30-second answer

Likely follow-ups

Open a question to rehearse the answer.

What is the lethal trifecta and how would you break it?
  • An agent that reads support tickets, can see customer records and can send email has all three legs, so a planted ticket can exfiltrate data.
  • Break it by removing the egress tool from the reading context, or by requiring approval and an allowlisted recipient for any send.
  • Scope credentials per user and tenant, because a shared mailbox token turns a prompt-level mistake into a company-wide capability.
How would you test injection defenses before launch?
  • Run an injection suite that plants payloads in documents, tool outputs and image text, and measure attack success on poisoned inputs beside task success on benign ones.
  • Keep every successful payload as a regression case, and add a canary document whose contents should never appear in an outbound request.
  • Test the deterministic layer directly, because a prompt change can look safe while the permission check is the only thing still blocking the action.

Red flags

  • Believes a strong system prompt is sufficient
  • Gives the agent broad credentials and relies on model judgment

Concepts this tests

Tags

Source: github.com

More in Prompting & context engineering