The Lethal Trifecta: The 3 Things Your Agent Must Not Combine
Private data, untrusted content and an outbound path. Hold all 3 and no prompt saves you, so the fix is architectural.
AI-drafted, reviewed by Muhammad Qasim Hammad on November 16, 2026. See our AI disclosure.
Table of contents
Most agent security advice is a list of things to add. This one is a list of things to not have at the same time. An agent that can read your private data, process content an attacker controls, and talk to the outside world is exploitable, and no amount of careful prompting changes that. The useful move is architectural: make sure your agent never holds all 3 at once.
What are the 3 legs?#
Access to private data, exposure to untrusted content, and the ability to communicate externally. Any agent holding all 3 at once can be instructed by an attacker to read something sensitive and send it somewhere, and the instruction arrives inside content the agent was asked to process.
Each leg is worth stating in its strongest form, because each is also a feature somebody asked for:
| Leg | What supplies it | What removing it costs |
|---|---|---|
| Private data access | The tools that make the agent useful at all | Usually the entire point of building it |
| Untrusted content | Any web page, email, document or issue it reads | Most real inputs, and most real value |
| External communication | Any tool that sends, posts, fetches or writes out | Often much less than people assume |
That third column is the whole argument. The legs are not accidents that crept in; they are the reasons the agent exists. Which is exactly why "just be careful" is not a strategy, and why the interesting question is which leg you can afford to lose.
The attack itself is unglamorous. An attacker puts instructions somewhere your agent will read: a support ticket, a web page it searches, a code comment, a calendar invite. The agent reads that content as part of doing its job, treats the embedded instruction as something to act on, retrieves data it legitimately has access to, and sends it out through a channel it legitimately has. Every individual step is the agent working correctly.
Why can't a better prompt fix this?#
Because a model cannot reliably tell where an instruction came from. System prompt, user request and retrieved web page arrive as one stream of tokens, so text smuggled into a document carries the same authority as your own instructions. Defensive wording reduces the rate and never reaches zero.
This is the part people resist, usually by proposing a stronger system prompt. The difficulty is not that nobody has written a good enough instruction; it is that the defence has to hold against every possible phrasing of an attack, and you only need to lose once. Willison's framing is blunt about the odds: given the infinite number of ways malicious instructions could be phrased, confidence that your protection works every time is not available.
The architectural explanation is the same one OWASP's agentic security work gives. Models treat the system prompt, the user's request, and text retrieved from external sources as a single stream of tokens, with no reliable mechanism to separate commands from data. Hostile text smuggled into a document, a calendar invite or a web page carries equivalent authority to whatever you wrote.
That is also why prompt injection ends up implicated in so much else. OWASP's State of Agentic AI Security and Governance maps it to 6 of the 10 categories in its Top 10 for agentic applications, which is less a statement about one vulnerability than about a shared root cause underneath many of them.
It is worth noticing which agents are most exposed by this, because it is not the ones people worry about. OWASP's own tracking found 28 of 53 agentic projects it surveys are coding agents, and that the 5 fastest-growing tools are all coding agents. A coding agent reads issues and repositories written by other people, holds credentials and source code, and can execute commands with network access. That is the full trifecta in the single most widely adopted category of agent there is.
None of this makes prompt-level defences worthless. They raise the cost of an attack and catch lazy attempts, which is a real if modest benefit, and the tactical measures in defending n8n agents against prompt injection are worth having. They are simply not a boundary, and treating them as one is the mistake.
What is the Rule of Two?#
Meta's operational version of the same insight. An agent running without human approval may hold at most 2 of the 3 properties; wanting all 3 means a human has to be in the loop. It converts an architectural observation into a rule you can actually check.
The value of phrasing it this way is that it is auditable. "Be careful about prompt injection" cannot be reviewed; "this agent has private data and untrusted content, therefore it must not have an outbound path, or it needs an approval step" can be, by someone reading a config file. It turns a security property into something a checklist can hold.
It also names the escape hatch honestly. Sometimes an agent genuinely needs all 3, and the answer in that case is not a cleverer prompt but a human confirming consequential actions. That is a product decision with a real cost in friction, which is precisely why it should be made deliberately rather than discovered after an incident.
Which leg should you actually remove?#
Usually the exfiltration path, because it is the one whose removal costs least. Private data access is normally the entire point of the agent, and untrusted content is unavoidable the moment it reads anything from outside, but arbitrary outbound communication is often an accident rather than a requirement.
The reason this leg is cheapest is that it is rarely a deliberate design choice. Outbound capability arrives through tools added for other reasons: a fetch tool for research, a webhook for notifications, an email sender for reports, a code interpreter with network access. Each was added to solve something specific, and together they constitute a general-purpose exfiltration channel nobody designed.
Auditing it is more mechanical than it sounds. Enumerate every tool that can cause bytes to leave your boundary, including the indirect ones, and ask what breaks if that tool can only reach an allowlist. In many agents the honest answer is nothing, because the outbound need was always to 2 or 3 known destinations rather than to the internet. That is the same principle as scoping an agent's permissions and sandbox, applied to the network rather than to the filesystem.
Watch for the indirect paths, which are the ones that survive a first pass. A tool that renders a Markdown image will fetch the URL in it, and a URL can carry data in a query string. A web search tool that follows links is an outbound channel. Anything that writes to a shared location an attacker can read later is exfiltration on a delay, and the same care that goes into choosing web search tools for agents belongs on every tool that touches a network.
What if you cannot remove any of them?#
Then you are back to containment and human approval, which is where the Rule of Two points. Constrain what each leg can reach at runtime, require a person to confirm consequential actions, and log every outbound call so an attempt is visible even when it is not blocked.
The design principle Willison cites is a good statement of the target: once an agent has ingested untrusted input, it must be constrained so that input cannot trigger consequential actions. That is a strong condition and worth reading twice, because it implies the constraint is applied at the point of ingestion, not at the point of action. An agent that reads a hostile page and then decides for itself to be careful has already lost; the constraint has to be external to the model's judgement, which is what a policy gate running before inference provides at one layer and a network allowlist provides at another.
There is a sequencing point hidden in that principle too. Containment applied after the model has decided what to do is usually a filter on its output, and a filter is a classifier with a false-negative rate. Containment applied to what a tool can reach is a boundary, and a boundary either holds or does not. Preferring the second is the difference between reducing the probability of exfiltration and removing the route.
Observability is the consolation prize when prevention is impossible. If every outbound call is logged with what triggered it, an exfiltration attempt leaves a record even when it succeeds, which turns an invisible breach into an investigable one. That is a genuinely lower bar than prevention, and it is worth setting deliberately rather than arriving at by default.
The reason this framing has lasted is that it is honest about the trade. Every leg is something someone wanted, the model cannot be relied on to police itself, and the only durable controls are the ones that operate outside it. Agents get more useful as they accumulate all 3 properties, which means the pressure will always run toward the dangerous configuration. Knowing the shape of it is what lets you notice when a routine integration ticket has quietly completed the set.
Frequently asked questions
What is the lethal trifecta?
Why can't a stronger system prompt prevent this?
What is the Agents Rule of Two?
Which capability should I remove first?
What counts as an outbound path?
Written by
Muhammad Qasim Hammad is an AI agent and automation expert and the founder of Cart Gaze LLC (cartgaze.com). He builds product for the love of it: when an idea lands, a working prototype is usually running within hours, built with the same AI agents and automations he sells. He puts his own output at roughly 20× what it was before agents, and the Agentic OS behind this site is the working proof, documented in public with the tools he actually ran and what they really cost.
AI & Automation Services
Want a pipeline like this running in your business?
I'm Qasim — I design and ship AI agents and n8n automations for solo operators and small teams. Tell me what's eating your team's week, and I'll scope a fix.
Related reading
Stop Prompt Injection in n8n AI Agents: Practical Defenses
Your n8n agent reads emails, scraped pages, and RAG chunks nobody on your side wrote, and a planted instruction can hijack it. Here is the layered prompt injection defense, mapped to OWASP LLM01 and to nodes you can actually toggle.
AI Agent Guardrails: Stop Your n8n Agent From Going Off the Rails
An AI agent is a language model with hands. Without guardrails it can follow a malicious instruction, leak data, loop until your bill spikes, or return output the next node cannot parse. This guide maps the five ways an n8n agent breaks to the exact control that stops each.
Blast Radius: Sandboxing and Permissions for AI Agents
An AI agent with real tool access is only as safe as its weakest credential and its execution boundary. This post covers the containment half of agent security: scoping every tool to its own narrow credential instead of one shared key, and running anything that executes code
Your AI Stack's Weakest Link Is a Dependency, Not a Prompt
The most instructive AI security incidents of 2026 had nothing to do with models. One was a poisoned package on PyPI, the other an endpoint handing admin tokens to any caller. Both ended with code running where your credentials live.
AI Agent Tool Design: What to Expose and How to Shape It
When an agent picks the wrong tool or loops on a lookup, the cause is rarely the model. Eleven lessons on tool boundaries, descriptions that resolve ambiguity, schemas that make bad calls hard to express, and why removing a tool improves accuracy.
Giving AI Agents Web Access: Search Tools, Grounding, and Cost
A search tool turns post-cutoff questions from hallucination bait into retrievable facts, and it brings 3 problems with it: choosing sources, paying for pages that become tokens, and reading text that may be aimed at the model rather than the user. This is the wiring guide: the





