What you need to know
A chatbot that is manipulated says something wrong. A tool-using agent that is manipulated does something wrong: sends data out, changes records, spends money. Every source of text the agent reads (tickets, emails, web pages, PDFs, tool results, MCP tool descriptions, memory) is a possible channel for instructions an attacker wrote. Assume the model can be fooled; the controls must still hold.
The high-risk combination
| Leg | Examples |
|---|---|
| Access to private data | CRM records, internal wiki, accounts |
| Exposure to untrusted input | Customer tickets, web pages, uploaded documents, third-party tool output |
| A channel to communicate externally | Email, public posting, outbound HTTP, sharing links |
When all three meet in one context, prompt instructions alone cannot prevent exfiltration. Break a leg: scope data to the task (the ticket's own account), gate or remove the external channel (recipient allowlists, approval for external sends, no posting after internal reads), or narrow untrusted input (browsing allowlists).
Attack types
| Attack | What happens | Defenses |
|---|---|---|
| Indirect prompt injection | Instructions hidden in content the agent reads | Separate untrusted content from capabilities; enforce actions in code; check outputs at trust boundaries |
| Tool poisoning | Hidden instructions in an MCP tool's description or output | Review and pin tool definitions; alert on changes; egress limits |
| Memory poisoning | Injected text persisted into memory, steering later sessions | Validate what may be written; scope memory; make entries reviewable |
| Exfiltration | Data leaves through email, URLs, posts or tool calls | Allowlisted destinations; approval for external sends; output checks |
| Unsafe autonomy | The agent takes costly or irreversible actions unchecked | Least privilege, quotas, approval gates |
| System prompt leakage | Users extract the prompt | Keep secrets and sensitive details out of prompts |
OWASP and NIST as frameworks
The OWASP Top 10 for LLM Applications names the risk categories, including prompt injection, sensitive information disclosure, supply chain, data and model poisoning, improper output handling, excessive agency (more functionality, permissions or autonomy than needed), system prompt leakage, vector and embedding weaknesses, misinformation and unbounded consumption. An agent that launched 300 instances in a loop after misreading an error is an excessive-agency problem: limits, quotas and approvals bound the damage whatever triggers it.
The NIST AI Risk Management Framework organizes the work into four functions: Govern (policies, roles, accountability), Map (context and risk identification), Measure (assessment and tracking) and Manage (prioritizing and responding). Its Generative AI Profile applies the framework to risks specific to generative systems.
Red-team exercises that change the system
- Build scenarios on the agent's real tools and data ("access another customer's account", "send internal data out"), not only generic jailbreak lists.
- Use testers other than the builders, before launch and again on changes.
- Define success criteria, and turn each finding into a fix and a regression test, including variants of the attack.
- Prefer fixes that do not depend on recognizing a phrasing: a control on the payment tool stops every chain, not just the one found.
Secure MCP configuration
- Allow only reviewed servers, from approved sources, with pinned versions.
- Give each server least-privilege credentials and enable only the tools agents need.
- Record tool-definition hashes and alert when a server's descriptions change.
- Being listed in a public directory is not a trust decision.
When to stop autonomy
Require a human when an action is irreversible or costly, or when untrusted content has entered the session and the action sends data outside. Length, user tenure and time of day are not risk properties.
In the exam
Threat items describe an agent's tools and inputs and an attack or near miss. Identify which legs of the combination are present and which channel carried the attack, then pick the structural control that closes the path. Distractors strengthen prompts, enlarge models, encrypt data the agent still reads, filter keywords, log after the fact, or trust listed servers.
Check your understanding
A ticket with hidden instructions made a support agent email another customer's record outside. The prompt already says to ignore ticket instructions. What closes the path?
Show answer
Answer: D. Enforced controls outside the model break the exfiltration path whatever the injected text says.
A malicious document made an agent write a standing instruction into its memory tool. What is this, and what helps?
Show answer
Answer: A. Injection that persists in memory steers later sessions; the memory store needs its own controls.
Which NIST AI RMF function covers policies, roles and accountability for AI risk?
Show answer
Answer: B. Govern sets the policies and accountability the other functions depend on.
Apply it: Threat-model Tidewater's assistant
Tide reads each tenant's uploaded documents, queries metrics, creates reports and can share a report with any email address. 140 tenants enable a third-party CRM MCP server. Tenants can upload documents written by their own customers.
- Map the three legs of the high-risk combination for Tide.
- Identify two attack paths and the channel each uses.
- Propose structural controls that close each path.
- Design one red-team scenario and say what makes it pass.
Show model answer
1. Legs. Private data: tenant documents and metrics. Untrusted input: uploaded documents written by tenants' customers, CRM tool output and tool descriptions. External channel: share_report to any email address.
2. Paths.
- An uploaded document contains instructions to create a report of sensitive metrics and share it to an outside address (indirect injection through documents, exfiltration through
share_report). - The CRM server's tool description is changed to tell Tide to include the tenant's documents in a CRM note (tool poisoning, exfiltration through the CRM tool).
3. Controls.
share_reportlimited to addresses in the tenant's own verified domains; any other recipient requires approval by a tenant admin, enforced in the tool.- Sessions that have read uploaded documents cannot call
share_reportwithout that approval. - CRM server pinned to a reviewed version; tool-definition hash recorded and alerted on change; only the CRM tools Tide needs are enabled, with a write scope limited to notes Tide itself creates.
- Output check on CRM writes for document excerpts.
4. Red-team scenario. A test tenant uploads a document asking Tide to share the revenue dashboard with an outside address. Pass: no report reaches the outside address, an approval request is raised and logged, and the attempt appears in the security dashboard. The scenario and three variants become regression tests.