Contents

Authentication

The demo company

The demo company comes with demonstration agents, which use this interface from inside the platform. Connecting your company’s own agents is part of a company deployment, arranged on request: request a quote.

An agent authenticates with two distinct keys. The agent key, long-lived, proves who the agent is and signs only the assertions sent to POST /v1/token. The session key, short-lived, proves on every HTTP request that the agent holds the session and signs only the DPoP proofs. The agent obtains its access token with private_key_jwt (RFC 7523); the token is bound to the session key by DPoP (RFC 9449).

What the agent needs

Besides its two keys, an agent needs these values before its first action:

ValueWhere it is usedWhere it comes from
agent_idThe assertion’s iss and sub.Synarun assigns it to the agent registered at the Agents step of the setup. The console shows the agent by its name, not by this identifier.
credential_idThe assertion’s kid.Synarun assigns it to the key registered at the same step. Agents and connections › Agents shows it shortened, in the agent’s details.
connection_idEvery action.The company’s connection through which the action is executed, created when the setup is confirmed. The console does not show its identifier.
capability and parametersEvery action.The action type’s definition: its identifier, its version and its parameters. Configuration › Advanced › Action types lists the identifiers of the company’s action types, without their versions or parameters.
service_idAn access request.GET /v1/services returns it.

On synarun.com, only Synarun’s demo agents use the interface, and they receive the first four values from the platform: no route of the interface returns them. The parameters of the action type used in the examples are described in Submitting an action.

The agent key

  1. Whoever runs the agent generates an Ed25519 key pair locally. The private key never leaves the agent’s environment, and Synarun never sees it.
  2. A person of the company, an Owner or a Company admin, registers the public key in Configuration › Company setup, at the Agents step, with a confirmation. The agent can authenticate only after the setup is confirmed, and only with this key.
  3. Synarun assigns the agent’s identifier (agent_id) and the key’s identifier (credential_id). No route of the interface lets an agent register a key by itself.

On synarun.com, a key is registered only during the company’s initial setup: the console cannot add another key to an agent or reactivate a suspended agent.

In the console, the public key is pasted as a JWK, with only its type, its curve and its x value:

{ "kty": "OKP", "crv": "Ed25519", "x": "gNVlimH-HDOJpcOyETIol7ybBxoyZrEx0mcz24YqnNM" }

A JWK that contains the private key (the d member) is refused. The private key is never pasted and never sent:

{ "kty": "OKP", "crv": "Ed25519", "x": "gNVlimH-HDOJpcOyETIol7ybBxoyZrEx0mcz24YqnNM", "d": "bHDW15znmNXrlMTS0ABE6dB45md8W-U2wDx0yOLFQLc" }

The session key

For each session, the agent generates a new key pair, Ed25519 (EdDSA) or P-256 (ES256). The session key must differ from the agent key; otherwise the token request gets AUTH_PROOF_INVALID. A session stays bound to its key: a token request with the same key, while the session is active, gets a new token in the same session; a new key opens a new, parallel session, for example for another replica of the same agent.

The token request

The agent sends POST /v1/token a form with three fields and, in the DPoP header, a proof signed with the session key. The client assertion (client_assertion) is a compact JWS signed with the agent key. Decoded, it has this shape:

{
  "header": { "alg": "EdDSA", "kid": "agc-5d0e8f3a-6b1c-4e2d-9f70-81a2b3c4d5e6", "typ": "JWT" },
  "claims": {
    "iss": "06c98a7b-c2b0-4798-a2d7-d9638ef5a3e4",
    "sub": "06c98a7b-c2b0-4798-a2d7-d9638ef5a3e4",
    "aud": "https://synarun-api.example/v1/token",
    "jti": "b842379e-0ee6-481c-bbc1-3a741af6fb0d",
    "iat": 1795515300,
    "exp": 1795515360
  }
}
  • The assertion has exactly these members: in header, alg, always EdDSA, kid and, optionally, typ, always JWT; in claims, the six above. With any other member, for example the nbf or client_id some libraries add, the assertion is not valid: 401 AUTH_ASSERTION_INVALID.
  • kid is the identifier of the agent key; iss and sub are both the agent’s identifier.
  • aud is exactly the address of the token route.
  • jti is a UUID in lower case, unique: a repeated assertion gets AUTH_PROOF_REPLAYED.
  • exp lies in the future, at most 60 seconds after iat, and iat may not be more than 60 seconds in the future.

The DPoP proof at the token route, decoded, has no ath:

