- Client credentials flow: the agent is the subject. Its identity appears in the top-level
subclaim. - Standard login flow: the user is the subject. The agent’s identity appears in a single-level
actclaim. - On-Behalf-Of (OBO) token exchange: the user remains the subject. The agent’s identity appears in the
actclaim alongside a nestedactshowing the originating client.
Auth0 does not support the
jwt_bearer grant for agent-linked clients.sub_profile and client_profile claims to explicitly identify the type of entity in each position of the token.
Agent subject claims
Thesub_profile and client_profile claims specify the entity type in tokens issued by agent-linked clients:
You must configure your resource server to receive
sub_profile and client_profile claims in issued tokens. Wherever an agent’s ID appears in a claim (top-level sub or act.sub), it is the agent’s external_agent_id if one was set at creation; otherwise, it is the agent_id.
Configure resource server to receive agent subject claims
To receivesub_profile and client_profile claims, set agent_subject_claims: 'auth0-v1' on the target resource server. This is opt-in per resource server.
The
sub_profile claim introduces a formal entity type into the token. Services that receive tokens should not assume sub_profile will always be user. If sub_profile is absent (resource server opt-in is not enabled), existing behavior remains unchanged.Review sub parsing in downstream services before enabling. Services that validate or parse the sub claim format may need updates to handle ai_agent as a valid entity type for client credentials grants.Standard login flow
An agent-linked client can perform a standard login flow using authorization code, implicit, CIBA, device, MFA, password, passkey, or refresh token grant. The subject remains the user. The agent identity does not appear in the top-levelsub claim. Instead, a single-level act claim is added so the agent is identifiable in the token.
In the following example, an agent-linked client performs a standard login flow and issues a token with the following agent subject claims:
sub: the user IDsub_profile:userclient_profile:ai_agent, identifying the client as agent-linkedact: a single-level actor claim identifying the agent ("sub": "agt_1a2b3c", "sub_profile": "ai_agent")
Client credentials flow
An agent-linked machine-to-machine (M2M) client performs a client credentials flow. The agent is the subject and authenticates as itself; there is no user involved. In the following example, an agent-linked M2M client performs a client credentials flow and issues a token with the following agent subject claims:sub: the agent’sexternal_agent_idif one was set at creation, otherwise theagent_idsub_profile:ai_agentclient_profile:service ai_agent, representing the agent-linked M2M client
On-Behalf-Of (OBO) token exchange
In the OBO token exchange, a user authenticates and receives an access token with the agent’s resource server as the audience. The agent-linked client then exchanges this token for a delegated token using the On-Behalf-Of Token Exchange. The user remains the subject throughout. The agent is identified as the actor in theact claim.
Before the token exchange, the user authenticates via a browser app and receives an access token:
sub: the user IDsub_profile:userclient_profile: identifies the originating client as abrowser_appaud: the agent resource server
sub: the user ID (unchanged)sub_profile:user(unchanged)client_profile:service ai_agent, representing the agent-linked clientaud: the new resource serveract: the immediate actor is the agent, with a nestedactshowing the original client that initiated the flow. The maximum delegation depth is 5 hops or 4 nestedactlevels.
Refresh tokens are not supported for the OBO token exchange. To learn more about setup and limitations, read On-Behalf-Of Token Exchange.
Next steps
- Add agent context to access tokens using Actions
- Query the agent ID in tenant logs for agent identity attribution and traceability