AI Agent Authorization
Deciding what an LLM agent may do on whose behalf. Agents add a new principal (the agent) between the user and the tools, and every place where the agent’s authority exceeds the requesting user’s is a confused-deputy privilege escalation that needs no prompt injection: just ask.
How it works
Classic authz checks (user, action, resource). Agentic systems insert a hop: the user asks the agent, and the agent calls tools with its own credentials (project credentials, a service token, a human’s API key it was handed). The failure modes:
- Scope mismatch: the permission to talk to the agent is checked, but not the permission for each tool call the agent makes. Viewer + agent = executor.
- Credential laundering: restrictions bound to the normal execution path (allowed domains, per-node permissions) don’t apply when the same credential is used via a different agent feature (MCP client, tool node).
- Standing, shared identity: static tokens or keys carry permissions regardless of which human triggered the action, so audit and least privilege collapse (GitGuardian: “the agent inherits the authority of whoever supplied the credential”).
- Approval binding: human-in-the-loop is a control only if what was approved is what runs.
- Point-in-time policy: each tool call is individually allowed, but the sequence (read secret, then outbound request) is the attack.
Techniques / payloads
- Ask the agent to do what your role can’t. In n8n (CVE-2026-65015, fixed 2.29.8/2.30.1),
PROJECT_VIEWER_SCOPESincludedagent:executebut notworkflow:execute. A Viewer chatted with the project agent, which invokedrun_node_tool, so the HTTP Request node sentPROD-SECRETto an attacker URL, or, where enabled (off by default since n8n 2.0), Execute Command gave a reverse shell.@Post('/:agentId/chat') @ProjectScope('agent:execute') // only gate export const PROJECT_VIEWER_SCOPES = ['agent:read','agent:list','agent:execute', /*…*/]; - Re-home a use-only credential. n8n CVE-2026-59207: a credential with Allowed HTTP Request Domains = None could still be attached as header auth to an MCP server pointing at Burp Collaborator. The connection “failed”, but the plaintext key had already been sent in
X-Api-Key. - Read-only role vs approval APIs. Pulse
/api/ai/approvals(CVE-2026-129428): viewers could list pending agent commands and approve or deny other users’ requests. - Approval substitution (Loopjacking): render operation A in the approval UI and execute B, either through representation attacks (B omitted or misrepresented) or post-approval state substitution. Reproduced in Agno AgentOS ≤ 3.0.9 and LangGraph Agent Server ≤ 0.14.0. GhostApproval is the file-system variant: a symlink in a malicious repo makes the prompt show a workspace path while the write lands outside it (CWE-61 + CWE-451). It affected Amazon Q Developer, Claude Code, Augment, Cursor, Antigravity and Windsurf; AWS, Cursor and Google fixed it.
- Gateway auth gaps: LiteLLM MCP endpoint (CVE-2026-59822, in CISA KEV) created a valid session from any Bearer token. With no auth configured every user got
PROXY_ADMIN, and 9.6% of 3,074 public instances took the defaultsk-1234or no auth. Microsoft MCP Gateway had an authorization bypass through a user-controlled key. - Identity by assertion: ServiceNow Virtual Agent (AppOmni). A static token was identical across all customers, and an email address was accepted as proof of identity, so knowing a target’s email gave platform takeover.
- Classic IDOR in AI features: a private skill ID leaked via a shared chat, then an overlooked endpoint used it ($1,000).
Defenses
- Authorize every tool call against the end user, not just the chat entry point: the agent’s effective permission = intersection of the agent’s and the requesting user’s rights. Map scopes so read-only roles can’t reach executing tools.
- Propagate user identity: MCP servers should validate issuer,
aud(token intended for this MCP resource), expiry andscopeper request and return403 insufficient_scope. For downstream APIs, use OAuth On-Behalf-Of (e.g. Entra OBO) so the backend’s RBAC and audit still see “Alice”, rather than a shared service token. - Bind credential restrictions to the credential, enforced in the shared HTTP layer for every feature that can use it (nodes, MCP, pass-through).
- Short-lived, intent-scoped, just-in-time credentials; SPIFFE-attested workload identity and per-workflow OIDC tokens instead of static keys (Identiverse 2026).
- Sequence-aware policy: AWS Dogwood (Cedar + temporal conditions) evaluates tool calls against prior actions, e.g. require human approval within the last hour, cap call counts, track running totals. It generates action schemas from MCP tool definitions.
- Approval integrity: canonical rendering of the exact operation, and an exact use-time comparison between approved and executed (Loopjacking mitigations). Resolve symlinks before prompting.
- RAG: filter retrieval by the user’s permissions before the model sees content (SpiceDB
LookupResourcespre-filtering the vector query). - Agent-written code drops ownership checks (Snyk), so push tenancy into the DB (Multi-Tenant Isolation) and test it (Authorization Testing Automation).
Related
- Authorization Security
- Authorization Policy Engines
- Privilege Escalation
- Function Level Authorization
- MCP Security
- Agentic AI Risks
- Prompt Injection
- AI Coding Assistant Risks
- OAuth 2.0 Vulnerabilities
Sources
- Ask the Agent Nicely: Two Authorization Bypasses in n8n AI Agents · original
- AI Agent Authorization Beyond Authentication: A Look At AWS Dogwood · original
- Identiverse 2026: The Challenges Of Solving Identity For AI Agents At Scale · original
- Loopjacking: Hijacking Human-in-the-Loop Approval · original
- GhostApproval: A Trust Boundary Gap in AI Coding Assistants · original
- ServiceNow's Virtual Agent Vulnerability Shows Why AI Security Needs Traditional AppSec Foundations · original
- Understanding MCP v2 Authorization with Azure Entra OBO · original
- MCP Authorization — Part 1: Overview, Server Design, and Implementation · original
- Pulse missing authorization in /api/ai · original
- Microsoft MCP Gateway authorization bypass through user-controlled key · original
- Off Guard: Breaking LiteLLM from authentication bypass to cloud compromise · original
- Fine Grained Authorization using SpiceDB for RAG · original
- The $1000 IDOR Hiding Behind a Shared AI Chat · original
- Why AI Coding Agents Keep Writing Broken Access Control · original