Skip to main content
← Back to Insights

Agent Identity: Who Is Asking vs Which Software Is Acting

· 14 min read
Jitender Sharma
Advisor & Technical Leader · Enterprise AI & Platforms

Two badges at a gateway: user identity and agent identity both required for allow

Jane the banker asks an agent to send a statement. If the runtime calls the statements API as Jane, you have borrowed her login. If it calls as a shared svc-agents account, you have a fat service identity that every agent shares. Production needs a third option: Jane is who is asking; payments-agent-v2 is which software is acting. Both principals show up on every tool call.

This is a concept primer with worked real-time and batch sequences. It sits next to Policy-Governed Agent Runtime: the model proposes, the gateway enforces, and enforcement needs to know which robot proposed the call, not only which human started the session.

THE CLAIM

Give every agent its own identity. User identity answers "may this person?"; agent identity answers "may this robot?" The gateway enforces both on every tool and API call, including scheduled batch work. Stop using Jane's token as the caller, and stop sharing one service account across agents.

The bottom line first

  • User identity = who is asking (Jane the banker).
  • Agent identity = which software agent is acting (payments-agent-v2).
  • Both are required: least privilege, audit, revoke, and job control.
  • Same identity model for real-time and batch; only how you carry user authority changes.
  • Gateway allow needs agent scopes and user entitlements (or a stored approval bound to Jane).
  • Guides below: swimlanes for the three-tool story; tabs that split Jane, agent, wire, dual check, and audit.

User identity vs agent identity

PrincipalAnswersExample
User identityWho is asking?Jane: sub, roles, branch, emts
Agent identityWhich software is acting?payments-agent-v2: client_id, route-scoped scope

They are not interchangeable. Jane's session starts the work. The agent is the runtime principal that calls APIs. Mixing them collapses audit and privilege into one blob. Exact claim shapes appear in the step-by-step tabs (user login vs agent token).

Why agent identity exists

So the agent is not using a shared service account or Jane's login.

CapabilityWithout agent identityWith agent identity
Least privilegeOne fat svc-agents can call everythingEach agent gets only the scopes it needs
Audit"Some agent did this"Which agent (payments-agent-v2)
RevokeKill the shared account, break everythingRevoke one agent; others keep running
Job controlHard to bind long-running work to a robotSame agent identity across steps and schedules

Dual check (not redundant)


CheckQuestion
User checkIs Jane allowed to do this on this resource?
Agent checkIs this approved agent allowed to call this API?
UserAgentResult
Unauthorized bankerValid agentDeny
Valid bankerRevoked or unapproved agentDeny
Valid bankerValid agentAllow

User fine-grained control uses Jane's claims + action + resource attributes (branch match, account active, and so on). That does not replace the agent-scope check. Same separation as PGAR: proposal is not permission.

How the agent gets tools: register the agent in the IdP, allow only needed scopes, mint a token after the route loads (downscoped to that route), call APIs with the agent bearer plus user context, gateway enforces both. See MCP for Enterprise Business Agents.

Real-time vs batch

Identity is tied to the agent, not to how long the workflow runs.

ModeUser authorityAgent identity
Real-timeLive claims on every tool callRoute-scoped agent bearer every call
BatchStored approval at schedule time; re-check Jane now at runtimeSame agent identity; Jane may be offline

Step-by-step guides

Swimlanes tell the story (who acts, in what order). JSON under each is evidence (claims and one tool-call shape), not a full dump per hop. Each mode runs three tool calls; dual identity is checked on every call.

Route-scoped claims (user and agent)

Do not treat "load every possible claim up front" as the production default.

PrincipalTypical issuePrefer
UserJane's login JWT lists every right she might ever need (accounts:read, statements:send, payments:initiate, …) even when she only asked to read one accountKeep her entitlements at ingress. For this call, PDP checks only whether accounts:read is in her emts for ACC-4821. Not listed = deny
AgentOne fat agent token carries every API scope the client is registered forAfter the route loads, mint a token scoped to this route only (e.g. statement tools, not payments). Route change mid-session → new downscoped token

Order: route first, then agent token. The agent must not invent scopes outside IdP registration or the route allowlist.

Real-time: three tool calls

Jane: "Send my statement for ACC-4821." Same session, same agent badge. Tools 1-3 only change action.

#ToolAction
1get_accountaccounts:read
2get_statement_prefsstatements:read
3send_statementstatements:send

Walk the tabs left to right. Each shows one idea. Tools 1–3 reuse the same shape — only action changes.

Who is asking? Live user claims from Jane's session. Her emts say what she may do. Extra entries below (payments:*, customers:read) are real entitlements she holds as a banker; this statement turn never uses them. The gateway only checks the action on each tool call.

{
"roles": ["banker"],
"branch": "SYD-01",
"emts": [
"accounts:read",
"statements:read",
"statements:send",
"payments:lookup",
"payments:reserve",
"payments:initiate",
"customers:read"
]
}
Real-time rule

Every tool call re-runs the dual check. Same agent token and live Jane claims; different action / resource. Never substitute Jane's bearer for the agent.

Batch: three tool calls

Jane: "Schedule a $500 AUD payment to VND-ACME from ACC-4821 for tonight." She schedules while online. At runtime three tools share one agent badge and one approval — Jane may be offline.

#ToolAction
1validate_vendorpayments:lookup
2reserve_fundspayments:reserve
3initiate_paymentpayments:initiate

Walk the tabs left to right. Start with Jane (same as real-time), then the frozen approval because she may be offline at runtime.

Who is asking? Same principal as real-time. At schedule time her live emts are checked; at runtime they are checked again (Jane may have lost an entitlement).

{
"roles": ["banker"],
"branch": "SYD-01",
"emts": [
"payments:lookup",
"payments:reserve",
"payments:initiate"
]
}
Batch rule

Schedule once; re-check on every tool call at runtime (approval, Jane now, hash, agent). Same robot badge for all three tools.

Side-by-side

ConcernReal-time (3 tools)Batch (3 tools)
Agent identitySame bearer on tools 1-3Same bearer on tools 1-3
User authorityLive claims on every tool callApproval + live re-check on every tool call
Jane onlineRequired for the turnRequired to schedule; optional at run
Drift controlN/Apayload_hash checked each tool
AuditOne row per tool callOne row per tool call + approval_id / job_id

Mental model

Every agent action =
Agent identity (robot badge)
+ User authority (human entitlement / stored approval)
+ Gateway policy check (action + resource)
QuestionAnswered byClaims / fields
May this person?User identity / stored approvaluser.sub, roles, branch, emts (or approval_id)
May this robot?Agent identityagent.client_id, scope, agent status
May this action on this resource?Gateway policyaction + resource.* against both principals

Key takeaways

  • Treat agent identity as a first-class principal, separate from the human session.
  • Prefer per-agent IdP registration and route-scoped tokens over shared service accounts or user-token passthrough.
  • Enforce dual checks on every tool and API call: agent scopes and user entitlements (or stored approval).
  • Use the same agent identity for real-time and batch; change how you carry user authority, not the robot badge.
  • Audit Jane + agent + action (plus approval_id / job_id for batch) so revoke and forensics stay possible.