The Problem: Invisible Agents
Today, when an agent calls an MCP server or a downstream API, the system sees either the user or a service account — never the agent itself. This creates blind spots:Agent Spec with Identity
When you create or register an agent in Agent Hub, theidentity field defines how the agent establishes its identity in the delegation chain. The identity determines how a (user, agent) pair is established for authorization and audit.
Full Agent Spec
Identity Mode 1: Managed Credentials
In this mode, the organization registers the agent as an OAuth application in their IdP (Okta, Azure AD) and provides the agent’s client credentials to TrueFoundry. When a user interacts with the agent, TrueFoundry performs the OBO token exchange using these credentials — producing a token withsub=user and act=agent.
When to Use
- Agent Hub agents where TrueFoundry runs the agent
- You want TrueFoundry to handle the full OBO lifecycle (exchange, caching, refresh)
- The downstream MCP server needs a standard OBO token from your IdP
Spec
Identity Fields — Managed Credentials
How It Works
User authenticates via SSO
User interacts with the agent
TrueFoundry performs OBO exchange
subject_token. The IdP validates the user, verifies that this agent (client_id) is authorized to act on behalf of users, and issues an OBO token with:sub= the useract= the agentscp= intersection of user’s and agent’s permissions
OBO token is used for downstream calls
sub=user@example.com (whose data is being accessed) and act.sub=finance-assistant-client-id (which agent is acting).
IdP Setup
- Okta
- Azure AD (Entra ID)
Create a Service App for the agent
- In the Okta Admin Console, go to Applications > Applications
- Click Create App Integration and select API Services
- Name the app with the agent’s name (e.g.,
Finance Assistant Agent) - In General Settings, click Edit and enable Token Exchange under Grant Types
- Copy the Client ID and Client Secret
Create custom scopes
- Go to Security > API and select your authorization server
- Under Scopes, add the scopes the agent needs (e.g.,
api:access:read,api:access:write)
Create an access policy and rule
- Under Access Policies, create a policy assigned to the agent’s service app
- Add a rule permitting the
token_exchangegrant type with the required scopes
Configure the agent in TrueFoundry
identity configuration. Store credentials as TrueFoundry Secrets.Identity Mode 2: Federated Token
In this mode, the agent performs its own OBO token exchange externally — outside of TrueFoundry — and calls Agent Hub directly with the resulting OBO token. TrueFoundry validates the token, extracts the user identity (sub) and agent identity (act), and uses them for authorization and audit.
When to Use
- BYOA / A2A agents that run outside TrueFoundry
- The agent already integrates with the IdP and manages its own tokens
- You want the agent to control the OBO exchange lifecycle
- Multi-platform agents that call TrueFoundry as one of several backends
Spec
Identity Fields — Federated Token
How It Works
User authenticates via SSO
Agent performs its own OBO exchange
sub=user and act=agent.Agent calls Agent Hub with the OBO token
Authorization header. TrueFoundry validates the token:- Signature verification using the configured
jwks_uri issmatches the configuredissueraudmatches the configuredaudience(if set)actclaim is present — extracts the agent identity- Matches the agent identity to a registered agent in TrueFoundry
Authorization and forwarding
Agent Code (Federated Token)
Identity Mode 3: Virtual Account
In this mode, the agent is identified by a TrueFoundry Virtual Account — no external IdP registration required for the agent. The caller passes two tokens: the Virtual Account token (which identifies the agent and has access to it) and the user’s SSO token (which identifies the end user). TrueFoundry combines them to establish the (user, agent) pair.When to Use
- You don’t want to register agents in an external IdP
- The downstream MCP servers don’t require IdP-issued OBO tokens — they trust TrueFoundry’s authentication
- BYOA agents that call Agent Hub as an API backend
- Quick setup without IdP integration complexity
Spec
Identity Fields — Virtual Account
How It Works
User authenticates via SSO
User interacts with the agent
Agent calls Agent Hub with both tokens
Authorization: Bearer <virtual-account-token>— authenticates the agent to TrueFoundry and identifies which agent is callingX-TFY-User-Token: <user-sso-token>— provides the end user’s identity
Authorization and forwarding
Setup
Create a Virtual Account
- Navigate to Settings > Virtual Accounts in the TrueFoundry UI
- Click Create Virtual Account
- Name it after the agent (e.g.,
customer-support-va) - Add permissions for the MCP servers the agent needs to access
Register the agent with the Virtual Account
identity.virtual_account_id to the Virtual Account you created.Configure user token validation
Agent Code (Virtual Account)
customer-support-agent), validates the user token → user identity (user@example.com), and evaluates authorization using the (user, agent) pair.
sub and act claims, use Managed Credentials or Federated Token instead.Comparing Identity Modes
Agent Authorization: Collaborators + Policies
TrueFoundry extends the existing collaborator model to support agents as first-class principals. Just as you add users and teams as collaborators on an MCP server, you can add agents — with optional tool-level restrictions. This works identically across all three identity modes.Agents as Collaborators
In the MCP server’s collaborator list, agents appear alongside users:finance-assistantcan callprocess_refund,get_transaction, andlist_invoicesaudit-botcan only calllist_invoicesandget_transaction(read-only audit)- Neither agent can call tools not in their list, even if the underlying user has broader access
Advanced Policies with Cedar
For organizations that need more sophisticated authorization — conditions based on user department, time-of-day, delegation chains, or environment — TrueFoundry supports Cedar policies as an extension layer on top of the collaborator model. Cedar policies are optional. The collaborator model handles most use cases. Cedar adds power when you need conditional logic.When to use collaborator permissions vs Cedar policies
When to use collaborator permissions vs Cedar policies
Example: Block all agents from PII tools
Example: Block all agents from PII tools
Example: Allow agents only for specific user departments
Example: Allow agents only for specific user departments
Example: Time-bounded agent access
Example: Time-bounded agent access
Example: Delegation chain constraints
Example: Delegation chain constraints
data-agent to access analytics only when it was invoked by research-agent as a sub-agent, not when acting independently.Authorization Evaluation Flow
When an agent makes a request, authorization is evaluated in layers — regardless of which identity mode is used:Resolve identity
RBAC — User access
sub or the user token) have collaborator access to this MCP server?RBAC — Agent access
act or the VA mapping) listed as a collaborator on this MCP server?RBAC — Tool restriction
Cedar policies (optional)
forbid always takes precedence over permit.Forward to MCP server
Multi-Agent Delegation Chains
When agents orchestrate sub-agents, the OBO token carries the full delegation path via nestedact claims. TrueFoundry tracks and enforces policies at every hop.
Example: Parent Agent → Sub-Agent → MCP Server
The OBO token carries the full chain:data-agent), and the originating agent (research-agent). Cedar policies can reason about the full chain — for example, allowing data-agent to access analytics only when delegated by research-agent.
Audit and Observability
Every agent action is logged with full identity attribution:- Trace every action back to both the user and the agent
- See which identity mode was used (
managed_credentials,federated_token, orvirtual_account) - Identify which authorization layer (RBAC or Cedar) authorized or denied the action
- Detect anomalous agent behavior patterns
- Generate compliance reports showing agent-specific access patterns
FAQ
Which identity mode should I choose?
Which identity mode should I choose?
Do I need to register the agent in my external IdP?
Do I need to register the agent in my external IdP?
Can I use multiple identity modes in the same organization?
Can I use multiple identity modes in the same organization?
What if an agent doesn't need identity?
What if an agent doesn't need identity?
identity field is optional. Agents without identity work exactly as they do today — using the user’s token or a shared service account for downstream calls. Identity is only needed when you require agent attribution, per-agent authorization, or OBO delegation.How does TrueFoundry match a federated token to a registered agent?
How does TrueFoundry match a federated token to a registered agent?
agent_claim (default: act.sub). It matches this value against the registered agents in TrueFoundry’s registry. If no matching agent is found, the request is rejected with a 403.Can agents act without a user context?
Can agents act without a user context?
What happens if the Virtual Account doesn't have access to the MCP server?
What happens if the Virtual Account doesn't have access to the MCP server?
403. The Virtual Account must be added as a collaborator on the MCP server (or the agent that maps to it must be). Both the user and the agent must have access for the request to succeed.