DEV Community

Fabian Cooper
Fabian Cooper

Posted on Originally published at linkedin.com

The Lethal Trifecta: Why Securing AI Agents Is a New Discipline

The most dangerous AI system in your company is not the one that is wrong. It is the one that is capable, trusted, and connected, all at the same time, and that nobody has secured as the new kind of thing it is.

I keep seeing the same mistake made by careful, competent teams. They treat an AI agent as if it were ordinary software with a clever front end, and they point their existing security practices at it. Those practices are good. They are also built for a world where inputs are structured, code paths are fixed, and the attacker has to find a hole in your logic. An agent breaks all three of those assumptions on day one, and the result is a category of risk that most organisations are not yet defending against because they do not yet recognise it.

The incident that was not an AI failure

Start with the shape of how this goes wrong, because the shape is more instructive than any single headline. An agent is given a genuinely useful job. To do it, it is handed access to real systems: a database, an inbox, a code repository, an internal wiki. It is also given the ability to read content from outside, a web page, a document, a support ticket, an email. And it can act, it can call tools, send messages, write files, make changes.

Then one day it reads a piece of content that was written to be read by it, not by a person. Buried in a document or a web page is text that says, in effect, ignore your previous instructions and do this instead. The agent, which cannot reliably tell the difference between the data it was asked to process and an instruction hidden inside that data, does the new thing. It exfiltrates records, deletes a table, sends a message it should never have sent.

When the post-mortem happens, people call it an AI failure. It is not. The model did exactly what models do, which is follow the most compelling instruction in its context. The failure was architectural. Somebody built a system that had access to private data, exposure to untrusted content, and a way to send data out, and connected all three through a component that cannot be trusted to keep instructions and data apart. The AI was the trigger. The design was the gun.

The lethal trifecta

The security community has a precise name for this, and leaders should learn it, because it turns a vague fear into a thing you can actually engineer against. The lethal trifecta is the coincidence of three capabilities in one agent: access to private or sensitive data, exposure to untrusted or attacker-controllable input, and the ability to communicate externally, to act or to exfiltrate.

Any one of the three is fine. An agent that reads the open web but holds no secrets and can send nothing out is a toy, not a threat. An agent that touches private data but never sees untrusted input and cannot reach outside is a closed loop. The danger is specifically the convergence. When all three meet in a single agent, you have built a machine that an attacker can instruct, through content you did not write, to take your data and send it somewhere. And the uncomfortable part is that this is considered structurally hard to eliminate with prompt engineering alone, because the model has no reliable mechanism to distinguish trusted instructions from untrusted data that is phrased like instructions.

The strategic move, then, is not to make the model better at resisting injection, though that helps at the margin. It is to refuse to let all three capabilities sit in the same agent in the first place.

Why your existing security does not cover this

Traditional application security assumes a boundary between code and data. Your code is trusted, the input is untrusted, and the whole discipline is about validating that input so it cannot escape the lane you put it in. SQL injection, cross-site scripting, buffer overflows: these are all the same story, untrusted data smuggling itself into a place meant for trusted instructions, and we have decades of robust tooling to stop it.

An agent dissolves that boundary by design. For a language model, instructions and data are the same substance: text in a context window. There is no type system separating the prompt you wrote from the document the model is reading. Your input validation, your web application firewall, your static analysis, none of them can see the attack, because the attack is not malformed. It is perfectly well-formed natural language that happens to be persuasive. The payload looks exactly like the legitimate content, because it is content.

This is why leaders who delegate AI security to the existing appsec checklist end up exposed. The checklist is not wrong. It is simply aimed at a different war. Securing agents is a new discipline sitting on top of the old one, and it needs its own threat model, its own architecture patterns, and its own budget.

Prompt injection is not a bug you patch

The instinct of a good engineering team, faced with a new vulnerability, is to find it and fix it. That instinct misfires here, because prompt injection is not a defect in a particular prompt that a better prompt would close. It is a property of how the technology works. As long as a model reads untrusted content and treats the whole context window as one stream of language, a sufficiently clever piece of text can redirect it, and no system prompt saying please ignore malicious instructions fully solves the problem, because the attacker gets to write their instructions after yours and make them more specific.

