API Reference

Base URL: https://agentlair.dev

All authenticated endpoints require:

Authorization: Bearer al_live_...

Authentication

POST /v1/register

Register a new agent. No API key required. Returns an API key on success.

Request:

{
  "name": "my-agent",
  "address": "my-agent@agentlair.dev",
  "recovery_email": "you@example.com",
  "capabilities": ["code-review", "web-search"]
}
FieldTypeRequiredDescription
namestringEither name or addressAgent name — derived email address
addressstringEither name or addressExplicit @agentlair.dev address
recovery_emailstringNoPersonal email for dashboard access
capabilitiesstring[]NoDeclared capabilities (max 10)

Response (201):

{
  "api_key": "al_live_k7x9m2p4...",
  "account_id": "acc_7kX9mP2qR4wL",
  "email": "my-agent@agentlair.dev",
  "tier": "free"
}

Errors:

CodeErrorDescription
400invalid_addressAddress format invalid or rejected
409address_unavailableAddress already claimed
429rate_limited>5 registrations/IP/hour

Tokens

POST /v1/tokens/issue

Issue a signed AAT (Agent Authentication Token). Requires API key.

Request:

{
  "audience": "https://your-mcp-server.com",
  "scopes": ["mcp:tools:read", "email:send"],
  "ttl": 3600,
  "agent_name": "my-agent",
  "agent_email": "my-agent@agentlair.dev"
}
FieldTypeRequiredDescription
audiencestringYesTarget service URI
scopesstring[]YesPermission scopes (non-empty, max 20)
ttlnumberNoToken lifetime in seconds. Default: 3600. Min: 60. Max: 86400.
agent_namestringNoOverride display name in token claims
agent_emailstringNoAgent email address in token claims

Response (201):

{
  "token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9...",
  "expires_at": "2026-04-18T11:00:00Z",
  "jti": "aat_a1b2c3d4e5f6",
  "audit_url": "https://agentlair.dev/v1/audit/aat_a1b2c3d4e5f6"
}

Token payload claims:

{
  "sub": "acc_7kX9mP2qR4wL",
  "aud": "https://your-mcp-server.com",
  "iat": 1745000000,
  "exp": 1745003600,
  "jti": "aat_a1b2c3d4e5f6",
  "scopes": ["mcp:tools:read"],
  "agent_id": "acc_7kX9mP2qR4wL",
  "agent_name": "my-agent"
}

Errors:

CodeErrorDescription
401unauthorizedMissing or invalid API key
400invalid_scopesEmpty scopes or invalid scope format
400ttl_out_of_rangeTTL outside 60–86400 range
400scope_ceiling_exceededRequested scopes exceed account ceiling
503signing_unavailableSigning key not configured

POST /v1/tokens/introspect

Verify an AAT and return its claims. No authentication required — public endpoint.

This implements RFC 7662 token introspection.

Request:

{
  "token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9..."
}

Response — active token (200):

{
  "active": true,
  "sub": "acc_7kX9mP2qR4wL",
  "aud": "https://your-mcp-server.com",
  "iat": 1745000000,
  "exp": 1745003600,
  "jti": "aat_a1b2c3d4e5f6",
  "scopes": ["mcp:tools:read"],
  "agent_id": "acc_7kX9mP2qR4wL",
  "agent_name": "my-agent"
}

Response — expired or invalid (200):

{
  "active": false
}

Per RFC 7662, introspection always returns 200 — check the active field.


Trust

GET /v1/trust/:agentId

Return the behavioral trust profile for an agent. Requires API key.

Parameters:

ParameterLocationRequiredDescription
agentIdpathYesAgent account ID — format: acc_<alphanumeric>

Response (200):

{
  "agentId": "acc_7kX9mP2qR4wL",
  "score": 725,
  "tier": "trusted",
  "breakdown": {
    "behavioral": 250,
    "consistency": 250,
    "reputation": 150,
    "transparency": 75
  },
  "computedAt": "2026-04-18T10:30:00Z",
  "observationCount": 47
}

Score breakdown:

DimensionMaxSignal
behavioral250Observation volume (25 pts/observation, max 10 obs)
consistency250Recency of latest observation
reputation250Topic diversity (50 pts/topic, max 5 topics)
transparency250Shared observation ratio

Tier thresholds:

TierRangeSemantics
untrusted0–249No behavioral history
provisional250–499Some signal, limited coverage
trusted500–749Established behavioral baseline
verified750–1000Deep history, high transparency

Errors:

CodeErrorDescription
400invalid_agent_idID format invalid (must match acc_*)
401unauthorizedMissing or invalid API key
503audit_unavailableTrust scoring database not configured

JWKS & Discovery

GET /.well-known/jwks.json

Returns the Ed25519 public key used to verify all AATs. No auth required.

Response:

{
  "keys": [
    {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "<base64url-encoded-public-key>",
      "kid": "<key-id>",
      "use": "sig",
      "alg": "EdDSA"
    }
  ]
}

Cache this response. Refresh when you receive a kid mismatch — the key rotates infrequently.


GET /agents/:name/.well-known/jwks.json

Per-agent DID Web JWKS endpoint. Returns the agent’s own signing key. No auth required.

Resolves to the DID Web identifier: did:web:agentlair.dev:agents:{name}


GET /.well-known/openid-configuration

OIDC Discovery document. No auth required.

Returns standard metadata: token_endpoint, introspection_endpoint, and id_token_signing_alg_values_supported: ["EdDSA"].


Telemetry

POST /v1/telemetry/submit

Submit behavioral observations to build the cross-organization trust graph. Requires API key.

Request (single event):

{
  "event": "axiom.committed",
  "agent_id": "acc_7kX9mP2qR4wL",
  "timestamp": "2026-04-18T10:23:45Z",
  "axiom_hash": "<sha256-hex>",
  "action_type": "tool_call",
  "outcome": "success",
  "context_ref": "session_abc123"
}

Request (batch):

[
  { "event": "axiom.committed", "agent_id": "...", ... },
  { "event": "axiom.committed", "agent_id": "...", ... }
]
FieldTypeRequiredDescription
eventstringYesEvent type identifier
agent_idstringYesAgent account ID being observed
timestampstringYesISO 8601 timestamp
axiom_hashstringNoSHA-256 of the observation content
action_typestringYestool_call, memory_update, decision, or external_request
outcomestringYessuccess, failure, or anomaly
context_refstringNoCorrelation ID for grouping events

Telemetry events are stored as shared observations and feed directly into trust score computation.


Endpoint summary

EndpointMethodAuthPurpose
/v1/registerPOSTNoneCreate agent account
/v1/tokens/issuePOSTRequiredIssue AAT
/v1/tokens/introspectPOSTNoneVerify AAT (RFC 7662)
/v1/trust/:agentIdGETRequiredQuery behavioral trust score
/v1/telemetry/submitPOSTRequiredSubmit behavioral observations
/v1/auditGETRequiredRetrieve audit trail
/.well-known/jwks.jsonGETNonePlatform Ed25519 signing key
/.well-known/openid-configurationGETNoneOIDC discovery
/agents/:name/.well-known/jwks.jsonGETNonePer-agent DID Web JWKS