Agent Identity: Every Actor Needs a Boundary
Give every agent its own principal and every tool call a short-lived token bound to one audience, the initiating user and the agent. A shared admin token makes every agent as powerful as the most privileged one.
- Topics
- Secure AI Agents
- Level
- Founder / builder
- Read
- 5 min
- Published
- 2026-11-12
- Reviewed
- 2026-11-12
The problem
On July 30, 2025, IBM reported that 13% of organizations in its annual breach study had a breach of AI models or applications. Of those, 97% said they lacked proper AI access controls. The most common cause was supply chain compromise, and most of those intrusions came through a third-party SaaS vendor [1].
The 97% points at a design pattern more than at any single vendor. Many multi-agent prototypes start with one credential: an orchestration server holds a super-admin token for the CRM, the mailbox, the file store and the ledger, and every agent calls tools through it. It works in the demo. It also means a marketing agent that reads a hostile email can reach finance tools, and the audit log shows only "orchestrator" for every action.
OWASP's Top 10 for Agentic Applications, published in December 2025, lists identity and privilege abuse among the ten main risks for agent systems [2]. The fix is not a better prompt. It is giving each actor a boundary the execution layer enforces, whatever the model says.
How it works
The diagram traces one action through four principals, connected by three verbs.
The initiating user delegates. A person starts the task, and their authority is the ceiling for everything that follows. The runtime service, the orchestrator, acts as an intermediary and never as a source of authority. The agent principal is the principal of record: each agent has its own identity, so logs, rate limits and revocation can target it. The per-tool role is the narrowest grant: one scoped token per tool, short-lived and revocable.
OAuth already has the pieces. RFC 8693 token exchange lets a service present a subject token (the user's) and an actor token (the agent's) and receive a new token for a specific target. The issued token can carry an act claim naming the actor, so the tool sees both who the action is for and who is performing it, and the claim can represent a chain of delegation [3]. RFC 8707 resource indicators bind the token to one resource through the resource parameter [5].
The Model Context Protocol's authorization specification makes the audience rule mandatory for HTTP-based servers. Clients must send the resource parameter naming the MCP server. Servers must validate that tokens were issued specifically for them. A server that calls an upstream API must not pass through the token it received, and must use a separate token for the upstream service [4]. That is the confused deputy rule in protocol form: the orchestrator cannot lend its privileges to an agent, because the downstream tool rejects a token whose audience is someone else.
Zero trust applies the same idea to time. NIST SP 800-207 grants access to individual resources per session, after evaluating the requester [6]. For agents, that means tokens measured in minutes, issued per task, with step-up approval for writes. NIST's Digital Identity Guidelines set the assurance levels for the human step: an approval that releases a payment needs stronger authentication than a login to read a dashboard [7].
In the diagram's example, the marketing agent writing to CRM contacts is within scope. The same agent reaching finance tools is denied even when the request arrives through the orchestrator, because no token with the finance audience exists for that agent.
Delegated authority, traceable end to end
Fig. 16- Initiating user
- Runtime service
- Agent principalPrincipal-of-record
- Per-tool roleShort-lived, revocable
Technical detail
Design principal-of-record, per-tool roles, token audience, step-up approvals, short-lived credentials and revocation hooks. Test cross-role credentials and revoked identities.
By the numbers
- of organizations reported breaches of AI models or applications [1]
- 13%
- of those breached organizations lacked proper AI access controls [1]
- 97%
- of the AI-related security incidents led to compromised data [1]
- 60%
- led to operational disruption [1]
- 31%
- of breached organizations had no AI governance policy or were still developing one [1]
- 63%
| Pattern | Who the tool sees | Audience bound | Lifetime | Revoke one agent |
|---|---|---|---|---|
| Shared orchestrator admin token | Orchestrator only | No | Long-lived | No, revokes all agents |
| Static API key per agent | Agent, not the user | Usually no | Long-lived | Yes |
| Exchanged delegated token | User as subject, agent in act [3] | Yes, through resource [4][5] | Minutes | Yes, at the token service |
The IBM numbers place the failure at access control, the layer this article covers [1]. The table shows why the first pattern fails every requirement at once: the tool cannot tell which agent acted, for whom, or whether the token was meant for it. Only the third pattern satisfies the MCP rule that servers accept tokens issued for themselves alone [4].
Implementation
Put a small token broker between agents and tools. It holds the mapping from agent to tool roles, exchanges the user's token and the agent's assertion for a tool-specific token, and refuses anything outside the map. The request parameters below are the ones RFC 8693 and RFC 8707 define [3][5]. The token endpoint, agent names and scopes are illustrative.
import os
import requests
TOKEN_URL = "https://auth.example.com/oauth2/token"
GRANT = "urn:ietf:params:oauth:grant-type:token-exchange"
ACCESS = "urn:ietf:params:oauth:token-type:access_token"
JWT = "urn:ietf:params:oauth:token-type:jwt"
# Per-agent, per-tool roles. Anything not listed is denied.
ROLES = {
"marketing-agent": {"https://crm.internal/mcp": "contacts:read contacts:write"},
"finance-agent": {"https://ledger.internal/mcp": "invoices:read"},
}
def token_for_tool(agent_id: str, agent_assertion: str, user_token: str, tool: str) -> str:
scope = ROLES.get(agent_id, {}).get(tool)
if scope is None:
raise PermissionError(f"{agent_id} has no role on {tool}")
resp = requests.post(
TOKEN_URL,
data={
"grant_type": GRANT,
"subject_token": user_token, # whose authority: the user
"subject_token_type": ACCESS,
"actor_token": agent_assertion, # who acts: this agent
"actor_token_type": JWT,
"resource": tool, # audience: exactly one tool
"scope": scope,
},
auth=("token-broker", os.environ["BROKER_CLIENT_SECRET"]),
timeout=10,
)
resp.raise_for_status()
# Never cache beyond expires_in, and never hand this token to another tool.
return resp.json()["access_token"]The authorization server enforces the rest: it caps the exchanged token's scope at what the user holds, sets a lifetime of minutes, and records the exchange. The orchestrator never holds tool credentials of its own. Writes that leave the company, such as sending email or moving money, need a step-up approval from the user before the broker will request a write scope.
Log every action with the user, the agent from the act claim, the tool audience, the scope and a request ID. Never log the token itself.
Test it
Every tool server must reject tokens that are not for it. The tests below run the resource-server checks against locally minted tokens with a test-only key. They cover a valid call, a wrong audience, an expired token, a missing actor, a scope outside the agent's role and a revoked agent.
import time
import jwt
import pytest
KEY = "test-only-signing-key-change-me-0123456789"
ISS, AUD = "https://auth.example.com", "https://crm.internal/mcp"
REVOKED_AGENTS = {"old-marketing-agent"}
def mint(**over):
claims = {"iss": ISS, "sub": "user-42", "aud": AUD, "scope": "contacts:read",
"act": {"sub": "marketing-agent"}, "exp": int(time.time()) + 300}
claims.update(over)
return jwt.encode({k: v for k, v in claims.items() if v is not None}, KEY, algorithm="HS256")
def authorize(token: str, needed: str) -> dict:
c = jwt.decode(token, KEY, algorithms=["HS256"], audience=AUD, issuer=ISS,
options={"require": ["exp", "aud", "sub"]})
actor = (c.get("act") or {}).get("sub")
if not actor or actor in REVOKED_AGENTS:
raise PermissionError("no valid actor")
if needed not in c["scope"].split():
raise PermissionError("scope")
return {"user": c["sub"], "agent": actor, "scope": needed} # what gets logged
def test_valid_delegated_call():
assert authorize(mint(), "contacts:read")["agent"] == "marketing-agent"
@pytest.mark.parametrize("claims,needed,error", [
({"aud": "https://ledger.internal/mcp"}, "contacts:read", jwt.InvalidAudienceError),
({"exp": int(time.time()) - 10}, "contacts:read", jwt.ExpiredSignatureError),
({"act": None}, "contacts:read", PermissionError),
({}, "invoices:write", PermissionError),
({"act": {"sub": "old-marketing-agent"}}, "contacts:read", PermissionError),
])
def test_rejections(claims, needed, error):
with pytest.raises(error):
authorize(mint(**claims), needed)Expected result: one acceptance, five rejections. Run the same cases against each real tool server in staging with tokens from the real authorization server.
- Present the marketing agent's CRM token to the ledger server. Expect HTTP 401, as the MCP specification requires for invalid tokens [4].
- Revoke an agent at the token service and confirm its next exchange fails within one token lifetime.
- Search logs for raw tokens. Expect none, and expect every tool action to name both user and agent.
Decision
Identity belongs to the execution layer, not the prompt.
- Now: remove shared admin tokens from the orchestrator. Give each agent its own principal and each tool its own audience [4].
- Next: add token exchange so tools see both the user and the agent [3]. Keep lifetimes in minutes.
- For writes that leave the company: require step-up approval from the user at an assurance level fit for the action [7].
- Always: test cross-role and revoked credentials in staging on every release.
The cost is a token broker, an authorization server that supports exchange, and a week of integration for most teams. The shared token is cheaper only until the first incident.
Sources
- [1]IBM Report: 13% of organizations reported breaches of AI models or applications, 97% of which reported lacking proper AI access controls (opens in a new tab)IBM Newsroom, July 2025
- [2]OWASP Top 10 for Agentic Applications for 2026 (opens in a new tab)OWASP GenAI Security Project, December 2025
- [3]RFC 8693: OAuth 2.0 Token Exchange (opens in a new tab)IETF, January 2020
- [4]Authorization, Model Context Protocol specification 2025-11-25 (opens in a new tab)Model Context Protocol, November 2025
- [5]RFC 8707: Resource Indicators for OAuth 2.0 (opens in a new tab)IETF, February 2020
- [6]SP 800-207, Zero Trust Architecture (opens in a new tab)NIST, August 2020
- [7]SP 800-63-4, Digital Identity Guidelines (opens in a new tab)NIST, July 2025
Technical guidance, not security certification or legal advice.