What this means for a leader is that you should be suspicious of any vendor or team that tells you they have solved prompt injection with a guardrail, a classifier, or a cleverer prompt. Those raise the cost of an attack, which is worth doing, but they do not close the door, and treating them as if they do is how you end up confidently exposed. The durable defences are architectural, the ones that remove the attacker's reward even when the injection succeeds. Assume the injection will land, and design so that when it does, there is nothing valuable for it to reach and nowhere for it to send anything.

What a leader insists on

I will not sign off on an agent that touches anything consequential without a short, firm list, and none of it is exotic. It is the AI equivalent of least privilege, applied to a component that cannot be trusted to police itself.

Break the trifecta by construction. If an agent must read untrusted content, it does not also hold the credentials or the exfiltration path. Separate the reader from the actor. The component that ingests the outside world has no secrets and cannot send anything out; a separate, tightly scoped component takes verified, structured results and acts on them through a narrow interface. You are denying the attack by architecture, not by hoping a prompt holds the line.

Scope every credential to the floor. An agent gets the narrowest possible access to do its one job, and destructive or irreversible actions sit behind a gate a human or a separate policy holds. Design for the worst run, not the median one.

Treat the model's output as untrusted too. Everything an agent produces is validated against a schema and checked before it is allowed to trigger a real action. The model proposes; deterministic code disposes.

Red-team continuously, because this is an adversarial domain and a one-time review ages in weeks. Someone whose job is to attack your agents, with injected documents, poisoned retrieval, and hostile tickets, should be finding the holes before an outsider does.

Agents are identities, and most are ungoverned

There is a second exposure that compounds the first, and it is quietly becoming the larger one. Every agent you deploy is an account that can act. It authenticates, it holds permissions, it takes actions in your systems, and in most enterprises these non-human identities now vastly outnumber the human ones and are governed far less carefully.

A human employee has an onboarding, a manager, a joiner-mover-leaver process, an access review, an offboarding. Ask yourself whether the agents in your estate have any of that. In most places the answer is no. They were created to solve a problem, granted broad access to make the problem easy, and then forgotten, still running, still permissioned, still able to act, owned by no one and reviewed by nothing.

That is not automation. It is a population of unattributed actors with standing access to your crown jewels. The security discipline here is old and well understood, it is identity and access management, but it has to be extended to treat agents as first-class principals: each with a named human owner, least-privilege scope, a credential that rotates and expires, and an audit trail that records what it actually did. When the incident comes, the first question is always what exactly did it touch, and you must be able to answer that from your own records, not from the agent's self-report, which is precisely the thing you cannot trust.

Where this goes

The capability to build agents arrived years before the discipline to secure them, exactly as it did with the early web and then the cloud. Both of those became safe to depend on only after we built the unglamorous layers around them: the identity systems, the audit logs, the isolation boundaries, the threat models. Agentic AI is at the same point now, and the organisations that get the next few years right will not be the ones with the most autonomous agents. They will be the ones that treated agent security as a first-class product surface while everyone else was still applauding the demo.

The pull in the other direction is strong, because security is invisible when it works and the incentive is always to ship the impressive thing faster. So this comes down to leadership, not technology. The patterns are known and the tooling is maturing. What is scarce is the discipline to refuse the trifecta, to scope the credentials, to govern the identities, and to keep doing it when nothing has gone wrong yet. The leaders who build that in early will look slightly over-cautious for a while, and then look prescient the first time an injected document tries to walk out with the database.

I am still sharpening my own version of this playbook, and I would value comparing notes. If you are running agents against real systems, where in your estate do all three legs of the trifecta currently meet, and who owns the agent that sits at that intersection.


I write a field-note series on shipping AI that actually works in production. The original of this piece, and the rest, live on my LinkedIn. Originally published on LinkedIn.

Top comments (0)