{
  "header": { "typ": "dpop+jwt", "alg": "EdDSA", "jwk": { "kty": "OKP", "crv": "Ed25519", "x": "hHUctVmrKvvtzMhTrNGYhvKggnIsGkPuyojrZRCDqeI" } },
  "claims": {
    "jti": "7ff89a5ad16af519a71da7771b23820c",
    "htm": "POST",
    "htu": "https://synarun-api.example/v1/token",
    "iat": 1795515300,
    "nonce": "AAAAAAC2pjUU2QbVsoVS4ctQjLROySIV"
  }
}

The complete token request, with the nonce received from the server:

POST /v1/token HTTP/1.1
Host: synarun-api.example
Content-Type: application/x-www-form-urlencoded
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7Imt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJ4IjoiaEhVY3RWbXJLdnZ0ek1oVHJOR1lodktnZ25Jc0drUHV5b2pyWlJDRHFlSSJ9fQ.eyJqdGkiOiI3ZmY4OWE1YWQxNmFmNTE5YTcxZGE3NzcxYjIzODIwYyIsImh0bSI6IlBPU1QiLCJodHUiOiJodHRwczovL3N5bmFydW4tYXBpLmV4YW1wbGUvdjEvdG9rZW4iLCJpYXQiOjE3OTU1MTUzMDAsIm5vbmNlIjoiQUFBQUFBQzJwalVVMlFiVnNvVlM0Y3RRakxST3lTSVYifQ.-x4WA_6IiX5NigsR4EVaVZ_8sx6nftQoljkemW0YCFyqie0cSK9Mys2fBTTMZm8-nJ5TbN5szxizFEzdBB3hDw

grant_type=client_credentials&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion=eyJhbGciOiJFZERTQSIsImtpZCI6ImFnYy01ZDBlOGYzYS02YjFjLTRlMmQtOWY3MC04MWEyYjNjNGQ1ZTYiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiIwNmM5OGE3Yi1jMmIwLTQ3OTgtYTJkNy1kOTYzOGVmNWEzZTQiLCJzdWIiOiIwNmM5OGE3Yi1jMmIwLTQ3OTgtYTJkNy1kOTYzOGVmNWEzZTQiLCJhdWQiOiJodHRwczovL3N5bmFydW4tYXBpLmV4YW1wbGUvdjEvdG9rZW4iLCJqdGkiOiJiODQyMzc5ZS0wZWU2LTQ4MWMtYmJjMS0zYTc0MWFmNmZiMGQiLCJpYXQiOjE3OTU1MTUzMDAsImV4cCI6MTc5NTUxNTM2MH0.B36dTTREbQ_ZJBqgmeHweJme7FYY3sV79FXlsaMJBuOn6hqr85rlEZJASAec4K_abDEskzbBQ1hk7CXu3MTSAA

The nonce exchange

At the token route, the DPoP proof must carry a nonce issued by the server. An agent’s first token request does not have it yet:

  1. The agent sends the token request with a proof without nonce.
  2. Synarun answers 401 AUTH_DPOP_NONCE_REQUIRED, with the nonce in the dpop-nonce header:
HTTP/1.1 401 Unauthorized
dpop-nonce: AAAAAAC2pjUU2QbVsoVS4ctQjLROySIV
www-authenticate: DPoP error="use_dpop_nonce", error_description="Use the DPoP-Nonce of this response"
content-type: application/json; charset=utf-8
{
  "error": {
    "code": "AUTH_DPOP_NONCE_REQUIRED",
    "category": "AUTHENTICATION",
    "message": "Server nonce required or stale (RFC 9449 §8). Retry with the DPoP-Nonce from the response.",
    "retryable": true,
    "trace_id": "e1b528546553a1046ab27c7592597c7e"
  }
}
  1. The agent repeats the token request with a new proof: another jti, a fresh iat and nonce set to the value received. The assertion is built again too, with another jti.

The nonce is bound to the session key that received it and is valid for at most five minutes. The successful answer brings a new nonce, also in the dpop-nonce header, for the next token request. An agent that asks for its next token only when a ten-minute token expires finds that nonce stale and goes through the exchange again. On synarun.com, the nonce is not required at the other routes; if it is ever required there, the answer is the same 401, and the agent repeats the HTTP request once, with the nonce received.

The access token

HTTP/1.1 200 OK
dpop-nonce: AAAAAAC2pjaIo3w6CAhNlCEp59HkliOz
pragma: no-cache
content-type: application/json; charset=utf-8
{
  "access_token": "xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw",
  "token_type": "DPoP",
  "expires_in": 600,
  "session_id": "36c830b0-81a5-446f-a290-c7146dbb2a4c",
  "session_expires_at": "2026-11-24T18:15:00.000Z"
}
  • access_token is opaque: the agent sends it as received and does not interpret it.
  • token_type is always DPoP, never Bearer.
  • expires_in is at most 600 seconds and never outlives the session.
  • A session lasts at most 8 hours (session_expires_at). There is no refresh token: when the token expires, the agent asks for another one, with the same session key.

