VIII · Safety & ControlEmerging

Ephemeral Agent Identity

also known as Just-in-Time Agent Identity, Self-Dissolving Agent Identity

Mint each agent run a short-lived identity of its own, scoped to one task and provisioned just-in-time, then revoke it on completion so no standing credential outlives the work.

Context

An orchestrator spawns agents and sub-agents at machine speed to do bounded work: a research sweep, a data pull, a single transaction. Each run needs to authenticate to tools, services, and other agents, so it needs an identity. The reflex is to reuse a long-lived service account or a shared API key, because creating, scoping, and retiring an identity per run is slow when humans drive identity governance. The agent's own self is treated as if it were either a person logging in or a static integration account, when it is neither.

Problem

An agent that authenticates as a static service account holds a credential that persists long after its task is done, is scoped far wider than the one run required, and is shared across every run that reuses it. A compromised session token then surfaces on the network as a fully legitimate identity with valid access, indistinguishable from a real agent, and there is no clean task boundary at which to revoke it. Treating the agent's own identity as either a human user or a permanent integration account leaves no identity class that is born with the run, bounded to it, and gone when it ends.

Forces

  • Per-run identity provisioning gives the tightest blast radius, but minting and retiring an identity for every short task adds latency and load to the identity provider.
  • A long-lived shared account is cheap to set up, yet it cannot be scoped to one task and cannot be cleanly revoked when one run is compromised.
  • An identity must outlive the request long enough to authenticate every step of the task, but must not outlive the task itself or it becomes an orphaned standing credential.
  • Attribution wants one identity per run so each action traces to a specific agent execution, but auditing wants stable lineage across the many ephemeral identities a single workload produces.

Example

A finance team runs a swarm of short-lived agents that each reconcile one vendor's invoices overnight. Instead of sharing one broad service account, the orchestrator asks the identity provider to mint each run a token scoped to that vendor's ledger entries, valid for ninety seconds, stamped with the nightly batch id. When a run finishes, its token is revoked. A token stolen mid-run buys an attacker read access to one vendor for under a minute, and the next morning the audit shows exactly which run touched which ledger.

Diagram

Solution

Therefore:

Treat the agent's own identity as a first-class non-human identity class, distinct from human users and from static service accounts, with a lifecycle tied to the task rather than to a deployment. When the orchestrator spawns a run, it requests a fresh identity from the identity provider: a short-lived credential or workload token scoped to exactly the resources this task needs, stamped with the spawning run's lineage so later audit can group it. The agent authenticates every step under that identity. When the task returns, the orchestrator revokes the identity or lets its short lifetime expire, so nothing remains to be reused, leaked, or escalated. Scoping, issuance, and revocation run at machine speed inside the spawn and teardown path, not through a human approval queue, so identity governance keeps pace with the rate at which agents are created.

What this pattern forbids. An agent run must not authenticate under a long-lived or shared identity; it may act only under an identity minted for that single task, scoped to that task's resources, and revoked or expired at task completion.

And the patterns that stand alongside it, or against it —

  • complementsDelegated Agent AuthorizationHave an agent act for a principal using scoped, short-lived, revocable delegated credentials rather than the principal's own static secrets, so each action stays attributable across the principal-to-agent-to-subagent chain and a compromise is contained.
  • complementsAgent Credential VaultBroker the agent's credentials at action time through a managed vault of passwords, MFA secrets, and digital personas, so secrets never enter the prompt or context and the agent authenticates as a governed identity.
  • conflicts-withAgent Identity SprawlAnti-pattern: an agent fleet mints non-human identities at machine speed while scoping, rotation, ownership, and revocation stay human-speed, so over-privileged long-lived credentials accumulate, outlive their agents, and widen an ungovernable attack surface.
  • conflicts-withStatic Role for a Dynamic AgentAnti-pattern: authorize a goal-driven agent with static, login-time, role-based privileges, so its standing permissions persist between and beyond tasks, forcing a choice between over-granting broad access and blocking the agent mid-task.
  • alternative-toIdentity ImpersonationAnti-pattern: let the agent act under the principal's own full identity and token, so every action it takes is recorded as the principal's and audit cannot separate user-initiated from agent-autonomous decisions.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.