·7 min read·Ofir, Marshal Team

Prompt Injection Is an Egress Problem

You can't reliably stop an agent from being convinced. To prevent prompt injection data exfiltration, control what a convinced agent can send next: egress.

Security researcher Simon Willison has been tracking prompt injection since the term was coined, and his assessment has barely moved. In his writing on MCP prompt injection, he puts it plainly: "The curse of prompt injection continues to be that we've known about the issue for more than two and a half years and still don't have convincing mitigations." That is not pessimism. It is an accurate description of where the model layer stands.

The research keeps confirming it. Public red-team work has repeatedly shown the same shape: a plaintext instruction is refused, but the same instruction, encrypted and then decrypted by the agent in its own environment, is obeyed, and a single piece of untrusted content, such as a crafted email or a poisoned document, can steer an agent toward a user's connected accounts. The pattern repeats: some payloads fail, some get through, and the set that gets through changes every time someone invents a new wrapper.

If you cannot reliably stop an agent from being convinced, the useful move is to stop what a convinced agent can do next. Every prompt injection that matters ends the same way: the agent has to send something somewhere. That step is not probabilistic. That step you can control.

A five-stage prompt-injection kill chain: ingest, decode, execute and find-secret are marked probabilistic at the model layer, while the final egress stage is marked deterministic with an allow, passthrough, or deny verdict enforced at the network boundary

Model-layer defences are probabilistic

Every defence that lives inside the model is a probability, not a guarantee. A classifier that catches 99% of injection attempts is a classifier an attacker queries until they find the 1%. A system prompt that says "ignore instructions in retrieved content" is an instruction competing with other instructions, resolved by the same machinery that is under attack.

The encrypted-payload results make this concrete. The model refused the attack it could read and performed the attack it had to decode first, because the refusal and the capability are the same faculty pointed in different directions. The lethal trifecta, as Willison frames it, is any system that combines access to private data, exposure to untrusted content, and the ability to make external requests. Coding agents are all three by default. You are not going to prompt your way out of a property that is baked into what the agent is.

This does not mean model-layer defences are worthless. They reduce volume, and volume matters. It means they cannot be the thing a control depends on, because their failure mode is silent and adversarially reachable.

Every exfiltration needs a hop

Here is the leverage. Whatever an injected instruction tells the agent to do with your data, the data still has to leave, and it can only leave through a small number of exits: a network request to some destination, a write to a shared location, or a tool call that itself has egress.

Those exits are not probabilistic. A network request either goes to an allowed destination or it does not. A tool call either has egress or it does not. At that layer you can make a deterministic decision, because you are no longer reasoning about the model's intent, you are evaluating a concrete action against a rule.

This is the shift the title asks for. Prompt injection feels like a model problem because it starts in the model. It becomes a security problem at the hop, and the hop is a network event you own.

Deny by default, then allow by destination and verb

The control that follows is deny-by-default egress. Unknown destinations are blocked and logged. Known destinations are allowed by rule. Credentials are bound to the destinations they are meant for, so a token for one service cannot be replayed against another. And the decision happens before the request leaves, not after.

That last point separates a control from a report. A guardrail that warns after the code has run, or logs the request after it has left, has documented an incident, not prevented one. The only version that stops exfiltration is the one that blocks first and reviews second. Deny, then allow by exception, is the posture that makes a convinced agent harmless at the exit even when the model layer was fooled at the entrance.

The hard case: exfiltration to allowed domains

The honest difficulty is that not every exit is an unfamiliar domain. Some exfiltration rides out through destinations you have to allow: a gist on a code host you use, a comment on an issue tracker you depend on, a paste to a service your developers need.

A destination allowlist alone does not catch this, which is why the granularity has to go deeper than the hostname. A GET to fetch an issue is not the same action as a POST that creates a public comment on the same host. Reading a repository is not pushing to one. Verb and path have to be part of the decision, so that "allowed host" does not silently mean "allowed to send anything anywhere on that host." The destinations you cannot block are exactly the ones where verb-level and path-level policy earns its place.

What still needs the model layer

Egress control is not a universal solvent, and saying so is part of being trusted. Stopping what leaves does not stop an agent from being convinced to write bad code, open a flawed pull request, or make a wrong change inside the systems it is already allowed to touch. Those are real risks, and they live upstream of the hop.

So egress control pairs with the other layers rather than replacing them: code review for what the agent writes, scoped permissions for what it can touch, and human approval for consequential actions. The claim is narrow and defensible: the exfiltration step is where deterministic enforcement is possible, and most teams are not enforcing there yet.

An architecture review question set

Six questions to take into any agent deployment review:

  1. If the agent is convinced to exfiltrate, which exits exist, and is each one mediated?
  2. Are unknown destinations denied by default, or allowed until someone notices?
  3. Are credentials bound to destinations, so a token cannot be replayed elsewhere?
  4. For the hosts you must allow, can policy tell a read from a write, a GET from a POST?
  5. Does enforcement happen before the request leaves, or does the log arrive after?
  6. Where do the egress records live, and can you query them after an incident?

If the answers are vague, the deployment is betting on the model layer holding. The research says that is a bet that eventually loses.


Prompt injection has resisted a convincing model-layer fix for years, and the latest encrypted-payload and single-email results suggest it will keep resisting. The way out is to change the layer. Every exfiltration needs a hop, the hop is a network event, and network events can be judged deterministically: deny by default, allow by destination and verb, decide before the data leaves, and keep the receipts. Treat prompt injection as a network problem and the model's unreliability stops being the thing your security rests on.

This extends the data-exfiltration argument from the problem nobody is auditing → into the defensive posture that answers it.


Marshal denies unknown destinations by default and logs every egress verdict to storage you own. Book a demo →

securityai-agentsprompt-injectionegress

Marshal runs AI agent sessions in isolated Kubernetes pods: credential isolation, audited egress, per-verb tool policy.

Book a demo →