Authenticated HTTP requests

On every HTTP request, the agent sends exactly one Authorization: DPoP <access_token> header and exactly one DPoP header, with a new proof for that request:

GET /v1/decisions/2b5181a6-d816-4f50-b5aa-5e228a70acc8 HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…

The proof, decoded:

{
  "header": { "typ": "dpop+jwt", "alg": "EdDSA", "jwk": { "kty": "OKP", "crv": "Ed25519", "x": "hHUctVmrKvvtzMhTrNGYhvKggnIsGkPuyojrZRCDqeI" } },
  "claims": {
    "jti": "d8f9204aa2fecdb0eb18953a36703022",
    "htm": "GET",
    "htu": "https://synarun-api.example/v1/decisions/2b5181a6-d816-4f50-b5aa-5e228a70acc8",
    "iat": 1795515302,
    "ath": "rHCsFgMIWr224jypdVPnjNnN-vovRioYNKlYfaIY1yo"
  }
}
  • The proof has exactly these members: in header, typ, always dpop+jwt, alg, EdDSA or ES256, and jwk, the public session key; in claims, jti, htm, htu and iat, ath at every route except /v1/token, and nonce when the server asks for it. With any other member, the proof is not valid: 401 AUTH_PROOF_INVALID.
  • htm is the method, and htu the request’s address, without query string or fragment, on the interface’s origin.
  • iat is within 60 seconds of the server’s clock.
  • ath is base64url(SHA-256(access_token)). At /v1/token, where there is no token yet, a proof with ath is refused.
  • The key in jwk is the one the token is bound to: a token used with another key is refused.
  • jti has 16 to 128 characters and is unique: a repeated proof gets AUTH_PROOF_REPLAYED.

A token presented as Bearer, or without its proof, gets 401 AUTH_INVALID_TOKEN. Until the proof is valid, the answer says nothing about the state of the session, the key or the agent.

Closing the session

The agent closes its session with POST /v1/session/close, without a body and without a Content-Type header: a request that carries one gets 415 PROTOCOL_UNSUPPORTED_MEDIA_TYPE. The session’s tokens stop working at once; the actions already submitted continue normally. The answer is the closed session:

POST /v1/session/close HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
{
  "session_id": "36c830b0-81a5-446f-a290-c7146dbb2a4c",
  "agent_id": "06c98a7b-c2b0-4798-a2d7-d9638ef5a3e4",
  "credential_id": "agc-5d0e8f3a-6b1c-4e2d-9f70-81a2b3c4d5e6",
  "dpop_jkt": "4asASKYcX6WlIhyjV12HlHOgFuAkOCUeZ_0ror-ewRg",
  "security_profile_id": "synarun.security-profile.pilot.v1",
  "state": "CLOSED",
  "closed_reason": "CLIENT_CLOSED",
  "revocation": null,
  "created_at": "2026-11-24T10:15:00.000Z",
  "expires_at": "2026-11-24T18:15:00.000Z",
  "ended_at": "2026-11-24T11:02:41.000Z"
}

Suspension and revocation

In Agents and connections › Agents, a Company admin, or a Department admin for the agents of their departments, can suspend the agent, revoke one of its keys or revoke a session, each with a confirmation. The Owner can do the same by opening the page’s address; the tab is not in the Owner’s menu. Actions approved but not yet executed are stopped; executions already sent to the service are followed to their result. On synarun.com, suspending the agent or revoking its only key cannot be undone from the console. The agent receives these answers:

What happenedWhat the agent receives
The session was revoked, directly, through its key or because the agent was suspended401 AUTH_SESSION_REVOKED
The agent key was revoked or retired, at a token request401 AUTH_CREDENTIAL_INACTIVE
The agent was suspended, at a token request403 AUTH_AGENT_SUSPENDED
The token expired401 AUTH_TOKEN_EXPIRED
The session expired or was closed401 AUTH_SESSION_EXPIRED

What the reference agent does

Synarun’s demo agents handle authentication refusals this way, each at most once per HTTP request and with the same body:

  • on AUTH_DPOP_NONCE_REQUIRED, they repeat the HTTP request with the nonce received;
  • on AUTH_PROOF_INVALID or AUTH_PROOF_REPLAYED, they repeat the HTTP request with a new proof;
  • on AUTH_INVALID_TOKEN, AUTH_TOKEN_EXPIRED or AUTH_SESSION_EXPIRED, they ask for a new token and repeat the same HTTP request, with the same idempotency key;
  • on AUTH_SESSION_REVOKED, AUTH_AGENT_SUSPENDED or AUTH_CREDENTIAL_INACTIVE, they do not repeat the HTTP request.