Skip to content

20. Identity Management: In Whose Name Does the Agent Act? ​

The problem. Every action of the agent leaves a trace, and every trace must answer a simple question: who did this action, a human, or which agent, on behalf of which human? Without an answer to this question, observability is useless and accountability cannot be exercised.

The concept. We distinguish two identities. The agent has its own identity: typically a dedicated service account, distinct from any human account, which lets it authenticate to systems (messaging, information-system APIs). But when the agent acts for someone, it must be able to prove it: this is the role of authorization delegation mechanisms (for example the "on-behalf-of" flow of OAuth 2.0, RFC 8693, and its extension for agents): the final call carries the identity of the user and that of the acting agent, with reduced rights (the scopes), the agent can never obtain more rights than the human who delegated to it, and each call to a system carries a token limited to that system and to a short duration. A stolen token is therefore only worth one system and a short time. This is the answer to the "confused deputy" problem: without this mechanism, an agent that forwarded a user's token to another system would make that system act in the user's name, without anyone knowing.

IdentityExampleUsed when
Humanthe manager's named accountthe human acts directly
Agent (service account)an agent-restocking account with read/write access to stockthe agent acts autonomously within its scope (A3)
Agent on behalf of a human"on-behalf-of" token: user Marie + actor agent-planningthe agent acts in the name of a specific human (A1/A2), with that human's rights, reduced

The resulting design rules:

  • never a shared account: the agent does not use a human's account, and a human does not share their credentials with the agent;
  • secrets in a secrets manager, never in code or in the prompt, with regular rotation;
  • least privilege by default: a service account only accesses the systems strictly necessary (example: the shift-scheduling agent has access to the calendar and staffing data, not to patient records);
  • explicit traces: every logged action carries the agent ID, the ID of the human on whose behalf it acts (when there is one), the time, and the result. You must be able to distinguish, in the log, an action done by a human from one done by an agent. Example: 14:02 (agent-planning on behalf of Marie D.), week 47 schedule modified and sent for validation;
  • revocation: an agent's rights can be revoked at any moment (kill switch, scope removal), its secrets rotated, and when a human leaves the organization or changes role, all delegations associated with them are revoked, otherwise an old schedule, for example, would remain modifiable "on behalf of" someone who is no longer there.

The legal framework. The European AI Act (Regulation (EU) 2024/1689) makes these requirements mandatory for high-risk systems: automatic logging of events (Article 12), human oversight designed into the system, anomaly detection, possibility to override, interrupt, stop (Article 14), and, for the deploying organization (Article 26), assignment of competent human supervision, retention of logs for at least six months, monitoring of operation, informing the persons concerned when they interact with the system, and reporting of serious incidents. The ISO/IEC 42001 standard formalizes the same approach on the management-system side. In practice: a hybrid team deployed in a hospital or in human resources falls under these obligations.