Skip to content

You are currently viewing documentation for0.1.0-alpha.1

Exchange a workload identity — POST /v1/token

Exchange an existing workload identity

Optional authenticated execution-host interface for integrations that already have an admitted workload identity. This is not public signup or dashboard login. Use the endpoint and registration supplied by your host owner; no managed token endpoint is issued. Send application/json; maximum body 32 KiB. Tokens expire and are sender-bound; refresh outside tool execution.

Request fields

Unknown fields are rejected. JWT exchange uses a trusted workload assertion. Delegation uses an existing access token and cannot expand its authority.

FieldTypeMeaning
grant_typestring; requiredurn:ietf:params:oauth:grant-type:token-exchange
subject_token_typestring; requiredurn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:access_token
subject_tokenstring; requiredWorkload assertion or parent access token. Never log it.
registrationstring; JWT exchangeExisting admitted workload registration. Does not create one.
connectionstring; delegationConnection within the parent authority.
subjectstring; optional delegationDelegated subject; defaults to delegate.
audiencestring; requiredIntended execution audience; must match admitted authority.
toolsstring[]; requiredRequested admitted tool names; delegation can only narrow scope.
ttlinteger seconds; requiredPositive lifetime, at most 900 seconds and no longer than the source credential permits.
cnfobject; requiredExactly one sender binding: {"jkt":"<public-key-thumbprint>"} or {"x5t#S256":"<certificate-thumbprint>"}.

Request example

Illustrative JWT exchange body. Replace the assertion, registration, audience and thumbprint with values admitted by your execution host; never paste real token material into prompts or logs.

json
{
  "grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
  "subject_token_type": "urn:ietf:params:oauth:token-type:jwt",
  "subject_token": "<workload-assertion>",
  "registration": "example-registration",
  "audience": "example-execution",
  "tools": [
    "vendor.read"
  ],
  "ttl": 300,
  "cnf": {
    "jkt": "<public-key-thumbprint>"
  }
}

Success: HTTP 200

The response is application/json with Cache-Control: no-store and Pragma: no-cache. access_token is sensitive; token_type is DPoP for jkt binding or Bearer for certificate binding. expires_at is Unix seconds. Use the corresponding proof or certificate on execution and recovery requests.

json
{
  "access_token": "<access-token>",
  "token_type": "DPoP",
  "issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
  "expires_in": 300,
  "expires_at": 1792933500
}

Errors and retry behavior

JSON errors use {"error":"code"}. 400 invalid_request or unsupported_grant_type: fix the request. 413: reduce body size. 401 identity_*: assertion, expiry or proof refused; acquire a valid identity rather than retry the same proof. 403 identity_*: scope, tenant or registration refused; ask the host owner to authorize this workload and scope. 429 identity_*: exchange capacity/rate exhausted; back off. 503 identity_unavailable or identity_*: exchange unavailable; refresh credentials outside the call path. Do not fall back to an unrelated credential automatically. Replay and rate state are local to one process, not shared across hosts.