Estimated read: 7-8 minutes
This is the second post in our series on fine-grained authorization for AI agents. The first post opened the series by recapping our Java Day Istanbul 2026 talk and introducing the open-source Keymate Authz Toolkit. Here we step back from the demo and the toolkit to the underlying why: why authentication alone falls short for AI agents, what the IAM ecosystem has built around the problem, and how a recent publicly reported incident makes the gap concrete.
Before autonomous AI agents became widespread, the communication line was reasonably simple. End user on one side, the system they wanted to reach on the other. In between, an API gateway, an authentication layer, and a bit of business logic. The decision mechanism was just as simple. Answering "is this token valid, can this user call this endpoint" was enough for most cases.
That line has changed. A new actor has entered between the end user and the system: the AI agent. And this actor is not a passive intermediary. It is a software client that acts autonomously, makes its own decisions, and talks to multiple systems in sequence. The agent communicates with an LLM, triggers various tools through function calling, reaches into other systems via MCP servers, and even talks to other agents like itself using protocols such as A2A.
Data flows between these points. Every connection point is a potential risk. The predictable access pattern we knew from classic applications has given way to a far broader, far more dynamic attack surface. In this new topology, every node can acquire a token, every token can reach into another system, and the decision chain can run far deeper than in classic applications.
The consequence: "Has the agent's identity been verified?" does not solve the authorization problem. Authentication is the starting line, not the finish. The real question is sharper: what data can this agent access, under what conditions, on whose behalf? And how can we explain that decision?
Authentication is not enough for agentic AI systems. What is needed is authorization, and not just any authorization. It must be fine-grained, explainable, and testable.
This problem is not on our radar alone. The identity, security, and governance ecosystems have all entered a serious adaptation effort over the past few years. Standards, drafts, governance toolkits, and risk lists are being published in quick succession. Let us briefly summarize who is saying what.
As of May 2026, this IETF draft, now at draft-06, is trying to formalize the distinction between actor and principal directly in an AI agent context. In other words, it separates "who is making this call" from "on whose behalf this call is being made" at the token level. The agentic_ctx field introduced in the latest revision carries agent type, intent, and permitted actions into the token as operational context. This approach lines up conceptually very well with condition inputs such as agent.type and actor.id in the Declarative Policy Artifact model, which we describe in Part 3.
XAA standardizes identity-assertion-based cross-domain token exchange. In other words, an agent can use an identity assertion obtained from its enterprise IdP to receive a scoped access token from an external tool's authorization server. The draft's appendix includes an LLM agent example.
Protected Resource Metadata is, in our context, the only RFC published so far. It lets a resource server publish, as metadata, which authorization servers it accepts, which scopes it supports, and which token presentation methods (such as DPoP or mTLS) it requires. It makes the question "to whom and for what was this token issued?" visible at the protocol level and feeds the discipline of audience-restricted tokens at ecosystem scale.
AAuth is trying to solve how an agent should obtain a token on a user's behalf. Its most striking thesis is that handing a broadly scoped service account token to an agent is dangerous, because under hallucination or prompt injection the action may be carried out on behalf of the wrong user. This draft frames hallucination not merely as a model quality problem but as a direct authorization risk.
OWASP published, on top of the LLM Top 10 (2025), a separate Top 10 for Agentic Applications this year. The LLM Top 10's Excessive Agency item says, under the complete mediation principle, that the authorization decision must be left to downstream systems, not the LLM. The Agentic Top 10's Identity & Privilege Abuse item directly recommends per-action authorization and a centralized policy engine. The Tool Misuse item puts the least-agency principle at the center. Microsoft's Agent Governance Toolkit, announced in early April, also intercepts every action before execution through a framework-agnostic stateless policy kernel.
The message of this list is clear: with the rapid adoption of AI Agents, there is real momentum on the identity, security, and governance sides in terms of awareness and proposed solutions. How tokens are obtained, how identity propagates, how governance is set up, how risks are mapped, every one of these has proposed answers. These efforts solve important parts of the identity, delegation, and governance problem, but they do not remove the need for a separate condition-level authorization layer.
That gap is exactly the focus of this article.
On 25 April 2026, PocketOS's production database was deleted in roughly nine seconds by an autonomous AI agent. Based on publicly available information about the incident, the anatomy of the event reads as a textbook example of precisely the gap that the drafts and reports we listed above point to.
Summary of the event: an autonomous coding agent running in a staging environment used a Railway API token it found in the system to advance its task. The token had been created for custom-domain management, but it carried blanket authority across Railway's entire GraphQL API, destructive operations included. The agent executed the volumeDelete mutation without any approval. Reservation, payment, vehicle, and user data were deleted.
Now let us read this event through the lens of the standards above:
The problem this and similar incidents expose is not that the agent made a mistake. The problem is the absence of a condition-level authorization layer to stop the agent when it does. To put it more plainly, the rule "this agent, in this environment, on this user's behalf, cannot execute destructive operations without approval" had not been declared anywhere, and therefore could not be enforced anywhere.
This is a single recent incident. But it is the concrete invoice for the gap pointed to in every draft and report we listed up to this point. The standards are not only pointing at a future risk; they are describing patterns that are already showing up in production.
The gap is now clear, and it has a concrete invoice attached to it. "What data, under what conditions, can be accessed?" is, despite all the progress on the identity and protocol sides, still an open door. The way to close it runs through the combination of declarative policy artifact, centralized evaluation, design-time test, and same semantics at runtime.
In the next post we walk through that combination as Keymate builds it:
We also follow the live demo we ran at Java Day Istanbul 2026: one policy, five scenarios, two social-engineering attempts, and an AI agent that is both unwilling and technically unable to bypass the policy.
📖 Next in the series: how declarative policy, a centralized decision engine, and a design-time CLI close the fine-grained access gap, with the same rule enforced identically at design time and runtime.
Series nav
← Part 1: AI Agent Authorization: From Java Day Demo to Open Source Toolkit
→ Part 3: How Keymate Enforces Fine-Grained Authorization for AI Agents
See how Keymate brings declarative, condition-level authorization to agentic and classic workloads alike.
Stay updated with our latest insights and product updates