Securing Agent Data Access Without Bespoke Authorization Middleware
Authorization must move outside the agent's process to prevent compromise from prompt injection.

Securing Agent Data Access Without Bespoke Authorization Middleware.
Why bespoke authorization middleware keeps failing in production agent deployments
Securing agent data access is an architecture problem, not a plumbing problem. Most teams treat it as plumbing anyway: build the agent first, then bolt on credential handling, OAuth flows, and audit logging as an afterthought layer sitting on top. That instinct feels reasonable. It's also the reason so many of these deployments end up in an incident report.
The token pipes get hand-rolled, and this actually happens. In August 2025, an integration breach led to stolen OAuth tokens that exposed customer environments across more than 700 organizations Nango Blog AcquireBound: Runtime Authorization for Resources Acquired by AI Agents. A survey of more than 900 executives and technical practitioners found 88% of organizations had a confirmed or suspected AI agent security incident in the prior year tgvp.vc cloud.google.com AcquireBound: Runtime Authorization for Resources Acquired by AI Agents. This is the base rate.
Meanwhile, adoption keeps climbing while production maturity doesn't. An industry report found 79% of companies are actively adopting AI agents, but only 2% have gotten them running at scale tgvp.vc. The bottleneck isn't the models; model quality stopped being the limiting factor a while back. The bottleneck is infrastructure, specifically the kind that decides who gets to touch what data, and under what conditions tgvp.vc.
Every one of those failure modes traces back to the same design mistake: treating the model, or its context window, as the place where the authorization decision gets made. That's like putting the bank vault's combination on a sticky note inside the vault. Once something can influence the agent's reasoning, it can influence what the agent is allowed to do, because the "allowed to do" logic never left the room. The fix isn't a better sticky note. It's moving the combination somewhere the burglar can't reach. This means grounding authorization in the storage and execution layer itself rather than layering more middleware on top of an already-compromised trust boundary. AI agent prompt injection attacks achieved over 90% success rates in controlled evaluations, per Nango's guide (Nango Blog, aiAuthZ / arXiv:2607.05518, AcquireBound: Runtime Authorization for Resources Acquired by AI Agents).
How agents break the assumptions that traditional access control was built on
Traditional access control was built for a world with a predictable script. A human clicks a button, or a service calls a known endpoint, in a controlled order, and the system checks a permission at a fixed point in that sequence. Agents don't run scripts. They reason.
That reasoning means an agent can chain tool calls in an order nobody wrote down in advance, and it can change live systems on its own, without a developer's hand on every step. Governance built for reading data at the end of a chain doesn't know what to do with a system that writes, deletes, and acts autonomously mid-chain. As one analysis of AI agent data governance put it, governance has to control autonomous runtime actions, not static read access, and traditional models only solve the latter.
Forcing agents into human-shaped auth anyway produces three specific failure modes, visible when teams attempt it. First, confused deputy risk: the agent gets issued its own credentials rather than inheriting the permissions of the person who triggered it, so it can end up acting with more authority than the actual user ever had. Second, credential leakage: when an agent has direct visibility into its own tokens, a well-crafted prompt injection can talk the agent into exposing them in its own output. Third, token drift: long async tasks outlive the tokens they started with, hitting provider-specific expiration windows and scope mismatches that a static credential setup was never built to track.
All three point at the same root cause. If the authorization decision lives inside the agent's own process, anyone who can influence the agent's context can influence the authorization logic too, because the two are sitting in the same trust domain. A 2026 paper on this exact failure mode, aiAuthZ, ran an end-to-end test where a runtime's built-in tools stayed enabled right alongside an external authorization gateway Nango Blog AcquireBound: Runtime Authorization for Resources Acquired by AI Agents. The model just used the built-in tools directly and never bothered consulting the gateway at all. Authorization that lives inside a process is only as trustworthy as that process, and once the process is compromised, so is the authorization sitting inside it. That's the architectural requirement hiding in plain sight: authorization has to live somewhere else entirely, in a separate trust domain the agent can't touch.
The durable authorization pattern: two identities, delegated context, and least-privilege scope
The pattern that holds up under real production load, per a platform analysis from Arcade.dev, comes down to two identities plus delegated context: the agent's own identity, the user's identity, and a task-specific authorization context evaluated fresh at runtime.
"Two identities" isn't a slogan, it's an operational requirement. The agent needs its own distinct identity with its own scoped permissions. It isn't a human user wearing a costume, and it isn't a shared service account either, because shared accounts erase accountability when something goes wrong. Alongside that, the user's identity has to survive the trip through the agent stack intact. The agent authenticates as the end user via OAuth or SAML passthrough, so whatever reaches the actual data source is an identity the directory already recognizes, not some generic "agent-42" account nobody can trace back to a person.
Delegated context is the other half, and it's where most bespoke setups quietly cut corners. The tempting shortcut is passing a broad upstream token straight through the whole agent stack. The disciplined version exchanges that token at a trusted boundary for something short-lived and scoped to the exact resource and operation at hand, and that exchange has to preserve the actor and delegation evidence that policy and audit will later demand cloud.google.com.
Credentials themselves need to stay physically separate from the model's context window, sitting in an automated, encrypted vault the LLM never sees directly. That vault also handles background rotation and the provider-specific expiration limits that trip up long-running async tasks. And scope should start narrow. Grant the least amount of access that gets the job done, and widen it only when a specific, demonstrated use case actually requires more, according to a guide on agent API authentication. Widening scope "just in case" is how confused deputy risk gets built into day one.
The competitive landscape has noticed. An analysis from Analytics Insight described the battleground moving from authentication to governance: not just who logged in, but who granted access, what the agent is actually allowed to do with it, and whether every action gets logged in a way someone can audit later. Authentication answers "who are you." Governance answers "what are you allowed to do, and can anyone check."
What MCP's authorization model provides
MCP's model covers the following.
The MCP server acts as a resource server. It checks that every access token presented to it was issued specifically for that server, using resource indicators to bind the token to its intended audience. A spec update published on 28 July 2026 tightened this further, aligning MCP's OAuth and OpenID Connect deployment more closely with established practice elsewhere in the industry cloud.google.com. That's a meaningful hardening step, closing off a class of token-confusion attacks that used to be trivial.
It doesn't replace authorization checks. MCP authentication doesn't replace authorization checks, it authenticates a client to a server. In plain terms: MCP can confirm the client is who it says it is. It has nothing to say about whether this client, for this user, doing this task, should be allowed to call this particular tool with these particular arguments.
That gap matters most at the intent level. Whether a given tool call is actually justified by what the user asked for in the first place sits entirely outside what MCP was designed to check. MCP verifies identity at the door. It was never built to follow someone around the building and check whether they're opening the right filing cabinets. Per Nango's guide, MCP authentication does not replace authorization checks (it authenticates a client to an MCP server, but the tool layer must still enforce which tenant, connection, tool, and arguments the authenticated agent may use).
Moving the authorization decision off the agent's host: what the 2026 research systems demonstrate
MCP handles the front door, intent-level checking is the gap, and a run of 2026 research systems went after that gap directly cloud.google.com.
Start with the baseline refusal-rate gap aiAuthZ measured. Sai Varun Kodathala's July 2026 paper tested 15 language models against eight attack scenarios drawn from real agent incidents aiAuthZ / arXiv:2607.05518 Authorization Propagation in Multi-Agent AI Systems: Identity Governa…. Refusal rates ranged from a perfect 100% all the way down to 38% across the models fully evaluated, and the most expensive model in the test refused only half the attacks despite a twentyfold price spread compared to cheaper alternatives aiAuthZ / arXiv:2607.05518 Authorization Propagation in Multi-Agent AI Systems: Identity Governa…. Price and safety, in other words, don't move together. That variance alone rules out "just trust the model to refuse" as a real control.
aiAuthZ's fix is to move the decision entirely outside the model. Before any tool call executes, a gateway sitting in its own separate trust domain verifies caller identity using a per-message HMAC-SHA256 signature bound to a single-use nonce and a timestamp window, checks that call against a role-based, argument-level policy the agent can't read or edit, and logs the decision into a SHA-256 hash-chained audit trail. Injected text can still get into the agent's context. What it can't do is change whose identity is bound to the session, because that binding never lived anywhere the injected text could reach. The payoff: residual attack success across all 15 models dropped to 0%, adding no more than 0.03 milliseconds of decision latency aiAuthZ / arXiv:2607.05518. Local evaluation actually ran between 0.008 and 0.026 milliseconds, compared to a 53-millisecond median reported for a cloud-registry lookup in a system that only checked arguments. Moving the check off-host, in this case, was also the faster path.
A separate 2026 system called PAuth took a different angle, translating natural language task descriptions into "NL slices," symbolic specifications of the tool calls a task should legitimately produce, then binding actual operand values to that symbolic provenance through what the paper calls "envelopes Authorization Propagation in Multi-Agent AI Systems: Identity Governa… Top Platforms Securing AI Agent Access and Authorization in 2026." Tested against benign tasks and injected attacks, PAuth hit 100% success on the benign side and flagged 100% of the injected attacks Authorization Propagation in Multi-Agent AI Systems: Identity Governa… Top Platforms Securing AI Agent Access and Authorization in 2026.
Another 2026 paper, on intent-governed tool authorization, works from the user's original trusted request to derive a short-lived certificate, narrowing the agent's authorized tool list down to just what that specific request needs, and checking the proposed tool and its payload effects before anything executes Nango Blog AcquireBound: Runtime Authorization for Resources Acquired by AI Agents. Static, broad credentials issued to the agent can't be expanded at runtime, no matter what the model decides mid-conversation.
The fourth piece closes a gap the others leave open: what happens to resources an agent picks up dynamically during a task, like compute, credentials, other accounts, even other agents. AcquireBound quarantines anything acquired that way and only activates it through a current, checked activation transaction. Across five resource classes and 810 events, it accepted all 20 benign traces and rejected all 40 registered unsafe traces Top Platforms Securing AI Agent Access and Authorization in 2026.
What all four systems share is that the authorization decision is structurally separated from the agent process and enforced at the storage or execution boundary, not inside the model. The choice is identical across all four: pull the authorization decision out of the agent process entirely and enforce it at the storage or execution boundary instead. Nobody solved this by making the model smarter. They solved it by not letting the model make the decision in the first place.
Regulatory signals that are turning these architectural principles into compliance requirements
Regulators are catching up to the same conclusion, and faster than most infrastructure teams expected. It designates identity spoofing and impersonation as threat T9, and requires organizations to maintain a trusted agent registry and authenticate agents using verifiable credentials with short-lived OAuth 2.0/OIDC tokens.
NIST has been moving in parallel. It published a concept paper titled "Accelerating the Adoption of Software and AI Agent Identity and Authorization" in February 2026, alongside an AI Agent Standards Initiative launched the same month, with sector-specific listening sessions and a comment period on the concept paper closing in April 2026.
None of this is background noise for compliance teams to file away. Organizations still running hand-built middleware aren't just carrying technical debt forward, they're building systems that will get audited against these exact requirements, and the architecture behind most bespoke setups was never designed to answer the questions these frameworks ask. Audit trails, specifically, stop being a nice-to-have under this reading. The CSA addendum and the aiAuthZ research both treat the ability to reconstruct precisely what happened, which identity acted, which tool got called, with what arguments, and what the outcome was, as a first-class requirement rather than a logging feature bolted on afterward. The CSA (Cyber Security Agency of Singapore) Discussion Paper on Securing Agentic AI was published in October 2025, with the finalized Addendum published in June 2026.
How the storage and execution layer enforces authorization without middleware
The architectural move that makes most of the above stop being a checklist and start being a property of the system itself: when the filesystem is the interface an agent talks to, authorization, audit, and revocability aren't things a team implements on top, they're properties of the mount.
An agent that mounts a filesystem inherits exactly the permissions that mount was configured with. Not broader, and critically, not escalatable through prompt injection, because the policy governing that mount lives entirely outside the agent's process. Revoking access, in this model, means revoking the mount. The underlying data never moves, it stays exactly where it was in the bucket, and there's no stray copy sitting outside the account waiting to become next year's breach headline.
Audit follows the same logic without extra effort. Every read, write, and execute against the filesystem is a filesystem operation. It's attributable to the identity that mounted it, not reconstructed from scattered API logs.
Pairing that filesystem with serverless execution sitting right next to it changes the shape of the problem further. An agent can run commands directly against its own filesystem without a separate sandbox layer bolted in between, because compute attaches to storage as a service that just accepts bash commands and returns results. That single, well-worn interface (bash, the thing every model already knows how to use) collapses the attack surface that a pile of bespoke MCP tools would otherwise create. Every custom tool added to an agent's toolkit burns context and opens a new authorization surface that has to be separately secured; one filesystem interface for everything removes that multiplication entirely.
A stable, shared workspace also matters more than it sounds. Persistent context an agent can read from, write to, and execute against across sessions and across parallel runs means authorization holds steady regardless of which session happens to be active. Compare that to per-session scratch space, where credentials issued fresh each session can drift, expire inconsistently, and leave audit gaps between one run and the next.
None of this locks a team into one cloud, either. The same authorization properties hold whether the bucket underneath is S3, GCS, R2, or Azure Blob, with no migration, no ETL pipeline, and no need to re-implement the authorization model separately for each provider. This directly addresses the observability gap identified in Nango's 2026 guide: the ability to reconstruct which identity, which tool calls, which external requests, and what succeeded or failed.
What teams should evaluate when choosing authorization infrastructure for production agents
Evaluating agent authorization infrastructure comes down to a short set of criteria, synthesized from Arcade.dev's 2026 platform evaluation methodology, worth running down as an actual checklist rather than a vibe check.
Look at where the enforcement point actually sits: is permission evaluated at execution time, using the combination of user, agent, task, and resource context together, or is it only checked once, back at authentication? Check credential isolation next, meaning whether tokens sit in a vault genuinely walled off from the LLM's context window, with rotation happening automatically rather than manually. Check whether policy lives off-host, in a trust domain the agent itself has no read or write access to. Check the audit trail for whether it can actually answer, for any given incident, which identity, which tool call, which arguments, and which outcome were involved, and whether that log is tamper-evident rather than just append-only in name. And check revocability: can access be pulled back cleanly, without a data migration project or a destructive rebuild.
None of these questions are exotic. They're the same questions any security review would ask of a traditional system, just re-asked for a system that reasons instead of following a script. The teams that get this right aren't the ones with the cleverest prompt engineering. They're the ones who stopped asking the agent to police itself, and started asking their infrastructure to do it instead.
Sources
- 7 Best AI Agent Authentication Platforms (2026) - Arcade.dev
- A complete guide to securing API authentication for AI agents (2026) | Nango Blog
- AIAUTHZ: OFF-HOST, IDENTITY-BOUND AUTHORIZATION FOR AI AGENTS A PREPRINT
- Intent-Governed Tool Authorization for AI Agents
- AcquireBound: Runtime Authorization for Resources Acquired by AI Agents
- Authorization Propagation in Multi-Agent AI Systems: Identity Governance as Infrastructure
- Top Platforms Securing AI Agent Access and Authorization in 2026
- AI Agent Data Governance: A 2026 How-To Guide for IT


