When large language models first arrived in the enterprise, we used them as assistants. Draft a roadmap. Research a topic. Write a first pass at a proposal. A person asked, the model answered, and the person decided what to do next.
Over the last year, that changed. You can now put a model in a harness, give it access to tools and services, and it will try to complete tasks on its own inside your infrastructure. Across the industry, agents now help with routine incident triage and customer-facing issues.
That makes an agent a new kind of identity. It’s a probabilistic system with access to sensitive services, and the actions it takes can be sensitive too. The security question is how to make sure it does what it is supposed to do, and nothing more.
Two things shape my answer. First, agents act on whatever reaches them, so an instruction hidden in a web page or a package can turn a routine task into one that harms the enterprise. This is prompt injection. Second, agents are persistent. Given a goal, they look for every path to it, including paths nobody intended. In the OpenAI-Hugging Face incident, investigators said agents tried to cover their tracks. In both cases, assume an agent will find a way through. The boundaries around it have to hold, and the record of what it did has to survive it.
User intent now passes through a probabilistic layer
The risks of using coding agents in an enterprise environment aren’t new. What’s new is that a user’s request now passes through a probabilistic system before anything happens, and that system can end up doing something other than what the user meant. Sometimes that’s because an injected instruction steered it, and sometimes it’s because it pushed toward the goal in a way nobody intended.
The risk I watch most closely is data exfiltration, and for enterprises this could include customer PII, intellectual property or a proprietary algorithm. Agents often have read access to some of it. Prompt injection is one way it leaks. Another is simpler. The agent decides that moving the data helps it reach its goal, and does it.
Credential exfiltration is the same risk one step removed. Leaked keys let an attacker walk in and take the data directly. Remote code execution and supply chain compromise still matter, but most of them lead back to the same outcome, which is sensitive data leaving the boundary it belongs in.
Start with the lethal trifecta
A useful model for thinking about boundaries is Simon Willison’s lethal trifecta. It names three capabilities:
• Access to sensitive data, such as source code, PII or trade secrets. The data an agent needs to help its user.
• Exposure to untrusted content, such as a downloaded package or a web page that can carry malicious instructions. Most of the public internet falls here.
• The ability to communicate externally, such as calling an API or writing somewhere public.
Harm needs all three at once. An agent that can read sensitive data but can’t send it anywhere is, for this risk, fairly safe. Remove any one leg and the trifecta breaks.
Coding agents hold all three by default. They read source code, they install packages and read outside content, and they push to remote services. That is why their boundaries have to be designed on purpose.
Draw boundaries around classes of agents
I find it easier to design boundaries for classes of agents than for each agent on its own. Each boundary removes at least one leg of the trifecta for a whole group at once:
• Agents that touch PII. No route to the public network. They can read what they need, but they cannot read or write to the public internet.
• Agents that write outward. They may write to external domains, but they never get access to sensitive resources.
For example, say a team sets up an agent to analyze customer retention data, and that data is labeled as PII. The agent belongs to the PII class, so its boundary policy blocks public network access and any MCP tools that can reach the outside.
A class is easier to review and audit than one rule set per agent. It also lets the security team offer each boundary as a golden path. When a team wants to try a new agentic use case, it picks the class that fits and starts with a setup that’s already reviewed and enforced, instead of waiting on a new security review. Teams stay productive, and the secure path is also the easiest one to take.
Enforce the boundary at more than one point
A boundary is only as good as where it is enforced, and one checkpoint can be bypassed. I’d enforce the same boundary at several control points:
1. The sandbox edge. Ideally, every agent runs inside a sandbox. Check system calls and network calls where they leave it, so the agent reaches only the domains its boundary allows. If you build one control point first, build this one.
2. The tool gateway. Agents usually call tools through an MCP gateway or a proxy. Enforce which servers, which tools and which parameters.
3. The credential broker. If agents get credentials for external systems through a broker, authorize the action when the credential is issued.
4. The network egress proxy. A second network check that doesn’t depend on the agent’s runtime. It matters in two cases. Some agent harnesses your workforce wants to use can’t be sandboxed, so the proxy becomes their main network control. And sandboxes are still new and unproven, so even where you have one, the proxy is a fail-safe if the sandbox has a gap.
5. The receiving service. The service that gets the request authorizes it too. This is zero trust applied to agents.
If one layer is misconfigured or skipped, the next one still holds.
Check intent, not just permission
Existing access controls aren’t going away. RBAC, ABAC and ReBAC, whether on Open Policy Agent or something more involved, are deterministic. Given an identity, an action and a resource, they say whether it is allowed. Use them to enforce the boundaries above, such as which domains, MCP servers, tools, parameters and credentials an agent’s boundary allows.
The limit is that agents need broad access to be useful, so most of the time the deterministic check passes. Intent-based access control (IBAC), usually backed by a model and so non-deterministic, sits on top of it. A standing permission alone doesn’t mean the call goes through. Each action is also checked against what the user asked for.
Coding agents make this practical through hooks, such as pre-tool-call hooks, where you can see the user’s prompt and the tool call about to run. Deterministic controls and non-deterministic ones like IBAC work together. You need both to keep an agent’s actions narrower than its standing access.
Agents should have their own identity
Ideally, an agent doesn’t carry the identity of the user it acts for. It uses a standard workload identity, the same way a service does, and its token also says which user it’s acting on behalf of, for example through the act claim from OAuth token exchange. A receiving service can then tell a direct user request apart from an agent acting for that user, and authorize each one differently.
An agent should use the user’s own identity only when the system it calls can’t understand non-human identities and only accepts user-based ones. That’s still common with older platforms and some third-party services. Treat it as a workaround for those systems, not the architecture.
Keep the logs out of the agent’s reach
Every action should trace back to the user the agent acted for and the goal it was given. Less attention goes to where that record is stored.
An audit log the agent can tamper with is not an audit log. The agents in the OpenAI-HuggingFace incident tried to cover their tracks. An agent persistent enough to reach its goal can be persistent enough to remove the evidence.
So emit audit events where the agent can’t override or delete them, at the system-call level or just outside the sandbox.
Map. Bound. Observe.
If I had to give security teams an approach to securing agents within their enterprise, it would be three steps:
1. Map. Find every agent use case, including how employees use agents, which tools they use, and how agents run in production.
2. Bound. Design boundaries for classes of agents and enforce them at every control point, with deterministic and non-deterministic controls.
3. Observe. Watch and analyze what agents do, from a record they can’t alter. Detect when behavior deviates from normal, and cut access when it does.
Observation matters because a boundary you set once and never watch won’t hold against an agent that keeps looking for a way through.
Make sure every way it finds leads to a boundary, and every step it takes leaves a record it can’t erase.
We discussed these ideas with Yash Prakash and Connor Hammersmith on Reva AI’s podcast episode, “Coding Agents at Scale: Identity, Authorization and Audit.” Listen to the full conversation here: https://revaai.wistia.com/s/mxs4rg59017lwke
The views in this post are the author’s own and do not necessarily represent those of his employer.
References
1. Simon Willison, The lethal trifecta for AI agents(June 16, 2025)
2. METR and Redwood Research, Brief independent investigation of agents’ behavior, reasoning and collaboration in the OpenAI /Hugging Face hacking incident (Aug 26, 2026)
3. Reva AI podcast, “Coding Agents at Scale: Identity, Authorization and Audit” (Connor Hammersmith, Ashwin Sidhalinganahalli, Yash Prakash)



