Skip to main content

Agent Identity API

The Agent Identity API provides cryptographic identity for agents -- enabling authentication, delegation, and access control across agent-to-agent interactions.

What the Identity System Provides​

CapabilityDescription
Client MetadataIETF-standard identity document for each agent
JWKSPublic key sets for verifying agent signatures
SPIFFE IdentityTrust-domain-scoped identity for zero-trust architectures
JWT-SVIDShort-lived identity tokens for cross-service authentication
Token ExchangeRFC 8693 delegation -- one agent requests scoped access to another
ExtAuthZ (TBAC)Tool-Based Access Control enforcement for delegated tool calls
Verifiable CredentialsW3C VC 2.0 badges proving agent capabilities

Token Types​

typ HeaderToken TypePurpose
JWTSVIDIdentity proof
vc+jwtBadgeCapability proof
at+jwtAccess TokenDelegation proof

All tokens use ES256 (ECDSA P-256) and can be verified against the platform's public trust bundle.

Audience Formats​

The audience parameter accepts three formats, all resolving to the same agent:

FormatExample
SPIFFE IDspiffe://meetloyd.com/tenant/t1/agent/agent-b
Client ID URLhttps://api.meetloyd.com/api/v1/identity/agents/agent-b/client-metadata.json
Bare agent IDagent-b

Public Endpoints​

These endpoints require no authentication. They serve the agent's public identity documents.

Get Client Metadata​

GET /api/v1/identity/agents/{agentId}/client-metadata.json

Returns the IETF Client ID Metadata document including OAuth grant types, JWKS URI, SPIFFE ID, and signed VC badge.

Get Agent JWKS​

GET /api/v1/identity/agents/{agentId}/jwks.json

Returns the agent's JSON Web Key Set (EC P-256 public keys).

Get Platform JWKS​

GET /api/v1/identity/.well-known/jwks.json

Returns MeetLoyd's platform-level public keys for verifying Badges, SVIDs, and exchanged tokens. Cached for 1 hour.

Get SPIFFE Trust Bundle​

GET /.well-known/spiffe/trust-bundle

Returns the SPIFFE Trust Bundle with sequence number and refresh hint (300s recommended). Used for verifying JWT-SVIDs.

Token Exchange (RFC 8693)​

POST /api/v1/identity/oauth/token

Exchanges a subject token (SVID) for a scoped access token for delegation. The subject token serves as authentication.

Required parameters: grant_type (must be urn:ietf:params:oauth:grant-type:token-exchange), subject_token, subject_token_type, audience (target agent), scope (space-separated tools:* scopes).

Returns an at+jwt access token with the requested tool scopes, delegation chain (act claim), and 1-hour expiry.

Error codes: unsupported_grant_type, invalid_request, invalid_grant (bad token), invalid_target (agent not found or cross-tenant), invalid_scope, insufficient_scope, server_error.

ExtAuthZ (TBAC Enforcement)​

POST /api/v1/identity/authorize

Verifies whether a delegated tool call should be allowed. The exchanged token serves as authentication.

Parameters: token (access token), tool (tool name), callee (callee agent ID).

Returns allowed: true/false with a reason code indicating the policy decision.

Possible reasons: token_invalid, tool_not_in_scope, policy_allow, policy_deny, no_policy_audit_allow, no_policy_enforce_deny.

Get AgentFacts​

GET /api/v1/identity/agents/{agentId}/nanda-facts

Returns the agent's NANDA AgentFacts descriptor, for discovery in federated agent registries. Served for publicly listed agents, and to members of the agent's own organisation.

Authenticated Endpoints​

These require an API key or a signed-in session.

Identity Status​

GET /api/v1/identity/agents/{agentId}/status (requires agents:read)

One summary of the agent's identity: how many active keys it has, whether it can be issued an identity token, and the status and expiry of its capability badge. The same summary is shown in the Identity panel on the agent's page.

Capability Attestations​

GET /api/v1/identity/agents/{agentId}/attestations lists the capability attestations an agent holds. POST to the same path (requires settings:write) runs a new attestation test in a sandbox.

Issue JWT-SVID​

POST /api/v1/identity/agents/{agentId}/svid (requires agents:write)

Issue a short-lived SPIFFE JWT-SVID. Parameters: audience (required), ttlSeconds (default 3600, max 86400).

Rotate Agent Key​

POST /api/v1/identity/agents/{agentId}/keys/rotate (requires agents:write)

Generates a new EC P-256 key pair. The old key is marked as rotated.

Revoke Agent Key​

DELETE /api/v1/identity/agents/{agentId}/keys/{keyId} (requires agents:write)

Revokes a specific key. Key-agent binding is enforced.

Token Introspection (RFC 7662)​

POST /api/v1/identity/oauth/introspect (requires agents:read)

Verify and inspect an exchanged access token. Returns active: true with full claims, or active: false for invalid tokens. Per RFC 7662, always returns 200 OK.

TBAC Policy Management​

List Policies​

GET /api/v1/identity/tbac/policies (requires settings:read)

Filter by callerAgentId, calleeAgentId, toolName. Supports pagination.

Create Policy​

POST /api/v1/identity/tbac/policies (requires settings:write)

FieldTypeRequiredDescription
callerAgentIdstringYesCaller agent ID or * for any
calleeAgentIdstringYesCallee agent ID or * for any
toolNamestringYesTool name or * for any
effectstringNoallow (default) or deny
descriptionstringNoHuman-readable description

Returns 409 if a policy already exists for the same (caller, callee, tool) combination.

Update Policy​

PATCH /api/v1/identity/tbac/policies/{id} (requires settings:write)

Update effect, conditions, or description. All fields optional.

Delete Policy​

DELETE /api/v1/identity/tbac/policies/{id} (requires settings:write)

Verifying Tokens Externally​

To verify any MeetLoyd-signed token from an external system:

  1. Fetch the trust bundle from GET /.well-known/spiffe/trust-bundle
  2. Verify the JWT signature against the keys
  3. Check the typ header to determine token type (JWT, vc+jwt, at+jwt)
  4. Validate iss (should be https://meetloyd.com) and exp (expiry)
  5. Check aud to verify your identity is in the audience list