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_SCOPES included agent:execute but not workflow:execute. A Viewer chatted with the project agent, which invoked run_node_tool, so the HTTP Request node sent PROD-SECRET to 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 default sk-1234 or 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 and scope per request and return 403 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 LookupResources pre-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).

Sources