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:| Scenario | What the downstream system sees | What’s missing |
|---|---|---|
| Agent uses user’s token directly | The user | Which agent acted? Was it authorized to? |
| Agent uses a shared service account | A service identity | Which user’s data is being accessed? |
| Agent impersonates the user | The user (indistinguishable from direct access) | The agent’s role in the decision chain |
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
| Mode | How agent identity is established | Who performs OBO exchange |
|---|---|---|
| Managed Credentials | Agent is registered in external IdP; TrueFoundry stores the credentials | TrueFoundry |
| Federated Token | Agent performs its own OBO exchange externally | The agent |
| Virtual Account | Agent is identified by a TrueFoundry Virtual Account; user token passed separately | No external exchange needed |
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
| Field | Required | Description |
|---|---|---|
identity.type | Yes | Set to managed_credentials |
identity.idp_type | Yes | Identity provider type: okta or azure_ad |
identity.client_id | Yes | The agent’s OAuth client ID, registered in your IdP |
identity.client_secret | Yes | The agent’s OAuth client secret (use TrueFoundry Secrets) |
identity.token_endpoint | Yes | The IdP’s token endpoint URL for token exchange |
identity.allowed_scopes | No | Maximum scopes this agent can request. If omitted, the IdP’s policy determines the scopes. |
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
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
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
| Field | Required | Description |
|---|---|---|
identity.type | Yes | Set to federated_token |
identity.idp_type | Yes | Identity provider type: okta or azure_ad |
identity.jwks_uri | Yes | The IdP’s JWKS endpoint for token signature validation |
identity.issuer | Yes | Expected iss claim in the OBO token |
identity.audience | No | Expected aud claim. If set, tokens with a different audience are rejected. |
identity.agent_claim | No | JSON path to the agent identifier in the token. Defaults to act.sub. |
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
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
| Field | Required | Description |
|---|---|---|
identity.type | Yes | Set to virtual_account |
identity.virtual_account_id | Yes | The name/ID of the Virtual Account in TrueFoundry that represents this agent |
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
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
| Managed Credentials | Federated Token | Virtual Account | |
|---|---|---|---|
| Who performs OBO exchange | TrueFoundry | The agent | No exchange needed |
| Agent registered in external IdP | Yes | Yes | No |
| Agent credentials stored in | TrueFoundry Secrets | Agent’s infrastructure | TrueFoundry (VA token) |
| IdP round-trip for agent identity | Yes (at TrueFoundry) | Yes (at agent) | No |
| Downstream token format | RFC 8693 OBO token | RFC 8693 OBO token | TrueFoundry-managed |
| Best for | Agent Hub agents needing IdP OBO tokens | BYOA agents managing own tokens | Quick setup, no IdP complexity |
| Agent developer effort | Zero (provide credentials) | Implement token exchange | Minimal (pass two tokens) |
| What TrueFoundry receives | User’s SSO token | Pre-exchanged OBO token | VA token + user token |
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:| Field | Description |
|---|---|
subject | agent:<agent-name> — the agent’s identity from TrueFoundry’s registry |
role_id | The access level (same roles as user collaborators) |
tools | Optional tool-level restriction — if specified, the agent can only invoke these tools |
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
| Requirement | Use Collaborators | Use Cedar |
|---|---|---|
| Agent X can access MCP server Y | ✓ | |
| Agent X can only use tools A, B, C | ✓ | |
| Agent X can access MCP server Y only for users in Finance | ✓ | |
| No agent can access PII tools, ever | ✓ | |
| Agent X can only operate during business hours | ✓ | |
| Agent X can access MCP server Y only when delegated by Agent Z | ✓ |
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.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?
| Situation | Recommended Mode |
|---|---|
| Agent Hub agent, MCP server needs standard OBO token | Managed Credentials |
| External agent that already manages its own IdP tokens | Federated Token |
| Quick setup, MCP servers trust TrueFoundry auth | Virtual Account |
| No IdP integration, just need user+agent attribution | Virtual Account |
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.