Confused deputy (AI agents)
A program with broad permissions is tricked into using them for someone who should not have them; agents with shared service accounts are a common case.
A confused deputy is a program with broad permissions that is tricked into using them for someone who should not have them. The term comes from a 1988 paper by computer scientist Norm Hardy; AI agents running on shared service accounts are the common case today.
An internal assistant runs with a service account that can read every document. A junior employee asks it for the salary spreadsheet, and the agent fetches it, because the agent is allowed to, even though the employee is not. No hostile user is needed: a prompt injection hidden in a document can ask the agent to fetch something the reader may not see. The more systems one agent account connects, the bigger the gap between what the agent can reach and what each user may reach.
The fix is to act with the permissions of the person asking: pass their identity through (OAuth on their behalf) and check access per user, not per agent. Retrieval should filter by the user’s rights before the model sees anything, for example with row-level security. Give the agent its own narrow non-human identity and log which user each action was for. In multi-user systems, a confused deputy is one of the main routes to excessive agency.
Related terms
- Excessive agency: An AI agent with more tools, permissions or autonomy than its task needs, so a mistake or an injected instruction can do real damage.
- Non-human identity (agent identity): Accounts, keys and tokens used by software rather than people: service accounts, API keys, CI tokens and, more and more, AI agents.
- OAuth: A standard that lets an app act on a user’s account elsewhere (mail, calendar, files) without ever seeing the password.
- Row Level Security (RLS): Database rules that decide, row by row, which records each user may read or change. Missing RLS is a common leak in AI-built apps.
- Prompt injection: Instructions hidden in data (a web page, an email, a file) that the model follows as if they came from you.
