A renewals manager's teammate opens the CRM's history and finds her name on a merge of two customers. She did not look at that merge. Did she make it, did her AI assistant make it, or did a note someone typed into a customer record steer the assistant into making it? The CRM cannot say. To the CRM, all three are her. Shadow AI Signs In as You ended on the point this chapter takes up: identity comes first and is the least settled. Some of it is settled, and that part is worth building now.

Thesis: An agent that uses a person's session, token or key is that person to every system it touches: the logs name the wrong actor, nothing can limit the agent without limiting the person, and anyone who can steer the agent borrows the person's authority. The fix is delegation, not impersonation. The agent authenticates as itself, acts for a named person and records that with each action, and holds permissions narrower than the person's, set for the task, expiring on their own and revocable without touching the person's account. Keep the real keys off the agent, write the record where the agent cannot edit it, and give the one step that changes the original an identity of its own.

When Agents Need a Sandbox asked five questions. The fourth, who does it act as and for whom, is the one no chapter has answered yet.


One Login, Three Problems

When the assistant runs on her laptop, it reaches the CRM through her single sign-on session, the team folder through her synced account, and chat through her token. Every system sees one caller: her. Three things follow.

The trail names the wrong actor. There is a log, and it is precise. It records her account, at a time, doing a thing. What it cannot record is that she was not there. An investigation that starts from that log starts from a false fact.

Nothing can limit the agent without limiting her. The CRM checks her permissions, because her credential is what arrives. To stop the assistant deleting records, you remove her right to delete records. Every limit on the agent is a limit on the person, so in practice nobody sets one.

Anyone who can steer the agent borrows her authority. Prompt Injection Is a Design Problem called the model a confusable deputy, in the line that runs back to Norm Hardy's 1988 paper. Hardy's lesson was about where a deputy's authority comes from. His compiler wrote a billing file because a user named it as an output file, and the compiler had the right to write there for its own reasons. In his words, it "serves two masters and carries some authority from each." An agent on her session is worse off than Hardy's compiler. It serves her and every author of text it reads, and it carries only one authority, hers, for all of them. Nothing in the request says which master asked. Hardy's remedy was to make the caller hand over the authority for each job, so a deputy never acts on rights it holds for someone else. The modern form is a credential issued to the agent, for this person, for this task.

The Model Context Protocol's security guidance meets the same problem one layer down. It forbids "token passthrough", a server forwarding a token it was handed to the system behind it, and one reason it gives is the audit: the downstream system's logs "may show requests that appear to come from a different source with a different identity."


Impersonation and Delegation

RFC 8693, the OAuth 2.0 standard for exchanging one token for another, draws the line in two definitions. In impersonation, the actor "is given all the rights that B has within some defined rights context". In delegation, it "still has its own identity separate from B". The standard's impersonation can be narrow: it may be limited in scope or time. The everyday case is not that. An agent on her session is the extreme case of impersonation, with no exchange and no narrowing: the context is everything she can do.

Impersonation: the agent is you. Delegation: the agent acts for you, and says so. The OpenID Foundation's 2025 whitepaper on agent identity (South and colleagues) puts the direction in one line: "User impersonation by agents should be replaced by delegated authority."

Impersonation Delegation
What the agent presents Your session, token or key A credential of its own, issued for acting on your behalf
What the system's log names You The agent, and you as the person it acted for
Its permissions All of yours A subset, chosen for the task
How long they last As long as your session or key Until the task ends or the credential expires
How you stop it Revoke your own access Revoke the agent's credential; your account is untouched
Who can steer it into using that authority Anyone who writes text it reads, with all your rights The same people, but only with the narrow rights it holds

Delegation does not stop the agent being misled. It changes what a misled agent can reach, and it makes the record true.

In practice, "its own identity" comes down to five outcomes, and each is something you can check:

  1. It authenticates as itself. The system sees a credential issued to the agent, not one of hers.
  2. It acts for a named person, and that is recorded with each action. Not in a setup document. On the action.
  3. Its permissions are narrower than hers, and set for the task. The cleanup reads accounts in scope. It does not delete. As Permissions Decide What Runs Unasked set out, that scope lives on the agent's own account, in the system that owns the data.
  4. They expire. When the task ends, or soon after, the credential stops working whether anyone remembers it or not.
  5. They can be revoked without touching her account. Stopping the agent does not lock her out.

What the Standards Give

None of the following solves agent identity. Each gives one piece.

Token exchange and the actor claim. RFC 8693 lets a service trade a token that represents her for one that represents the agent acting for her. Its act claim "provides a means within a JWT to express that delegation has occurred", and its may_act claim says in advance which party may act for whom. One detail matters for audit: in a chain of actors, only the current one counts for access, and earlier actors are "informational only". The standard carries the relationship. It does not decide which tasks deserve which rights.

