§ GOVERNANCE
IAM Binding — Workload Identity Federation
Your agents already have an identity in Microsoft Entra ID. Execlave federates it: the workload exchanges its Entra-issued token for a short-lived Execlave API credential and calls Execlave with it, without an organization API key.
Why federate
Agents are non-human identities, and identity governance teams want them managed where every other identity lives — the corporate IdP. With federation, the agent proves who it is with the credential Azure already rotates and attests (managed identity or app registration), and receives a short-lived exe_agt_ API credential. Revoke the service principal in Entra and the agent can no longer obtain one: once its current credential expires, it can no longer call Execlave.
The API credential authenticates only the agent's own calls (enforcement decisions, traces, heartbeats, approvals), and only for that agent. Admins can turn this off per organization in Settings → Security; agents then need an API key.
Setup
One provider per trusted tenant, one binding per agent. Both ADMIN-only.
# 1 · Trust your Entra tenant (ADMIN)POST /api/v1/identity-providers{ "tenantId": "<tenant GUID>", "audience": "<client ID (GUID) of the API app registration>" } # 2 · Bind the agent to its workload identity (ADMIN)PUT /api/v1/agents/{agentId}/identity-binding{ "providerId": "<provider id from step 1>", "subject": "<service principal object id (oid)>" }| Field | What it is |
|---|---|
tenantId | Your Entra tenant GUID. Tokens must be issued by this exact tenant — multi-tenant issuers (common/organizations) are rejected. |
audience | The client ID (GUID) of the API app registration the workload requests its token for. Entra always puts this GUID in the aud claim of a v2.0 token, even when the token is requested by app ID URI. Must match exactly. |
subject | The workload's service principal object id (oid claim) — immutable in Entra. One agent per (provider, subject). |
Execlave accepts only v2.0 access tokens. Entra issues v1.0 tokens by default, so set requestedAccessTokenVersion to 2 in the manifest of the API app registration (the legacy manifest calls it accessTokenAcceptedVersion). Without it, every exchange is rejected.
The exchange
The workload presents its Entra token; Execlave returns a short-lived API credential.
# The Azure workload (managed identity or app registration) requests a token# for the API app registration, here by its app ID URI. No Execlave secret is involved.# The token's aud claim is the API app's client ID (GUID), not the URI.az account get-access-token --resource api://<API app client ID> --query accessTokenPOST /api/v1/agent-credentials/exchangeContent-Type: application/json { "token": "<Entra-issued access token>" } # 201 response{ "data": { "credential": "exe_agt_...", # short-lived agent API credential "expiresAt": "2026-06-11T10:15:00.000Z", "agentId": "c0a8012e-..." }}# Call Execlave with the API credential: no API keyPOST /api/v1/policies/enforceAuthorization: Bearer exe_agt_... # Identity credential for other agents and services (own agent only)POST /api/v1/agents/{agentId}/credentialAuthorization: Bearer exe_agt_...The returned credential is an API credential: send it to Execlave as Authorization: Bearer, never to other agents or services. It is short-lived, revocable by jti, and accepted only on the agent's own data-plane routes; every other route answers 403. To prove its identity to other agents or services (agent-to-agent delegation, offline verification against the JWKS), the agent requests a separate identity credential with POST /api/v1/agents/:id/credential. The two kinds carry different audiences, so neither is accepted in place of the other. Every successful exchange writes an audit entry with the provider, subject, and credential id.
With the SDKs
@execlave/sdk and execlave-sdk 1.10.0 and later do the exchange for you.
import { DefaultAzureCredential } from '@azure/identity';import { Execlave } from '@execlave/sdk'; const azure = new DefaultAzureCredential();const exe = new Execlave({ // No API key: the SDK exchanges this token and keeps the credential fresh. credentialProvider: async () => (await azure.getToken('api://<API app client ID>/.default')).token,}); // Names the bound agent in this client; creates nothing.await exe.registerAgent({ agentId: 'support-bot', name: 'Support bot' });await exe.enforcePolicy({ agentId: 'support-bot', input: userMessage });from azure.identity import DefaultAzureCredentialfrom execlave import Execlave azure = DefaultAzureCredential()exe = Execlave( # No API key: the SDK exchanges this token and keeps the credential fresh. credential_provider=lambda: azure.get_token("api://<API app client ID>/.default").token,) # Names the bound agent in this client; creates nothing.exe.register_agent(agent_id="support-bot", name="Support bot")exe.enforce_policy("support-bot", user_message)Pass a function that returns a fresh Entra token instead of an API key. The SDK exchanges it, caches the API credential, exchanges again a minute before it expires, and sends it with every call. One client acts for exactly one agent, the one bound to the token's subject. Enforcement, traces, heartbeats, the kill switch (status polling and the real-time channel), approvals, agent-to-agent authorization and bypass reports work with the credential; other SDK calls, such as agent discovery or usage, need an API key. If the exchange refuses the token, enforcement raises an authentication error and never fails open; if the exchange or Entra cannot be reached, your enforcementOnOutage (Python: enforcement_on_outage) setting decides.
Security model
- Tokens are verified against the tenant's JWKS (RS256) with exact issuer and audience — the unverified token is used only to route to the right tenant configuration, never for identity.
- The exchange endpoint is unauthenticated by design (the Entra token is the credential) but strictly rate-limited and brute-force guarded; failed exchanges count toward IP lockout like failed API-key auth.
- Every failure returns the same error — the endpoint cannot be used to enumerate tenants, audiences, or agent bindings.
- Fail closed: any verification error, disabled provider, or missing binding rejects the exchange.
- An identity credential shown to another service cannot be replayed against the API: API authentication accepts only the API credential's audience.
Disable a provider (PATCH /api/v1/identity-providers/:id with { "isEnabled": false }) to cut all federated issuance for that tenant immediately; already-issued credentials expire on their own short TTL or can be revoked per-credential.
Relationship to Microsoft Entra Agent ID
Entra answers “who is this agent?”; Execlave answers “what may it do right now, and what did it do?”. Federation connects the two: Entra remains the identity authority, Execlave enforces runtime policy and produces the tamper-evident record. See the Entra Agent ID comparison for the full picture.