Skip to content
Workforce IdentityMarkdown

Workload identity

Agents, and services that ask for transaction tokens, prove who they are with their platform's own SPIFFE identity, so no key or secret is registered for them or handed to them.

Available, with limitsAPIRFC 7523, OAuth SPIFFE Client Authentication (draft)

Workload identity lets an agent sign in to your realm with the identity its platform already gives it. Where each workload has a SPIFFE identity, for example under SPIRE, the workload sends that identity’s signed token, its JWT-SVID, in place of a key. You trust the platform once, and register no key and hand out no secret per workload.

Who may use it today: agents’ clients, and the clients of services that ask for transaction tokens. Any other app or service’s client can’t authenticate with an SVID yet: give it a key instead (Client authentication).

A SPIFFE ID names one workload, such as spiffe://prod.example.com/ns/agents/sa/invoice-agent. Its first part, prod.example.com, is the trust domain: the platform that vouches for it.

  • Who can do it: a realm administrator (a group holding RealmOwner); RealmViewer can read the settings but not change them.
  • Where: today this is set through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: the agent is registered (AI agents), or the service’s client has issuesTxnTokens; and your platform issues JWT-SVIDs with a jti (under SPIRE, -jwtSVIDIncludeJTI on the workload entry).

The agent fetches an SVID from its platform, addressed to the realm’s issuer, and sends it as its client assertion with its client_id:

Terminal window
curl https://foobar.cvyuh.com/oauth2/token \
-H "DPoP: <proof>" \
-d grant_type=client_credentials \
-d scope=invoices:read \
-d client_id=invoice-agent-client \
-d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-spiffe \
-d client_assertion=eyJhbGciOiJFUzI1NiIsImtpZCI6InByb2QtMSJ9.eyJzdWIiOi….…

The SVID’s claims:

{
"sub": "spiffe://prod.example.com/ns/agents/sa/invoice-agent",
"aud": ["https://foobar.cvyuh.com/oauth2"],
"iat": <unix time>,
"exp": <unix time, at most 300 seconds later>,
"jti": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed"
}

An agent’s client is held to fapi2 by default, so the request also carries a DPoP proof.

Name the trust domains the realm trusts in its spiffeTrustDomains (on oauth2Settings), then give the agent’s client assertionTrust: spiffe and the one spiffeId it answers for. Each call sends your session as $CVYUH_SESSION (Call the API):

Terminal window
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
-H "Content-Type: application/json" \
-d '{ "spiffeTrustDomains": {
"prod.example.com": { "bundleEndpoint": "https://spiffe.prod.example.com/bundle" } } }'
curl -X POST "https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client?id=invoice-agent-client" \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
-H "Content-Type: application/json" \
-d '{ "status": "active",
"tokenEndpointAuthMethod": "private_key_jwt", "assertionTrust": "spiffe",
"spiffeId": "spiffe://prod.example.com/ns/agents/sa/invoice-agent",
"grantTypes": ["client_credentials"], "scopes": ["invoices:read"],
"allowedResources": ["https://app.example.com/api"],
"defaultAudience": "https://app.example.com/api" }'

Then link the client to its agent, as in AI agents.

Setting or limitDefaultRange
SPIFFE IDs per clientOneOne
An SVID’s life (clientAssertionMaxLifetimeSecs, plus clockSkewSecs)300 seconds, plus 60As the realm’s client assertions
Signing algorithms (tokenEndpointAuthSigningAlgs)ES256, RS256; ES256 alone for an agent’s fapi2 clientThe realm’s list
Uses of one SVIDOnce, by its jtiOnce
Trust domains (spiffeTrustDomains)NoneAs many as you name
SymptomCauseFix
Every SVID is refused invalid_clientThe client is neither an agent’s nor one with issuesTxnTokensLink the client to its agent, or give a plain service a key
The first SVID works and later ones are refusedYour platform reissues the same SVID, or SVIDs carry no jtiHave each fetch return a fresh SVID with a unique jti
An SVID is refused after a key change at your platformThe realm still holds the trust domain’s old keys inlineUse a bundleEndpoint, or update jwks
An SVID signed RS256 is refused for an agentThe agent’s client is fapi2, which takes ES256 or PS256Sign with ES256

Each token request is a TOKEN_ISSUED record, issued or refused, keyed by the agent the token is about or, for a refusal, by the client that asked. Changes to spiffeTrustDomains and to the client are in the change history: Audit → Config in the dashboard.

  • One workload per client. The agent’s client names one SPIFFE ID, and only an SVID for exactly that ID authenticates it.
  • Only trust domains the realm names. Each one’s keys come inline, or from its bundle endpoint, which must be https and is fetched over the public internet. An SVID from any other trust domain, or signed by a key outside the bundle, is refused invalid_client.
  • Only the algorithms the realm accepts. The SVID is signed with an algorithm in the realm’s tokenEndpointAuthSigningAlgs. An agent’s client is fapi2 by default, which narrows that list to ES256 and PS256, so by default an SVID must be signed ES256.
  • Each SVID is used once. An SVID must carry a jti, and the same one is refused the second time, as every client assertion is. One without a jti is refused. Under SPIRE, register the agent’s workload entry with -jwtSVIDIncludeJTI: each SVID then carries a unique jti, and every fetch returns a fresh one.
  • It must be addressed to the realm alone: its aud is the issuer, or a list holding only the issuer. Its exp must lie no further ahead than the realm allows a client assertion: clientAssertionMaxLifetimeSecs, 300 seconds by default, plus the realm’s clock skew (clockSkewSecs, 60). An iat or nbf, if present, must not be in the future.
  • Only as jwt-spiffe. The same SVID sent as an ordinary jwt-bearer assertion is refused invalid_client.
  • From there it’s any agent’s client: the agent must be active, and its tokens follow its security profile, DPoP included.
  • A workload that asks for transaction tokens may use it too, with no agent: an app with issuesTxnTokens. Its transaction tokens name it by its SPIFFE ID (req_wl). See Transaction tokens.
  • It registers no key. A client under spiffe trust has no jwks or jwksUri: its SVID is its one credential, and a client written with a key beside it is refused.
  • Dynamic registration doesn’t offer it: a registered client is never an agent’s.

A workload signs in with its Kubernetes service-account token, checked by its cluster, in place of an SVID.

WhereSettingWhat it does
RealmspiffeTrustDomainsThe trust domains whose SVIDs are trusted, each by its keys (jwks) or its https bundleEndpoint, one or the other
RealmtokenEndpointAuthSigningAlgsThe algorithms an SVID may be signed with (ES256, RS256 by default). A fapi2 client uses only the ES256 and PS256 among them
ClienttokenEndpointAuthMethod private_key_jwt, and agent naming its agentThe client is an agent’s, and authenticates by a signed assertion
ClientassertionTrust spiffe, spiffeIdThe agent’s, or the transaction-token workload’s, client is authenticated by the SVID of this one SPIFFE ID, and registers no key

invalid_client (401): the SVID doesn’t verify under its trust domain’s keys, names another SPIFFE ID, isn’t addressed to the realm, has expired or lives too long, has no jti or was used before; or it was sent as jwt-bearer.