Workload identity. SPIFFE is a set of open standards for identifying running software, which proves who it is with "short lived cryptographic identity documents". It answers the first outcome, authenticating as itself without a long-lived secret. It says nothing about whom the workload acts for.

Carrying the person through a call chain. The IETF OAuth working group's Transaction Tokens draft carries user identity and workload identity through the services that handle one request inside a trust domain. It is a draft, and it is about services, not agents.

Agent-specific work. When I checked the OAuth working group's document list for this chapter, none of its drafts was written for agents. The nearest is Delegate SD-JWT, adopted as a working-group draft on 30 October 2026. It extends selective-disclosure tokens (SD-JWT) so that the holder of one can delegate it onward to another holder, and its abstract notes "particular applicability to Agentic systems": one example is an AI agent making purchases on a person's behalf. Proposals written for agents are still individual drafts. One of them, an on-behalf-of extension that names the agent as the actor at the moment the person consents, has expired.

Existing systems already offer pieces you can use today. AWS, for one, lets an administrator require a source identity on a role session: it is present on every action in the session, appears in the audit log and "cannot be changed during the role session". That is the second outcome, for one platform.


Keep the Keys Off the Agent

A credential the agent never holds cannot be printed, sent to a host it found in an issue, or used for a task nobody asked for. Three ways to get there, each with a limit.

A broker outside the sandbox. What an Agent Sandbox Bounds showed the mechanism: a proxy outside the sandbox adds the credential to the agent's request. The credential it adds is issued to the agent's identity, for a named person, so the system's log names the agent. Anthropic's managed agents use the same vault-and-proxy pattern: "Auth can be bundled with a resource or held in a vault outside the sandbox," and the tokens "are never reachable from the sandbox where Claude's generated code runs" (Decoupling the brain from the hands). It keeps the key secret; it does not make the request wise.

Short-lived tokens, issued per task. Where a credential must reach the agent, make it narrow and brief. A GitHub App's installation token, for one, "will expire after 1 hour" and cannot carry permissions the app was not granted. A token issued for the task expires on its own, and it can be revoked without touching her account. The limit: inside its lifetime and scope, a stolen or misused token works. Short and narrow shrinks the damage; it does not remove it. And someone has to set the scope well.

A gateway in front of the agent's traffic. It can hold the agent's credential for every remote call and record each one against the agent's identity. That is how a system with no "for whom" field still gets a true record, subject to the limit in What an Agent Sandbox Bounds: it governs only what crosses it, not what the agent does on its own machine.


Step 1 of 4

What crosses it

Put a gateway in front of the agent's traffic, and it can hold the agent's credential for every remote call and record each call against the agent's identity.

Read this figure as text
  1. What crosses it Put a gateway in front of the agent's traffic, and it can hold the agent's credential for every remote call and record each call against the agent's identity.
  2. What goes around it The gateway governs only what crosses it. Local shell commands, local files and tools on the same machine never cross it, so it does not govern them.
  3. Another way out While the agent has another way out, its calls can reach the outside world around the gateway, which governs only what crosses it.
  4. The network bound closes it The network bound closes the way around, so calls leave only through the gateway. Local shell commands, local files and tools on the same machine still never cross it.

Use a gateway only where the network bound makes it the only way out.

The Record

A delegated identity is only as useful as the record it leaves. A trail of an agent's work needs, for each action:

  • Who acted: the agent's identity, not a shared account.
  • For whom: the person, and the task.
  • What it called, with what input: the tool, the target, the arguments.
  • What came back: the result, or the error.
  • What was decided: allowed, denied or sent to a permission prompt, and who answered.

It has to live somewhere the agent cannot edit. The Hooks post's example, in Hooks Are a Channel, Not a Rule, is hooks that send every attempted write, allowed or denied, to a ledger the agent cannot edit. Keep that ledger off the agent's machine, where nothing it runs can reach. The systems the agent touches keep their own logs, and with a delegated identity those now name the agent too.

A harness transcript is a record, and a valuable one. But it is kept on the agent's own machine. Claude Code's documentation, for one, says it stores session transcripts locally in plaintext. Anything the agent can write, a steered agent can rewrite. Treat the transcript as a witness, and the ledger outside the agent's reach as the record.

The record serves three jobs: attribution, saying who did what for whom; review, checking the work before it lands; and undoing, knowing exactly which changes to reverse.


An Example: The Cleanup, With Names On It

Let the Agent Work on a Copy redid the renewals cleanup: the assistant works on a frozen copy of the renewals folder, writes a change list for the CRM instead of calling it, and a separate, narrow step applies what she approves. Now name the identities.

  • She is herself. Her account is untouched by anything below.
  • The assistant signs in as renewals-assistant, its own identity, with a credential issued for this task, on her behalf. It can read the copy and the accounts in scope. It cannot write to the shared folder or the CRM at all. The credential expires when the task ends.
  • The apply step runs as customer-apply, the only identity with write access to the folder and the CRM. It takes only a change list she has approved, and records her approval with each write.

Here is what the CRM's history says about one merge, before and after. The lines are illustrative.

Before, on her session:
  merge account A into B      by: the renewals manager

After, delegated:
  read accounts in scope      by: renewals-assistant   for: the renewals manager
  merge account A into B      by: renewals-assistant   for: the renewals manager   REFUSED: no write right
  merge account A into B      by: customer-apply       for: the renewals manager   approved by: the renewals manager

Many systems log only the caller and have no field for "for whom". Then the CRM's line names customer-apply, and the rest lives in two places the agent cannot edit: the apply step's ledger, which ties each write to her approval and to the change list, and the issuer's record of whom each credential was issued for.

Now replay the teammate's question. A merge she did not look at cannot carry her approval, so it was never applied. A note in a customer record that steered the assistant could, at most, put a wrong merge on the list she reads. And if anything went wrong, revoking renewals-assistant stops it without locking her out of the CRM she works in every day.


Step 1 of 6

Before, on her session

On her session, the CRM's history names her for the merge. Whether she made it, her assistant made it, or a note steered the assistant, the line reads the same.

Read this figure as text

The CRM's history for one merge, as the post's illustrative lines give it.

Before, on her session:

  • merge account A into B by: the renewals manager

After, delegated:

  • read accounts in scope by: renewals-assistant for: the renewals manager
  • merge account A into B by: renewals-assistant for: the renewals manager REFUSED: no write right
  • merge account A into B by: customer-apply for: the renewals manager approved by: the renewals manager
  1. Before, on her session On her session, the CRM's history names her for the merge. Whether she made it, her assistant made it, or a note steered the assistant, the line reads the same.
  2. Its own identity Delegated, the assistant signs in as renewals-assistant, its own identity. Its read of the accounts in scope names it, and her as the person it acts for.
  3. The assistant is refused When the assistant tries the merge itself, the CRM refuses: that identity cannot write to the CRM at all. The attempt stays in the history, under its own name.
  4. Applied with her approval Only customer-apply can write to the CRM. It applies the merge from the change list she approved, and records her approval with the write.
  5. Replay the teammate's question A merge she did not look at cannot carry her approval, so it was never applied. A note that steered the assistant could at most put a wrong merge on her list.
  6. Where the CRM has no field for whom Many systems log only the caller. Then the CRM's line names customer-apply, and the rest lives where the agent cannot edit it: the apply step's ledger and the issuer's record.

When the Opposite Wins

One person, their own machine, their own files. A developer alone on code they own, with nothing shared and nothing others depend on, gains little from a separate identity. Every log already names the only person involved, and version control is the record. Here it is ceremony.

The system offers no delegation. Many business systems know only accounts and keys: no token exchange, no actor field. The choice is then a scoped service account for the agent, or nothing. Take the service account, give it only the rights the task needs, and keep the "for whom" in your own ledger.

The strongest objection: this is a new pile of identities to run. It is. Someone has to issue, scope, rotate and review them, and to remove them when the task or the agent goes. Done badly, it is worse than the problem. An agent identity with broad standing permissions, shared across tasks and watched by nobody, is worse than her session, not better: it has her reach without her presence, and the log now names an actor nobody answers for. The point of delegation is the narrowness and the expiry. Without them, it is impersonation under another name.


What to Do Next

  1. List what each agent signs in as. If the answer is a person's session, token or key, that is impersonation.
  2. Give each agent its own identity, issued for a named person and a task, with an expiry.
  3. Set its permissions below the person's, in the system that owns the data, as Permissions Decide What Runs Unasked describes, and give write access to the original only to the apply step.
  4. Keep the keys off the agent: a broker that adds them outside the sandbox, short-lived tokens where that is not possible, and a gateway only where the network bound makes it the only way out.
  5. Write the record outside the agent's reach: who acted, for whom, what it called, what came back, and what was allowed, denied or asked.
  6. Practise revoking an agent without touching the person, before you need to.

Next: an apply step with its own identity still applies only what someone checked. Check the Work Before It Lands reviews what the agent proposes before it lands.


Related reading: Shadow AI Signs In as You on why identity comes first, When Agents Need a Sandbox for the five questions, What an Agent Sandbox Bounds for the git proxy and the limit of a gateway, Prompt Injection Is a Design Problem for the deputy that can be misled, Hooks Are a Channel, Not a Rule for a ledger the agent cannot edit, and Check the Work Before It Lands for a merge that needs an identity other than the agent's.