Klav Atlas

klav-proto

177 schemas in 12 files.

Mainmainfe8e2a0c8c24· 2026-12-05

Blast radius

5 direct · 2 transitive workspaces · 4 apps affected

What a change to these 177 schemas can reach, from workspace dependencies, imports, call sites, and protocol edges.

`POST /v1/agent/access` → `200`: the item with its details.

Framework
serde
Shape
›{5 fields }
item: ItemThe item, details included.
attachments?: AgentAttachment[]Its attachments, when asked for with `include_attachments`.
approval_id?: ApprovalIdThe approval that let this request through, if one did (the one the agent named, or one the server reused, ADR 0015 §2)…
person_version?: PersonVersionWhen an agent wrote the current version (`item.author_agent_id`): the last version the person wrote, for its sites (ADR…
sole_author?: booleanThe agent asking wrote every version of the item and the person none (all of them still stored): the item it created, s…

`POST /v1/agent/access`: use an item (`list` for its metadata, `fill`, `inject`, `totp`, `reveal`, or `proxy` for one call of the credential proxy, with method, host and path in `claims`).

Framework
serde
Shape
›{10 fields }
item_id: ItemIdThe item.
permission: PermissionWhat for.
reason: stringWhy (mandatory, shown to the person and kept in the audit log).
claims?: ClaimsTags and domain.
approval_id?: ApprovalIdAn approval the person granted for this request.
task_id?: TaskIdThe task this request belongs to (ADR 0021 §5). Optional: the server also finds a live task that covers it.
include_attachments?: booleanWith `inject`: also deliver the item's attachments (encrypted), in the same answer and under the same decision (ADR 001…
sandbox?: SandboxIdWith `proxy`: the sandbox the call is for (ADR 0036 §2, E3.3). The server lets it pass only while that sandbox is live …
local_client?: stringWith `proxy` on an MCP profile: the local client on the person's Mac the call is for (ADR 0049 §3.2), named by the prox…
items?: ItemId[]With `inject` on an environment (ADR 0032 §3.1): the other items the same call resolves, the protected items its refere…

`POST /v1/agent/approvals`: asks the person about a write **before** its body is sent (ADR 0030 §3, residual risk 35). The runtime uses it when its own policy says `ask` and nothing it verified covers the write: only once the account's signature on the approval checks out does it send the sealed item, with that `approval_id`. Logged as `agent.ask` with its body.

Framework
serde
Shape
›{7 fields }
permission: Permission`create`, `update` or `delete`.
vault_id: VaultIdThe vault.
project_id: ProjectIdThe project.
item_id?: ItemIdThe item (`update`, `delete`); none for `create`.
reason: stringWhy (shown to the person).
claims?: ClaimsThe tags the write will carry.
task_id?: TaskIdThe task the write belongs to (ADR 0021 §5).

`POST /v1/agent/approvals` → `200`: the write needs no new request. `approval_id` is an approval for the same target that still serves (a lease, or an approve-once decision not spent yet: it is spent by the write, not by this answer); `task_id`, a running task that covers it. With neither, the server says the policy allows the write. `202` is a [`PendingApproval`].

Framework
serde
Shape
›{2 fields }
approval_id?: ApprovalIdAn approval that lets the write through.
task_id?: TaskIdA task that covers the write.

An attachment delivered to an agent: its metadata (with the wrapped key) and its ciphertext.

Framework
serde
Shape
›{2 fields }
attachment: AttachmentMetadata.
content: BlobCiphertext (STREAM, spec §10).

`POST /v1/agent/items`: create an item in a granted project.

Framework
serde
Shape
›{6 fields }
vault_id: VaultIdVault of the project.
item: CreateItemThe item, as for people.
reason: stringWhy.
claims?: ClaimsTags of the new item.
approval_id?: ApprovalIdAn approval for this request.
task_id?: TaskIdThe task this request belongs to (ADR 0021 §5).

An agent as the person sees it.

Framework
serde
Shape
›{12 fields }
id: AgentIdID.
name: stringName it registered with.
note?: stringWhat it said it needs.
public_identity: BlobIts public identity (compare the pairing words before approving).
status: AgentStatusState.
created_at: numberRegistration time (Unix ms).
expires_at: numberWhen a pending request lapses (Unix ms).
approved_at?: numberFirst approval (Unix ms).
revoked_at?: numberRevocation (Unix ms).
last_seen_at?: numberLast signed request (Unix ms, minute granularity).
grant?: SignedGrantCurrent grant.
paused?: AgentPausedThe pause in effect on this agent, its own or the account-wide one (ADR 0033 §7). Absent when it is not paused.

`GET /v1/agent/items`: the items of the granted projects the policy lets the agent list. Overviews and wrapped keys only: details come one item at a time through `POST /v1/agent/access`.

Framework
serde
Shape
›{2 fields }
grant_version: numberGrant version the answer was computed with.
projects: AgentProjectItems[]One entry per listable project.

`GET /v1/agents`.

Framework
serde
Shape
›{1 field }
agents: AgentInfo[]Agents of the account, newest first.

`GET /v1/agent/me` (signed by the agent).

Framework
serde
Shape
›{15 fields }
id: AgentIdID.
name: stringName.
status: AgentStatusState.
lapsed?: boolean`status` is `denied` only because the pending registration lapsed: nobody approved or denied it (ADR 0033 E2.2). Older …
account_id: AccountIdThe account.
account_public_identity: BlobThe account's public identity, to verify grants and approvals. The agent pins it the first time (ADR 0014).
grant?: SignedGrantCurrent grant (active agents).
paused?: AgentPausedThe person paused this agent (or every agent): every other request is refused with `403 agents_paused` until it ends (A…
account_delete_at?: numberThe person asked to delete the account, which the server does at this time (Unix ms): every other request is refused wi…
gone_issuers?: AgentId[]For a credential proxy: the issuers of its grant that the server no longer counts as issuers of it (revoked, denied, ex…
mcp_gateway?: boolean`true` while the account's `mcp_gateway` switch is on (ADR 0049 §9): the runtime may send MCP claims and `local_client`…
proxy_tunnels?: boolean`true` while the account's `proxy_tunnels` switch is on (ADR 0052 §10): the runtime may send `claims.upgrade` for a Web…
pg_guard?: boolean`true` while the account's `pg_guard` switch is on (ADR 0052 §10): the runtime may send the `pg_*` claims and upload se…
sandbox_secret_requests?: boolean`true` while the account's `sandbox_secret_requests` switch is on (ADR 0053 §9): a credential proxy may ask for a secre…
hosted_proxy?: HostedProxyStatusOnly for an agent Klav Cloud's hosted proxy registered (ADR 0051 §3.5): whether the account is still entitled to it. Ab…

A pause in effect, with what the account signed (spec §13.9): the person's devices check it before acting on it.

Framework
serde
Shape
›{4 fields }
agent_id?: AgentIdThe agent; absent for the account-wide pause.
at: numberWhen the person paused (Unix ms).
until?: numberWhen it ends by itself (Unix ms); `0`: until the person resumes.
signature: BlobThe account's signature over the pause.

A pause in effect on an agent: in [`AgentInfo`], [`AgentMe`] and the `403 agents_paused` error body (ADR 0033 §7.4).

Framework
serde
Shape
›{3 fields }
scope: PauseScopeThe account-wide pause, or this agent's own.
since: numberWhen the person paused (Unix ms), as signed.
until?: numberWhen it ends by itself (Unix ms); absent: until the person resumes.

Answer to [`PauseAgents`]: every pause of the account still in effect.

Framework
serde
Shape
›{1 field }
pauses: AgentPause[]Pauses in effect (the account-wide one first, if any).

Items of one granted project.

Framework
serde
Shape
›{6 fields }
vault_id: VaultIdVault.
project_id: ProjectIdProject.
project_version: numberCurrent version of the project (what writes send as `project_version`).
project_meta: BlobThe project's metadata sealed with its current key for `project_version` (kind `0x13`). The runtime opens it with the k…
items: Item[]Live items (not in the trash), without details.
attachments?: Attachment[]Completed, not deleted attachments of those items (metadata and wrapped keys, no content): the runtime asks for them wi…

State of an agent.

Framework
serde
Shape
"pending" | "active" | "denied" | "revoked"

`POST /v1/agent/items/{item_id}/trash`.

Framework
serde
Shape
›{4 fields }
reason: stringWhy.
claims?: ClaimsTags of the item.
approval_id?: ApprovalIdAn approval for this request.
task_id?: TaskIdThe task this request belongs to (ADR 0021 §5).

`POST /v1/agent/items/{item_id}/trash` → `200`.

Framework
serde
Shape
›{1 field }
approval_id?: ApprovalIdThe approval used, if any (see [`AccessGranted::approval_id`]).

`PUT /v1/agent/items/{item_id}`: a new version of an item.

Framework
serde
Shape
›{5 fields }
item: UpdateItemThe new version, as for people.
reason: stringWhy.
claims?: ClaimsTags of the item.
approval_id?: ApprovalIdAn approval for this request.
task_id?: TaskIdThe task this request belongs to (ADR 0021 §5).

`POST /v1/agent/items` → `201` and `PUT /v1/agent/items/{item_id}` → `200`: the item written, and the approval that let the write through, if one did (see [`AccessGranted::approval_id`]).

Framework
serde
Shape
›intersection2 parts
›& {1 field }
approval_id?: ApprovalIdThe approval used, if any.

Who a proxied call is for, as the person signs it (ADR 0049 §5.4): exactly one of the two.

Framework
serde
Shape
›{2 fields }
sandbox_id?: SandboxIdA sandbox of the proxy.
local_client?: stringA local client on the person's Mac.

An approval request as stored.

Framework
serde
Shape
›{11 fields }
id: ApprovalIdID.
agent_id: AgentIdThe agent.
status: ApprovalStatusState.
request: Blob[`ApprovalRequest`] JSON bytes, as signed.
created_at: numberAsked at (Unix ms).
expires_at: numberDecide before (Unix ms).
decided_at?: numberDecided at (Unix ms).
lease_until?: numberApproved until (Unix ms; `0`: once).
signature?: BlobThe person's signature on the decision.
used_at?: numberWhen an approve-once decision was spent (Unix ms; ADR 0015).
sealed_blob?: BlobThe sealed blob the agent uploaded for this request (ADR 0052 §9.6: kind `0x29`, the exact SQL), opaque to the server, …

`GET /v1/approvals`.

Framework
serde
Shape
›{1 field }
approvals: ApprovalInfo[]Newest first.

What the person is asked to approve. The server builds it once and stores its JSON bytes; the person signs exactly those bytes (spec §13.5).

Framework
serde
Shape
›{14 fields }
v: numberFormat version (1).
approval_id: ApprovalIdThe approval.
agent_id: AgentIdThe agent.
agent_name: stringIts name.
permission: PermissionWhat it wants to do.
vault_id: VaultIdWhere.
project_id: ProjectIdWhere.
item_id?: ItemIdOn which item (absent for `create`).
reason: stringWhy, in the agent's words.
claims?: ClaimsClaimed tags and domain.
grant_version: numberGrant version in force (a new grant voids the approval).
requested_at: numberWhen it was asked (Unix ms).
caller?: ApprovalCallerWho the proxied call is for, according to the proxy: its sandbox or its local client (ADR 0049 §5.4). Only while the ac…
items?: ItemId[]The other items this one approval covers (ADR 0032 §3.1): the protected items an environment's references point to, sor…

State of an approval request.

Framework
serde
Shape
"pending" | "approved" | "denied" | "expired"

What the agent says about the item it acts on. The server cannot read tags or check the page it fills: it evaluates the policy with these claims, and the agent's runtime checks them against the decrypted item (ADR 0014 §4).

Framework
serde
Shape
›{11 fields }
tags?: string[]Tags of the item.
domain?: stringHost the value is for (`fill`, `proxy`).
method?: stringHTTP method of the request the proxy builds (`proxy`, ADR 0036 §2).
path?: stringHTTP path of that request, without query (`proxy`). Never a body or a header.
mcp_tool?: stringThe tool of an MCP `tools/call` (`proxy`, ADR 0049 §5.4), in the tool grammar ([`klav_core::policy::tool_name_ok`]). On…
mcp_args?: stringThe digest of that call's arguments (32 bytes, base64url without padding, spec §13.16), with `mcp_tool` only. The serve…
upgrade?: UpgradeThe protocol upgrade of the request the proxy builds: `websocket` for a tunnel's handshake (`proxy`, ADR 0052 §3). Only…
pg_database?: stringThe database of a Postgres session (`proxy`, ADR 0052 §9.2, §9.6). With no `pg_class`, the access opens or re-checks th…
pg_class?: SqlClassThe class of one non-read statement or batch: `write`, `ddl`, `admin` or `unknown`, never `read` (that is the session's…
pg_verbs?: string[]The leading verbs of its statements ([`pg_verb_ok`]), 1–8, with `pg_class` only.
pg_sql?: stringThe digest of the exact statement and parameters (32 bytes, base64url without padding, spec §13.17), with `pg_class` on…

`POST /v1/approvals/{id}/decide`.

Framework
serde
Shape
›{5 fields }
approve: booleanApprove or deny.
lease_until: numberApproved until (Unix ms); `0` approves this request once.
decided_at: numberWhen the person decided (Unix ms).
signature: BlobSignature by the account identity (spec §13.5).
task_id?: TaskId«Add to the task» (ADR 0021 §6): the running task the person just extended to cover this request. Not signed (the signe…

Names of a granted project, as the person saw them when approving (plaintext of `GrantedProject::labels`).

Framework
serde
Shape
›{2 fields }
vault: stringVault name.
project: stringProject name.

What an agent may do (the signed part of a grant).

Framework
serde
Shape
›{13 fields }
v: numberFormat version ([`GRANT_PAYLOAD_VERSION`]).
account_id: AccountIdAccount that grants.
agent_id: AgentIdThe agent.
version: numberGrow by one with each new grant for the same agent.
issued_at: numberWhen it was issued (Unix ms).
policy: PolicyPermissions, scopes, hours and expiry (`klav_core::policy`). Vaults and projects are named by ID only: the server canno…
projects: GrantedProject[]Shared projects, each with its key wrapped for the agent.
items?: GrantedItem[]Shared items, each with its own key wrapped for the agent (`v: 2`, ADR 0036 §2). A grant with items has no projects.
profiles?: ProxyProfile[]What the credential proxy puts in each request (`v: 2`, ADR 0036 §2): one profile per item and destination.
issuers?: SandboxIssuer[]On the credential proxy's grant (`v: 3`, ADR 0036 §4): the agents that may start sandboxes through it, and with what.
sandbox?: IssuerGrantOn an issuer's grant (`v: 3`, ADR 0036 §3–§4): the proxy it starts sandboxes at. Present with `proxy: null` when the ac…
local_clients?: LocalClient[]On the credential proxy's grant (`v: 4`, ADR 0049 §3.2): the MCP clients on the person's Mac that may use its MCP profi…
released?: ItemId[]Items whose inherited protection (`origin: "protected"` rules, ADR 0032 §3.1) this grant drops on purpose: the person's…

One item shared with an agent (a per-item grant, ADR 0036 §2). Its key opens that item only, never another one of its project.

Framework
serde
Shape
›{5 fields }
vault_id: VaultIdVault of the item.
owner_account_id: AccountIdOwner of the vault (the account: part of the HPKE context).
project_id: ProjectIdProject of the item, when the grant was signed.
item_id: ItemIdThe item.
shared_key: BlobThe item key sealed with HPKE for the agent (kind `0x23`).

A project shared with an agent.

Framework
serde
Shape
›{5 fields }
vault_id: VaultIdVault of the project.
owner_account_id: AccountIdOwner of the vault (the account: part of the HPKE context).
project_id: ProjectIdProject.
shared_key: BlobThe project key sealed with HPKE for the agent (kind `0x21`).
labels: Blob[`GrantLabels`] sealed with the project key (kind `0x14`): the agent cannot open the vault name, which is sealed with t…

Whether an account is entitled to Klav Cloud's hosted proxy (ADR 0051 §3.5): in [`AgentMe::hosted_proxy`] for the hosted proxy's own agents, and the answer of `GET /v1/account/hosted-proxy`. An older server never sends it and answers that route `404`.

Framework
serde
Shape
›{1 field }
entitled: booleanThe operator turned the hosted proxy on for this account (`klav-server hosted-proxy enable`). While it is `false` the h…

The hosted proxy's mark on a registration (spec §15.8): its service key signs `tuple("klav/v1/sig/hosted-proxy-registration", account_id(16), agent_id(16), agent_ed25519_pub(32), agent_x25519_pub(32), u32_be(generation))`. The e-mail isn't signed: the server requires it to be the e-mail of `account_id`.

Framework
serde
Shape
›{3 fields }
account_id: AccountIdThe account the enclave derived the agent's keys for; it must be the account of the e-mail.
generation: numberThe account's key generation (ADR 0051 §3.2).
signature: BlobThe service key's Ed25519 signature (64 bytes).

What an issuer's grant says about sandboxes (ADR 0036 §3): which proxy it talks to, so a malicious sync server cannot change it.

Framework
serde
Shape
›{1 field }
proxy?: SandboxProxyThe account's proxy, or `null` when the account has none it may use.

An MCP client on the person's Mac, as the account signed it into the proxy's grant (ADR 0049 §3.2). The proxy names the caller to the server with `name` only after the caller's bearer token matches `token_digest`.

Framework
serde
Shape
›{3 fields }
name: stringThe person's label (`claude-code`, `cursor`): 1–32 of `a-z 0-9 -` ([`klav_core::policy::local_client_name_ok`]).
token_digest: Blob`SHA-256(tuple("klav/v1/proxy/local-client", agent_id(16), token(32)))` with the proxy's ID (32 bytes, spec §13.16). Ne…
profiles: string[]Names of this grant's MCP profiles the client may use.

`GET /v1/account/mcp-gateway` and `POST /v1/account/mcp-gateway` (ADR 0049 §9): the account's switch. `POST` turns it on, and nothing turns it off. An older server answers `404`.

Framework
serde
Shape
›{2 fields }
mcp_gateway: booleanWhether the switch is on.
since?: numberWhen it was turned on (Unix ms).

One fixed header of an MCP profile.

Framework
serde
Shape
›{2 fields }
name: stringLower-case name.
value: stringPrintable ASCII, at most 128 bytes.

What makes a profile an MCP profile (ADR 0049 §2.1): the upstream's MCP endpoint, which the proxy reads, checks and filters, and the fixed headers the person signed.

Framework
serde
Shape
›{2 fields }
endpoint: stringThe endpoint's path on `upstream`, canonical ([`klav_core::policy::is_canonical_path`]), at most 64 bytes. The profile …
headers?: McpHeader[]At most 4 fixed, non-secret headers sent on every request.

`POST /v1/agent/access` with `passkey` → `200` (ADR 0020 §9): the task lets the agent use the item's passkey on `domain`. No item and no details: the agent hands its signed request to the person's `klavd`, which checks it all again and signs in the browser.

Framework
serde
Shape
›{3 fields }
task_id: TaskIdThe task that covers it.
item_id: ItemIdThe login.
domain: stringThe host it was granted for, normalized.

`POST /v1/agents/pause` (every agent) and `POST /v1/agents/{agent_id}/pause` (one): a pause or a resume signed by the account (spec §13.9).

Framework
serde
Shape
›{4 fields }
state: PauseStatePause or resume.
at: numberWhen the person decided (Unix ms), as signed: within ±5 min of the server's clock and later than the last decision on t…
until?: numberEnd of a pause (Unix ms), as signed; `0` for no end. Always `0` in a resume.
signature: BlobThe account's signature (spec §13.9).

What a pause covers, as an agent sees it (ADR 0033 §7.4).

Framework
serde
Shape
"all" | "agent"

The `state` a pause decision signs (spec §13.9).

Framework
serde
Shape
"pause" | "resume"

`202 Accepted` from any agent action the policy sets to `ask`.

Framework
serde
Shape
›{2 fields }
pending_approval_id: ApprovalIdAsk the person to decide, then retry with this ID.
expires_at: numberUntil when the person can decide (Unix ms).

The last version of an item the person wrote: enough to read its sites (the overview), never its secrets.

Framework
serde
Shape
›{3 fields }
version: numberIts version number (in the AAD of the overview).
wrapped_key: BlobThe item key, wrapped with the project key at that version.
overview: BlobIts overview section (kind `0x10`).

`GET /v1/account/pg-guard` and `POST /v1/account/pg-guard` (ADR 0052 §10): the account's switch for the Postgres proxy's claims and the sealed-blob route. `POST` turns it on, and nothing turns it off. An older server answers `404`.

Framework
serde
Shape
›{2 fields }
pg_guard: booleanWhether the switch is on.
since?: numberWhen it was turned on (Unix ms).

What makes a profile a Postgres profile (ADR 0052 §7): how the proxy reaches the database, which databases a session may open, where the role name is, and how the hop is protected. The item's main secret is the password; it never reaches the sandbox.

Framework
serde
Shape
›{6 fields }
transport: PgTransportHow the proxy reaches the database.
databases: string[]1–4 database names ([`pg_database_ok`]): a session asking for another is refused.
user_field: stringThe item field that holds the role name.
tls: PgTlsTLS toward the database.
write_item_id?: ItemIdA second item of the grant, a role allowed to write, used only for approved writes (ADR 0052 §9.3, §9.6). The profile's…
allow_cleartext_over_tls?: booleanWhether the proxy may answer `AuthenticationCleartextPassword`: only over `direct` with `verify-full` TLS (ADR 0052 §9.…

TLS toward the database (ADR 0052 §7).

Framework
serde
Shape
"verify-full" | "none"

How a Postgres profile reaches its database (ADR 0052 §8).

Framework
serde
Shape
›union2 members
›| {1 field }
›direct: {2 fields }
host: stringNormalized host name ([`klav_core::policy::normalize_host`]).
port: numberTCP port, never 0.
›| {1 field }
›northflank_addon: {5 fields }
profile: stringThe tunnel profile of this grant whose token opens the tunnel.
project: stringThe Northflank project.
addon: stringThe addon.
team?: stringThe team, for a team project.
port: numberThe addon's port, never 0.

A recipe signed by the account (ADR 0036 §2): which item's value goes in which header, and where requests through it go. The hosts, methods and paths it may reach are the `proxy` rules of the policy for its item; `upstream` must be one of those hosts.

Framework
serde
Shape
›{10 fields }
name: stringName, such as `northflank`: lower-case letters, digits and `-`, starting with a letter. In mode (a) it is the first seg…
item_id: ItemIdThe item whose value it uses (one of the grant's `items`).
field?: stringThe field holding the value; absent: the item's main secret.
header?: stringThe header the value goes in, in lower case (`authorization`, `project-access-token`). Empty, and omitted, only on a Po…
prefix?: stringText before the value, such as `Bearer `.
upstream?: stringWhere mode (a) sends requests: `https://host` or `https://host:port`, without path. Empty, and omitted, only on a Postg…
rate_per_minute?: numberMost calls per minute through this profile (default [`DEFAULT_PROFILE_RATE`]).
mcp?: McpProfileAn MCP profile (`v: 4`, ADR 0049 §2.1): the proxy reads, checks and filters the JSON-RPC on `endpoint` and forwards not…
tunnel?: TunnelProfileWebSocket tunnels (`v: 5`, ADR 0052 §2): mode (b) hosts the proxy relays a signed handshake to, with this profile's cre…
pg?: PgProfileA Postgres profile (`v: 5`, ADR 0052 §7): the proxy speaks Postgres to the sandbox and to the database, with this item'…

`GET /v1/account/proxy-tunnels` and `POST /v1/account/proxy-tunnels` (ADR 0052 §10): the account's switch for WebSocket tunnels. `POST` turns it on, and nothing turns it off. An older server answers `404`.

Framework
serde
Shape
›{2 fields }
proxy_tunnels: booleanWhether the switch is on.
since?: numberWhen it was turned on (Unix ms).

`POST /v1/agents/register` (no authentication).

Framework
serde
Shape
›{5 fields }
id: AgentIdAgent ID, generated by the agent.
email: stringE-mail of the account the agent asks to join.
name: stringName shown to the person (1–64 characters, no control characters).
public_identity: BlobThe agent's public identity (kind `0x05`).
note?: stringWhat the agent says it needs (free text shown to the person).

Response to [`RegisterAgent`]: the same for every e-mail, so the endpoint does not reveal which accounts exist.

Framework
serde
Shape
›{3 fields }
id: AgentIdAgent ID.
status: AgentStatusAlways [`AgentStatus::Pending`].
expires_at: numberWhen the request lapses if nobody approves it (Unix ms).

What `POST /v1/agents/register` accepts: [`RegisterAgent`] and, only from Klav Cloud's hosted proxy, [`Self::hosted`] (ADR 0051 §8). Every other agent keeps sending [`RegisterAgent`], which parses as this with `hosted` absent; older servers refuse `hosted` as an unknown field.

Framework
serde
Shape
›{6 fields }
id: AgentIdAgent ID, generated by the agent.
email: stringE-mail of the account the agent asks to join.
name: stringName shown to the person (1–64 characters, no control characters).
public_identity: BlobThe agent's public identity (kind `0x05`).
note?: stringWhat the agent says it needs (free text shown to the person).
hosted?: HostedRegistrationProofThe hosted proxy's mark on this registration. The server refuses the registration with `403` unless the mark verifies w…

`POST /v1/agents/{agent_id}/revoke`.

Framework
serde
Shape
›{2 fields }
revoked_at: numberRevocation time (Unix ms), as signed.
signature: BlobSignature by the account identity (spec §13.6).

An agent that may start sandboxes through the credential proxy, as the account signed it into the proxy's grant (ADR 0036 §4). The proxy checks the issuer's requests with this identity, never one from the server.

Framework
serde
Shape
›{6 fields }
agent_id: AgentIdThe issuer.
public_identity: BlobIts public identity (66 bytes, kind `0x05`), the one the person approved.
profiles: string[]Names of this grant's profiles its sandboxes may use.
max_ttl_secs: numberLongest TTL it may give a sandbox, in seconds.
max_live: numberMost of its sandboxes alive at once.
secret_requests?: booleanWhether its sandboxes may ask the person for a secret through the proxy (ADR 0053 §3.2, Q3 (a)): the issuer opt-in, off…

The proxy an issuer starts sandboxes at.

Framework
serde
Shape
›{3 fields }
agent_id: AgentIdThe proxy agent.
public_identity: BlobIts public identity (66 bytes): the pin of a sandbox package is the SHA-256 of its Ed25519 key's SPKI (spec §13.10).
url: stringWhere a sandbox reaches it: `tls://host:port` (spec §13.10).

`GET /v1/account/sandbox-secret-requests` and `POST /v1/account/sandbox-secret-requests` (ADR 0053 §9): the account's switch for secret requests a credential proxy raises on behalf of one of its live sandboxes, decisions with `attach_sandbox` and `v: 6` grants. `POST` turns it on, and nothing turns it off. An older server answers `404`.

Framework
serde
Shape
›{2 fields }
sandbox_secret_requests: booleanWhether the switch is on.
since?: numberWhen it was turned on (Unix ms).

A grant as stored: the payload bytes (JSON of [`GrantPayload`]) exactly as signed, and the account's signature (spec §13.4).

Framework
serde
Shape
›{2 fields }
payload: BlobJSON bytes of the [`GrantPayload`]; verify before parsing.
signature: BlobEd25519 signature by the account identity (64 bytes).

What lets a profile open WebSocket tunnels (ADR 0052 §2–§4): the hosts they may reach and under which path. The rules that let a handshake through are `proxy` rules with `upgrades: [websocket]` for the profile's item; this says only where the proxy accepts one at all.

Framework
serde
Shape
›{4 fields }
hosts: TunnelHost[]1–4 hosts, each exact or `*.base` for exactly one label ([`klav_core::policy::TunnelHost`]). Never the upstream's host.
path_prefix: PathPrefixThe path a handshake must be under ([`PathPrefix`]), at most [`MAX_TUNNEL_PATH_PREFIX`] bytes: `/tunnel` covers `/tunne…
idle_secs?: numberSeconds with no data frame either way before the proxy closes the tunnel (default [`DEFAULT_TUNNEL_IDLE_SECS`], at most…
max_secs?: numberLongest a tunnel lives, never past the sandbox's expiry (default [`DEFAULT_TUNNEL_MAX_SECS`], at most [`MAX_TUNNEL_MAX_…

Who acted.

Framework
serde
Shape
"person" | "agent"

The agent's signed request behind an event (spec §13.3).

Framework
serde
Shape
›{7 fields }
method: stringHTTP method.
path: stringPath and query as signed.
timestamp: numberAgent time (Unix ms).
nonce: BlobRequest nonce.
body_digest: BlobSHA-256 of the body.
body?: BlobThe body itself, when at most [`MAX_PROOF_BODY`] bytes.
signature: BlobThe agent's signature.

A stored event.

Framework
serde
Shape
›{3 fields }
seq: numberPosition.
event: BlobThe [`AuditEvent`] JSON bytes, as hashed.
hash: Blob`hash_seq`.

One event of the log. Readers ignore unknown fields: the hash covers the stored bytes, so a newer server can add fields without breaking it.

Framework
serde
Shape
›{35 fields }
v: numberFormat version.
seq: numberPosition in the account's chain (from 1).
at: numberServer time (Unix ms).
actor: ActorKindPerson or agent.
device_id?: DeviceIdDevice of the person.
approved_by_device_id?: DeviceIdIn `device.linked`: the existing device that approved the link (ADR 0029 §7).
new_device_id?: DeviceIdIn `device.linked`: the device that was added.
link_id?: LinkIdIn `device.linked`: the single-use relay slot the login consumed.
agent_id?: AgentIdThe agent (actor, or subject of a person's decision).
action: stringWhat happened: `agent.registered`, `agent.granted`, `agent.denied`, `agent.revoked`, `agent.access`, `agent.create`, `a…
vault_id?: VaultIdVault.
project_id?: ProjectIdProject.
item_id?: ItemIdItem.
permission?: PermissionPermission used.
outcome?: string`allow`, `ask` or `deny` (policy), `approve` or `deny` (decision); in `task.ended`, who ended it (`person`, `agent`, `e…
reason?: stringThe agent's reason.
domain?: stringClaimed host (`fill`).
method?: stringHTTP method of a proxied request (`proxy`, ADR 0036 §9), as the proxy signed it.
path?: stringHTTP path of a proxied request, without query, as the proxy signed it (`proxy`). Never a body or a header.
attachments?: AttachmentId[]Attachments delivered with an allowed `inject` (ADR 0016).
approval_id?: ApprovalIdApproval request involved.
task_id?: TaskIdTask involved: the task of a `task.*` event, or the task that let an agent action through (ADR 0021 §9).
lease_until?: numberLease of an approval (Unix ms; `0`: once).
decided_at?: numberWhen the person decided (Unix ms), as signed.
until?: numberIn `agents.paused`: when the pause ends by itself (Unix ms), as signed; absent when it lasts until the person resumes (…
networks?: string[]For `agent.egress_pinned`, the signed canonical networks in text form; an empty list removes the pin.
alerts?: string[]Alerts raised: `first_use` (first time this agent uses this item's secrets), `burst` (more than 20 uses in a minute), `…
agent_proof?: AgentProofThe agent's signed request.
signed?: BlobWhat the account signed: grant payload, approval request bytes or task decision bytes. (A `task.requested` keeps the ag…
task_request?: BlobIn `task.decided`: the agent's task request the decision answers, exactly as stored, so the account's signature (spec §…
account_signature?: BlobThe account's signature over it (spec §13.4–13.6, §13.8, §13.9, §13.11, §13.13).
sandbox_id?: SandboxIdIn `sandbox.revoke_requested`: the sandbox the person revoked; absent when the revocation is `all` (spec §13.11). In th…
sandbox_ids?: SandboxId[]In a `sandbox.revoke_requested` with `all`: the proxy's sandboxes it covers, sorted, as the server read them from the l…
secret_request_id?: SecretRequestIdSecret request involved (`secret_request.created`, `secret_request.decided`; ADR 0046).
proposal_digest?: BlobSHA-256 of the canonical proposal JSON of a secret request (32 bytes, spec §13.14): kept in the audit log while `propos…

A chain head signed by a device of the person.

Framework
serde
Shape
›{5 fields }
seq: numberPosition.
hash: Blob`hash_seq`.
signature: BlobAccount signature (spec §13.7).
device_id: DeviceIdDevice that signed it.
signed_at: numberWhen (Unix ms).

`GET /v1/audit/heads`.

Framework
serde
Shape
›{1 field }
heads: AuditHead[]Newest first (at most 100).

`GET /v1/audit?after=&limit=`.

Framework
serde
Shape
›{2 fields }
entries: AuditEntry[]Events after `after`, in order.
head_seq: numberLast position of the chain.

`GET /v1/audit` query.

Framework
serde
Shape
›{2 fields }
after?: numberReturn events with `seq > after`.
limit?: numberAt most this many (default and maximum 1000).

`POST /v1/audit/person`: an event that happened only on a device of the person (the server never sees it otherwise), such as signing in with a passkey. The server checks the item, the task and the agent, adds the vault, the project and the device, and appends it to the chain. It carries no site: `passkey.used` names only the item.

Framework
serde
Shape
›{4 fields }
action: stringOne of [`PERSON_ACTIONS`].
item_id: ItemIdThe item used.
agent_id?: AgentIdThe agent that used it, inside `task_id` (ADR 0020 §9).
task_id?: TaskIdThe task that let the agent use it. With `agent_id`, or neither.

`POST /v1/audit/heads`.

Framework
serde
Shape
›{3 fields }
seq: numberPosition.
hash: Blob`hash_seq`.
signature: BlobAccount signature.

`POST /v1/account/delete/finish`: the last OPAQUE message. If it verifies, the deletion is scheduled in the same request.

Framework
serde
Shape
›{2 fields }
handle: stringHandle from [`AccountDeleteStartResponse`].
credential_finalization: BlobOPAQUE KE3.

`POST /v1/account/delete/start`: the first OPAQUE message, computed with the master password and this device's Secret Key (ADR 0037 §1, spec §4.5). The e-mail is the session's account, never the client's.

Framework
serde
Shape
›{1 field }
credential_request: BlobOPAQUE KE1.

Response to [`AccountDeleteStartRequest`].

Framework
serde
Shape
›{2 fields }
handle: stringHandle of this reauthentication: one use, 2 minutes, this session only, and only to delete the account.
credential_response: BlobOPAQUE KE2.

A deletion of the account the person asked for (ADR 0037 §2): the account is deleted at `delete_at` unless a device cancels it first.

Framework
serde
Shape
›{4 fields }
requested_at: numberWhen the person asked (Unix ms).
delete_at: numberWhen the server deletes the account (Unix ms): 7 days later.
device_id: DeviceIdThe device that asked.
device_name: stringIts name, as the device list shows it.

`GET /v1/account`: the keyset, and the pending deletion, if the person asked for one (ADR 0037 §3). The keyset's fields are at the top level, so a client that reads an [`AccountKeyset`] still works.

Framework
serde
Shape
›intersection2 parts
›& {1 field }
deletion?: AccountDeletionThe deletion the person asked for. Absent when there is none, and on older servers.

Everything a client needs to unlock the account.

Framework
serde
Shape
›{5 fields }
account_id: AccountIdAccount ID.
email: stringNormalised e-mail.
kdf_params: BlobEncoded KDF parameters (kind `0x06`).
public_identity: BlobPublic identity (kind `0x05`).
sealed_identity: BlobIdentity private keys sealed with the KEK (kind `0x01`).

A device of the account (`GET /v1/devices`).

Framework
serde
Shape
›{9 fields }
id: DeviceIdDevice ID.
name: stringDisplay name.
kind: DeviceKindKind of installation.
created_at: numberRegistration time (Unix milliseconds).
last_seen_at: numberLast authenticated request (Unix milliseconds, minute precision).
revoked_at?: numberRevocation time, if revoked.
current: boolean`true` for the device making the request.
added_from_device_id?: DeviceIdExisting device this device was added from with a QR code (ADR 0029 §7).
added_from_device_name?: stringName of that device when this device was added.

The device a login is for.

Framework
serde
Shape
›{3 fields }
id?: DeviceIdID returned by a previous login on this installation, if any. If it is unknown or revoked, the server registers a new d…
name: stringDisplay name (1–64 characters), e.g. `"MacBook de Omar"`.
kind: DeviceKindKind of installation.

Kind of client installation.

Framework
serde
Shape
›union7 members
| "cli"
| "daemon"
| "browser"
| "ios"
| "macos"
| "android"
| "other"

`GET /v1/devices`.

Framework
serde
Shape
›{1 field }
devices: Device[]All devices, newest first (revoked ones included).

`POST /v1/auth/invite/check` (ADR 0048 §1.3): whether `invite` can be used by `email` now. `204` or `403 invite_invalid`; `404` on a server that is not in `invite` mode. Not a reservation.

Framework
serde
Shape
›{2 fields }
email: stringAccount e-mail the person will sign up with.
invite: InviteCodeThe invite code as typed or pasted.

`POST /v1/auth/login/finish`.

Framework
serde
Shape
›{4 fields }
login_id: stringHandle from [`LoginStartResponse`].
credential_finalization: BlobOPAQUE `CredentialFinalization` (KE3).
device: DeviceInfoDevice being logged in.
link_id?: LinkIdDevice-link slot this login completes (ADR 0029 §7). Absent in an ordinary login.

Response to [`LoginFinishRequest`].

Framework
serde
Shape
›{3 fields }
account: AccountKeysetAccount keyset (to open the identity with the KEK).
device_id: DeviceIdThe device this session belongs to; store it for the next login.
session: SessionTokensSession credentials.

`POST /v1/auth/login/start`.

Framework
serde
Shape
›{2 fields }
email: stringAccount e-mail.
credential_request: BlobOPAQUE `CredentialRequest` (KE1).

Response to [`LoginStartRequest`].

Framework
serde
Shape
›{2 fields }
login_id: stringOpaque handle of the pending login (valid for a short time).
credential_response: BlobOPAQUE `CredentialResponse` (KE2).

`POST /v1/auth/prelogin`.

Framework
serde
Shape
›{1 field }
email: stringAccount e-mail.

Response to [`PreloginRequest`].

Framework
serde
Shape
›{1 field }
kdf_params: BlobEncoded KDF parameters (kind `0x06`). For unknown e-mails, stable decoy parameters indistinguishable from real ones.

Where the server sends a device's push notifications (APNs).

Framework
serde
Shape
"sandbox" | "production"

`PUT /v1/devices/current/push`: the APNs device token of this device (hex). Pushes only carry an approval or agent ID (ADR 0018 §5).

Framework
serde
Shape
›{2 fields }
token: stringDevice token, hexadecimal.
environment: PushEnvironmentAPNs environment of the app build.

`POST /v1/auth/refresh`.

Framework
serde
Shape
›{1 field }
refresh_token: stringCurrent refresh token. Reusing an already rotated token revokes the whole session (theft detection).

`POST /v1/auth/register/finish`.

Framework
serde
Shape
›{7 fields }
email: stringAccount e-mail (same as in the start request).
account_id: AccountIdClient-generated account ID (it is part of the AAD of every blob).
registration_upload: BlobOPAQUE `RegistrationUpload`.
kdf_params: BlobEncoded KDF parameters (kind `0x06`).
public_identity: BlobPublic identity (kind `0x05`).
sealed_identity: BlobIdentity private keys sealed with the KEK (kind `0x01`).
invite?: InviteCodeInvite code, only for a server in `invite` mode (ADR 0048 §1.3). Never serialized when absent: older servers refuse unk…

Response to [`RegisterFinishRequest`].

Framework
serde
Shape
›{1 field }
account_id: AccountIdThe new account.

`POST /v1/auth/register/start`.

Framework
serde
Shape
›{3 fields }
email: stringAccount e-mail.
registration_request: BlobOPAQUE `RegistrationRequest`.
invite?: InviteCodeInvite code, only for a server in `invite` mode (ADR 0048 §1.3). Never serialized when absent: older servers refuse unk…

Response to [`RegisterStartRequest`].

Framework
serde
Shape
›{1 field }
registration_response: BlobOPAQUE `RegistrationResponse`.

Session credentials. Access tokens go in `Authorization: Bearer …`.

Framework
serde
Shape
›{4 fields }
access_token: stringShort-lived bearer token.
access_expires_at: numberExpiry of the access token (Unix milliseconds).
refresh_token: stringSingle-use refresh token; every refresh returns a new one.
refresh_expires_at: numberExpiry of the refresh token (Unix milliseconds).

Body of every non-2xx JSON response.

Framework
serde
Shape
›intersection2 parts
›& {5 fields }
error: ErrorCodeMachine-readable code.
message: stringHuman-readable message. Never contains internal details.
current_version?: numberOn a version conflict (409), the version currently stored.
last_at?: numberOn a 409 to a pause or a resume whose `at` is not later than the scope's latest decision: that decision's `at` (Unix ms…
delete_at?: numberWith [`ErrorCode::AccountDeleting`]: when the account is deleted (Unix ms, ADR 0037 §3).

Machine-readable error code returned in [`ErrorBody::error`].

Framework
serde
Shape
›union24 members
| "bad_request"
| "unauthorized"
| "forbidden"
| "not_found"
| "conflict"
| "payload_too_large"
| "too_many_requests"
| "internal"
| "unavailable"
| "agents_paused"
| "reauth_failed"
| "account_deleting"
| "not_issuer"
| "profile_not_allowed"
| "too_many_sandboxes"
| "sandbox_revoked"
| "sandbox_claimed"
| "sandbox_not_found"
| "invite_invalid"
| "quota_exceeded"
| "mcp_gateway_off"
| "proxy_tunnels_off"
| "pg_guard_off"
| "sandbox_secret_requests_off"

`GET /v1/health`.

Framework
serde
Shape
›{6 fields }
status: string`"ok"` when the server and its database respond.
version: stringServer version (`CARGO_PKG_VERSION`).
registration_open?: booleanWhether the server accepts new accounts, so clients can say so before asking for a password (ADR 0028 §3). Absent on ol…
account_deletion?: booleanWhether the person can delete the account from the apps and the CLI (`POST /v1/account/delete/…`, ADR 0037 §4). Clients…
registration_mode?: RegistrationModeHow the server takes new accounts (ADR 0048 §1.2). Clients read it first and fall back to `registration_open` when it i…
temporary_items?: booleanWhether the server accepts, enforces and purges temporary items (`expires_at`, ADR 0056 layer 2). Absent on older serve…

How a server takes new accounts (`registration_mode`, ADR 0048 §1.1).

Framework
serde
Shape
"open" | "invite" | "closed" | "unknown"

`GET /v1/attest?account&nonce` answer (ADR 0051 §2.2 step 1).

Framework
serde
Shape
›{4 fields }
document: BlobThe attestation document, `user_data` = the account's binding.
agent_id: AgentIdThe account's hosted agent.
generation: numberIts generation.
manifest_seq: numberThe `seq` of the manifest the enclave serves.

`POST /v1/enroll` answer.

Framework
serde
Shape
›{4 fields }
agent_id: AgentIdThe account's hosted agent, pending until the person approves it.
generation: numberIts generation.
channel: stringIts channel name (`a<agent_id hex>.<endpoint>`).
expires_at: numberWhen the pending agent lapses (Unix ms), as the server said.

`POST /v1/enroll` (ADR 0051 §6.1 step 2).

Framework
serde
Shape
›{6 fields }
account_id: AccountIdThe account.
email: stringIts e-mail, for the agent's registration.
account_public_identity: BlobIts identity (kind `0x05`), which signed this request.
generation: numberThe generation asked for.
at_ms: numberWhen it was signed (Unix ms).
signature: Blob`tuple("klav/v1/sig/hosted-proxy-enroll", …)`, by the account.

`GET /v1/manifest`: the signed Klav Enclave Transparency Manifest, its exact text and the signature in hex (ADR 0051 §2.4).

Framework
serde
Shape
›{2 fields }
manifest: stringThe manifest's bytes (UTF-8 JSON), as signed.
signature: stringThe signature, 128 hex characters.

Slot mode (ADR 0029 §2): the new device shows the QR (`a`) or the existing device shows it (`b`).

Framework
serde
Shape
"a" | "b"

`POST /v1/links/claim`.

Framework
serde
Shape
›{3 fields }
link_id: LinkIdSlot ID.
fetch_key: BlobN's one-time fetch key (32 bytes). The server never stores or logs it.
wait_secs?: numberHow long to wait, capped by the server at 60 seconds (default 60).

Successful `POST /v1/links/claim`.

Framework
serde
Shape
›{1 field }
blob: BlobSealed `0x22` package, handed over exactly once.

A mode-B offer as the existing device reads it.

Framework
serde
Shape
›{4 fields }
pk_n: BlobN's ephemeral X25519 public key (32 bytes).
device_name: stringDevice name as N claims it. It is not authenticated.
device_kind: DeviceKindDevice kind as N claims it. It is not authenticated.
created_at: numberWhen the offer arrived (Unix ms).

The unauthenticated offer of the new device (mode B), `POST /v1/links/{id}/offer`.

Framework
serde
Shape
›{4 fields }
pk_n: BlobN's ephemeral X25519 public key (32 bytes).
claim_hash: Blob`SHA-256(tuple("klav/v1/link/id", fetch_key))[0..16]` (16 bytes).
device_name: stringDevice name as N claims it. It is not authenticated.
device_kind: DeviceKindDevice kind as N claims it. It is not authenticated.

`PUT /v1/links/{id}/payload`.

Framework
serde
Shape
›{6 fields }
blob: BlobSealed `0x22` package. The server never opens it.
signature: BlobEd25519 account signature of ADR 0029 §5.3 (64 bytes).
pk_n: BlobN's ephemeral X25519 public key bound into the signature (32 bytes).
issued_at_ms: number`issued_at_ms` bound into the signature.
approved_by_device_id: DeviceIdExisting device that approved the link; it must be the session device.
server: stringCanonical server URL the package is for, as signed.

`GET /v1/links/{id}` and the response body of `POST /v1/links`.

Framework
serde
Shape
›{7 fields }
link_id: LinkIdSlot ID.
mode: DeviceLinkModeRelay mode.
expires_at: numberWhen the slot expires (Unix ms).
waiting: booleanWhether the new device has a claim long-poll open right now.
same_network?: booleanWhether the new device and this requesting device appear to be on the same public network. Absent when N has not offere…
offer?: LinkOfferThe new device's mode-B offer.
payload_ready: booleanWhether the sealed package is ready to collect.

`POST /v1/links` (mode B).

Framework
serde
Shape
›{1 field }
link_id: LinkIdRandom slot ID the existing device put in its QR code.

An agent's signed request, as it went to the server (spec §13.3), handed to the person's `klavd` as proof that this agent asked for this step (ADR 0020 §9, step 3, applied to ADR 0022 §5): `klavd` checks the signature with the agent's identity from its verified grant, the path, the body and the time before it fills or writes anything. It carries no secret: the body is the step's JSON (IDs and a reason).

Framework
serde
Shape
›{6 fields }
method: stringHTTP method, upper case.
path: stringPath exactly as signed (`/v1/agent/rotations`).
timestamp_ms: number`Klav-Timestamp` (Unix ms).
nonce: Blob`Klav-Nonce` (16 bytes).
body: BlobThe exact body bytes.
signature: Blob`Klav-Signature` (64 bytes).

`POST /v1/agent/rotations/{id}/confirm` and `…/cancel`: the agent says whether the site took the new password (`rotate_confirm`, `rotate_cancel`).

Framework
serde
Shape
›{2 fields }
item_id: ItemIdThe item, as when the change started (signed again, so the audit event proves it on its own).
reason: stringWhy.

`POST /v1/agent/rotations`: the agent starts changing an item's password (`rotate_password`).

Framework
serde
Shape
›{4 fields }
item_id: ItemIdThe item.
reason: stringWhy (mandatory, like every agent reason).
claims?: Claims`domain` is mandatory: the host of the change page, which the task must approve for this item.
task_id?: TaskIdThe task this change belongs to; the server finds one if absent.

One change, as the server keeps it: IDs, host and times, never values.

Framework
serde
Shape
›{9 fields }
id: RotationIdThe change (the agent's `pending_id`).
task_id: TaskIdThe task that covers it.
vault_id: VaultIdVault of the item.
project_id: ProjectIdProject of the item.
item_id: ItemIdThe item.
host: stringHost of the change page.
status: RotationStatusWhere it stands.
started_at: numberStarted (Unix ms).
finished_at?: numberConfirmed, cancelled or abandoned (Unix ms).

`POST /v1/agent/rotations` → `201`: the change and the task that covers it, whose signed decision `klavd` verifies before it fills anything (ADR 0022 §5, step 2).

Framework
serde
Shape
›{2 fields }
rotation: RotationInfoThe change.
task: TaskInfoIts task, with the decision in force and its signature.

Where a change stands.

Framework
serde
Shape
"started" | "confirmed" | "cancelled" | "abandoned"

`POST /v1/agent/sandboxes/{sandbox_id}/claimed`: a forwarder claimed the sandbox with its secret, from the channel key it presented (`sandbox.claimed`, ADR 0036 §5, E3.3). The proxy sends this before it counts the secret as spent. The proxy that calls it arrives with layer 6.

Framework
serde
Shape
›{1 field }
channel_key_sha256: BlobSHA-256 of the DER `SubjectPublicKeyInfo` of the channel's Ed25519 key (spec §13.10, the same construction as the proxy…

Why the proxy ended a sandbox (`sandbox.revoked`, ADR 0036 §9, E3.3).

Framework
serde
Shape
›union8 members
| "stop"
| "ttl"
| "inactivity"
| "theft"
| "released"
| "issuer_removed"
| "person"
| "person_local"

`PUT /v1/agent/sandboxes/state`: the proxy's heartbeat (ADR 0036 E3.3, spec §13.12). A signed request, kept by the server out of the log (only the last one of each proxy), and checked by each device: the proxy's signature, the epoch of the proxy's last `sandbox.store_reset` in the verified chain, a `seq` that never goes down within it, and its age from `sent_at_ms`. It never makes a sandbox live: the chain does.

Framework
serde
Shape
›{5 fields }
v: number[`HEARTBEAT_VERSION`].
store_epoch: BlobThe epoch of the proxy's store ([`SandboxStoreReset`]).
seq: numberGrows with each heartbeat of this store; kept in the store, and saved before the heartbeat is sent.
sent_at_ms: numberThe proxy's clock when it signed it (Unix ms): the age a device shows comes from here, never from the server.
sandboxes: SandboxLink[]Its live sandboxes, at most [`MAX_HEARTBEAT_SANDBOXES`].

`POST /v1/agent/sandboxes`: the proxy started a sandbox for an issuer (`sandbox.issued`). It sends this before it hands the issuer the package; if the server refuses, there is no package.

Framework
serde
Shape
›{5 fields }
sandbox_id: SandboxIdChosen by the proxy (16 random bytes).
issuer_id: AgentIdThe issuer that asked for it, as the proxy verified its request.
label: stringThe issuer's label (shown "per the issuer", T136).
profiles: string[]Names of the proxy's profiles the sandbox may use.
expires_at: numberWhen it ends (Unix ms), the `vence_ms` of the package.

A person's revocation as the server keeps it: the answer to [`PATH_PERSON_REVOKE`] and an entry of [`PATH_REVOCATIONS`].

Framework
serde
Shape
›{6 fields }
seq: numberThe position of its `sandbox.revoke_requested` in the account's log; the cursor of [`PATH_REVOCATIONS`].
proxy_id: AgentIdThe proxy.
scope: stringA sandbox ID, or [`SCOPE_ALL`], as signed.
at: numberWhen the person revoked, Unix ms, as signed.
signature: BlobThe account's signature.
sandbox_ids: SandboxId[]The sandboxes it covers: the one, or those of an `all` (not signed by the account; the log orders them).

`GET /v1/agent/sandboxes/revocations?since=`: the proxy's revocations after `since`, oldest first.

Framework
serde
Shape
›{2 fields }
revocations: SandboxRevocation[]At most [`MAX_REVOCATIONS_PAGE`].
more: booleanMore after the last one: ask again from its `seq`.

`POST /v1/sandboxes/revoke`: the person revokes one sandbox of the proxy, or all of them, with the account's signature (spec §13.11, ADR 0036 E3.3).

Framework
serde
Shape
›{4 fields }
proxy_id: AgentIdThe proxy (an agent of the account).
scope: stringA sandbox ID, or [`SCOPE_ALL`].
at: numberWhen the person revoked, Unix ms, as signed.
signature: BlobThe account's signature (64 bytes).

`POST /v1/agent/sandboxes/{sandbox_id}/revoked`: the proxy ended a sandbox (`sandbox.revoked`).

Framework
serde
Shape
›{2 fields }
reason: SandboxEndWhy.
at?: numberWith `person`, and only then: the `at` (Unix ms) of the person's revocation it answers. Absent otherwise, so the other …

The last heartbeat of one proxy of the account, as `GET /v1/sync` gives it (ADR 0036 E3.3, spec §13.12): the proxy's signed `PUT /v1/agent/sandboxes/state`, body included, for each device to check against the proxy's key and the verified chain. The server only keeps it.

Framework
serde
Shape
›{3 fields }
proxy_id: AgentIdThe proxy.
proof: AgentProofIts signed request, with the [`SandboxHeartbeat`] as the body.
received_at: numberWhen the server took it (server clock, Unix ms). Not signed: the heartbeat's age comes from its `sent_at_ms`.

`POST /v1/agent/sandboxes/epochs`: a new store of the proxy, logged as `sandbox.store_reset` before its first heartbeat (ADR 0036 E3.3). Each store, the first one too, has its own epoch, and a proxy never uses one twice: a heartbeat from before a reset carries the old epoch and no device takes it.

Framework
serde
Shape
›{1 field }
store_epoch: BlobThe new epoch ([`STORE_EPOCH_LEN`] random bytes).

`POST /v1/agent/secret-requests`: an agent asks the person for a secret.

Framework
serde
Shape
›{7 fields }
id: SecretRequestIdClient-generated request ID (`409` if already used).
mode: SecretRequestModeCreate a new item or update a field of an existing one.
target_item_id?: ItemIdItem to update; required when `mode == update`, absent when `mode == create`.
reason: stringShort explanation shown to the person and logged in the audit chain.
proposal_digest: BlobSHA-256 of the canonical [`klav_core::secret_request::SecretRequestProposal`] JSON bytes before sealing (32 bytes).
proposal_blob: BlobProposal sealed with HPKE to the account's X25519 identity (kind `0x25`).
sandbox?: SandboxIdThe live sandbox a credential proxy asks for (ADR 0053 §3.2). Only a proxy sends it, never for itself, and only while t…

`POST /v1/secret-requests/{id}/decide`: the person's signed decision.

Framework
serde
Shape
›{3 fields }
decision: BlobExact JSON bytes of `klav_core::secret_request::SecretRequestDecision`, as signed.
signature: BlobAccount Ed25519 signature over the decision (spec §13.14).
decided_at: numberWhen the person decided (Unix ms), as signed.

`POST /v1/agent/secret-requests` → `202`.

Framework
serde
Shape
›{2 fields }
request_id: SecretRequestIdRequest ID to poll with `GET /v1/agent/secret-requests/{id}?wait=N`.
expires_at: numberWhen the request expires if unanswered (Unix ms).

A secret request as stored and returned by the API.

Framework
serde
Shape
›{16 fields }
id: SecretRequestIdRequest ID.
agent_id: AgentIdAgent that asked.
agent_name: stringAgent name.
mode: SecretRequestModeCreate or update.
target_item_id?: ItemIdTarget item in `update` mode.
reason: stringPlaintext reason.
proposal_digest: BlobSHA-256 of the canonical proposal JSON (32 bytes).
proposal_blob?: BlobHPKE-sealed proposal blob (kind `0x25`); present only while pending for the person's devices and cleared on decision or…
status: SecretRequestStateCurrent state.
created_at: numberCreated at (Unix ms).
expires_at: numberExpires at (Unix ms).
decided_at?: numberDecided at (Unix ms), as signed.
decision?: BlobSigned JSON bytes of `klav_core::secret_request::SecretRequestDecision`.
signature?: BlobAccount Ed25519 signature over the decision (spec §13.14).
sandbox_id?: SandboxIdThe sandbox the asking credential proxy named (ADR 0053 §3.2). Absent for every other request. This struct accepts unkn…
sandbox_label?: stringThe sandbox's label as the proxy signed it in `sandbox.issued`, the server's copy: a device shows the one from its veri…

`GET /v1/secret-requests`: the account's secret requests, newest first.

Framework
serde
Shape
›{1 field }
secret_requests: SecretRequestInfo[]Newest first (at most 100).

Lifecycle state of a secret request on the server.

Framework
serde
Shape
"pending" | "fulfilled" | "denied" | "expired"

An encrypted attachment.

Framework
serde
Shape
›{10 fields }
id: AttachmentIdAttachment ID.
vault_id: VaultIdVault.
item_id: ItemIdItem it belongs to.
size: numberSize of the ciphertext in bytes.
received: numberBytes uploaded so far (equals `size` once complete).
wrapped_key?: BlobAttachment key wrapped with the item key (kind `0x04`); absent once deleted.
revision: numberRevision of the last change (0 while the upload is in progress).
created_at: numberCreation time (Unix milliseconds).
completed_at?: numberUpload completion time; until then the attachment is invisible to sync.
deleted_at?: numberDeletion time (tombstone).

Payload of a `change` server-sent event on `GET /v1/events`.

Framework
serde
Shape
›{2 fields }
vault_id: VaultIdVault that changed.
revision: numberRevision it reached.

Everything in a vault that changed after `since`, up to `revision`. Deleted projects and purged items come as tombstones (`deleted_at` / `purged_at` set, no blobs).

Framework
serde
Shape
›{8 fields }
vault_id: VaultIdVault ID.
since: numberThe `since` of the request.
revision: numberCurrent revision: the client's new high-water mark.
vault?: VaultThe vault itself, if its metadata changed (or it was deleted).
members: Member[]Memberships that changed.
projects: Project[]Projects that changed.
items: Item[]Items that changed (with both sections).
attachments: Attachment[]Attachments that were completed or deleted.

Query of `GET /v1/vaults/{vault_id}/changes`.

Framework
serde
Shape
›{1 field }
since?: numberLast revision the client has applied (0 for a full download).

`POST /v1/vaults/{vault_id}/items/{item_id}/attachments`.

Framework
serde
Shape
›{4 fields }
id: AttachmentIdClient-generated attachment ID (part of the AAD).
size: numberExact size of the encrypted attachment (kind `0x30`), in bytes.
wrapped_key: BlobAttachment key wrapped with the item key (kind `0x04`).
item_version?: numberThe item version the client saw, whose key wrapped `wrapped_key`. When present and not the current version, the server …

Payload of a `secret_request` server-sent event on `GET /v1/events` (ADR 0046 §1). Carries only the request ID and its current state.

Framework
serde
Shape
›{2 fields }
request_id: SecretRequestIdSecret request that was created, decided or expired.
status: SecretRequestStateCurrent state.

`GET /v1/sync`: every vault the caller belongs to, with its revision. A vault that disappears from this list was purged or the caller lost access to it.

Framework
serde
Shape
›{4 fields }
vaults: VaultRevision[]Vaults, including deleted ones not yet purged.
agent_pauses?: AgentPause[]Pauses of the account's agents in effect, signed by the account (ADR 0033 §7.2): every device of the person learns them…
deletion?: AccountDeletionThe deletion of the account the person asked for (ADR 0037 §3): every device learns it on sync and says so. Absent when…
sandbox_state?: SandboxState[]The last heartbeat of each proxy of the account that is still an active agent, a paused one included (ADR 0036 E3.3, sp…

Response to an uploaded chunk.

Framework
serde
Shape
›{2 fields }
received: numberBytes received so far (the next `offset`).
size: numberDeclared total size.

Query of `PUT /v1/vaults/{vault_id}/attachments/{attachment_id}/content`.

Framework
serde
Shape
›{1 field }
offset: numberWhere this chunk starts; must equal the bytes received so far.

Revision of one vault (`GET /v1/sync`).

Framework
serde
Shape
›{3 fields }
vault_id: VaultIdVault ID.
revision: numberCurrent revision.
deleted_at?: numberSet when the vault is deleted (pending purge).

`POST /v1/agent/tasks/{id}/end`: the agent ends its task.

Framework
serde
Shape
›{1 field }
reason: stringWhy (mandatory, like every agent reason).

`POST /v1/tasks/{id}/decide`: the first decision, a denial, or a revision («Add to the task», ADR 0021 §6).

Framework
serde
Shape
›{4 fields }
approve: booleanApprove or deny.
decision: BlobJSON bytes of `klav_core::task::TaskDecision`, as signed.
decided_at: numberWhen the person decided (Unix ms), as signed.
signature: BlobSignature by the account identity (spec §13.8).

`POST /v1/tasks/{id}/end`: the person ends a task.

Framework
serde
Shape
›{2 fields }
ended_at: numberWhen (Unix ms), as signed.
signature: BlobSignature by the account identity (spec §13.8, `task-end`).

`POST /v1/tasks`: the person offers an agent a task without a request (ADR 0022 §6). The person's client picks the task ID, since it is part of what the account signs; the stored request is empty.

Framework
serde
Shape
›{5 fields }
task_id: TaskIdNew task ID (409 if taken).
agent_id: AgentIdThe agent it is offered to.
decision: BlobJSON bytes of `klav_core::task::TaskDecision`, with `offer`, as signed.
decided_at: numberWhen the person decided (Unix ms), as signed.
signature: BlobSignature by the account identity over an empty request (spec §13.8).

`POST /v1/agent/tasks` → `202`.

Framework
serde
Shape
›{2 fields }
pending_task_id: TaskIdAsk the person to decide, then follow it with `GET /v1/agent/tasks/{id}?wait=N`.
expires_at: numberUntil when the person can decide (Unix ms).

Who or what ended an approved task (ADR 0021 §9).

Framework
serde
Shape
"person" | "agent" | "expiry" | "revocation"

A task as stored.

Framework
serde
Shape
›{14 fields }
id: TaskIdID (generated by the server).
agent_id: AgentIdThe agent.
agent_name: stringIts name.
status: TaskStatusState.
request: BlobThe agent's request: JSON bytes of `klav_core::task::TaskRequest`, exactly as signed. Empty for a task the person offer…
created_at: numberAsked at (Unix ms).
decide_by: numberDecide before (Unix ms).
decided_at?: numberDecided at (Unix ms), as signed.
decision?: BlobThe decision in force: JSON bytes of `klav_core::task::TaskDecision`.
signature?: BlobThe account's signature on it (spec §13.8).
revision?: numberRevision of the decision in force (0 while pending).
expires_at?: numberWhen an approved task ends (Unix ms).
ended_at?: numberWhen it ended (Unix ms).
ended_by?: TaskEndedByWho ended it.

`GET /v1/tasks` and `GET /v1/agent/tasks`.

Framework
serde
Shape
›{1 field }
tasks: TaskInfo[]Newest first.

State of a task.

Framework
serde
Shape
"pending" | "approved" | "denied" | "expired" | "ended"

`POST /v1/vaults/{vault_id}/items`.

Framework
serde
Shape
›{8 fields }
id: ItemIdClient-generated item ID.
project_id: ProjectIdProject the item belongs to (part of the AAD; cannot change later).
version: numberMust be 1.
wrapped_key: BlobItem key wrapped with the project key (kind `0x03`).
project_version: numberVersion of the project whose key wrapped `wrapped_key`: `409` if it is not the current one (the project key rotated in …
overview: BlobOverview section (kind `0x10`).
details: BlobDetails section (kind `0x11`).
expires_at?: numberPlaintext copy of the authenticated expiry of a temporary item (Unix milliseconds, ADR 0056). Absent (`NULL` on the ser…

`POST /v1/vaults/{vault_id}/projects`.

Framework
serde
Shape
›{3 fields }
id: ProjectIdClient-generated project ID.
wrapped_key: BlobProject key wrapped with the vault key (kind `0x02`).
meta: BlobProject metadata encrypted by the client (opaque to the server).

`POST /v1/vaults`.

Framework
serde
Shape
›{4 fields }
id: VaultIdClient-generated vault ID.
meta: BlobVault metadata encrypted by the client (opaque to the server).
shared_key: BlobThe vault key shared with the creator's own identity (kind `0x20`).
shared_key_signature: BlobThe creator's Ed25519 signature over `shared_key` (64 bytes, `klav/v1/sig/vault-key`, spec §8.3). Required: without it …

An item. Lists carry only the overview; `details` comes with a single item. Purged items are tombstones without blobs.

Framework
serde
Shape
›{14 fields }
id: ItemIdItem ID.
vault_id: VaultIdVault it belongs to.
project_id: ProjectIdProject it belongs to.
version: numberCurrent version (also in the AAD of both sections).
revision: numberRevision of the last change.
wrapped_key?: BlobItem key wrapped with the project key (kind `0x03`).
overview?: BlobOverview section (kind `0x10`).
details?: BlobDetails section (kind `0x11`).
expires_at?: numberPlaintext expiry of a temporary item (Unix milliseconds, ADR 0056); absent for a permanent item and in a tombstone. Cli…
created_at: numberCreation time (Unix milliseconds).
updated_at: numberLast change of the content (Unix milliseconds).
trashed_at?: numberIn the trash since (purged automatically after the retention period).
purged_at?: numberPermanently deleted (tombstone kept for sync).
author_agent_id?: AgentIdWho wrote the current version: the agent, or (absent) the person (ADR 0030 §7). Versions from before authorship was kep…

`GET /v1/vaults/{vault_id}/items/{item_id}/versions`.

Framework
serde
Shape
›{1 field }
versions: ItemVersionInfo[]Available versions, newest first (the current one included).

`GET /v1/vaults/{vault_id}/items`.

Framework
serde
Shape
›{1 field }
items: Item[]Items with their overview (no details).

Query of `GET /v1/vaults/{vault_id}/items`.

Framework
serde
Shape
›{2 fields }
project_id?: ProjectIdOnly items of this project.
trash?: TrashFilterWhich items to list with respect to the trash.

`GET /v1/vaults/{vault_id}/items/{item_id}/versions/{version}`.

Framework
serde
Shape
›{8 fields }
item_id: ItemIdItem ID.
project_id: ProjectIdProject at that version.
version: numberVersion number.
wrapped_key: BlobItem key wrapped with the project key (kind `0x03`).
overview: BlobOverview section (kind `0x10`).
details: BlobDetails section (kind `0x11`).
created_at: numberWhen this version was written (Unix milliseconds).
author_agent_id?: AgentIdThe agent that wrote it, or (absent) the person (ADR 0030 §7).

One entry of an item's history.

Framework
serde
Shape
›{3 fields }
version: numberVersion number.
created_at: numberWhen this version was written (Unix milliseconds).
author_agent_id?: AgentIdThe agent that wrote it, or (absent) the person (ADR 0030 §7).

A member of a vault and the vault key shared with it.

Framework
serde
Shape
›{6 fields }
member_type: MemberTypeKind of member.
member_id: stringAccount or agent ID (canonical UUID).
role: RoleRole.
shared_key: BlobThe vault key shared with this member (kind `0x20`).
revision: numberRevision of the last change to this membership.
revoked_at?: numberRevocation time, if revoked.

`GET /v1/vaults/{vault_id}/members`.

Framework
serde
Shape
›{1 field }
members: Member[]Members (revoked ones included).

Kind of vault member.

Framework
serde
Shape
"account" | "agent"

A project.

Framework
serde
Shape
›{9 fields }
id: ProjectIdProject ID.
vault_id: VaultIdVault it belongs to.
version: numberVersion of the project row.
revision: numberRevision of the last change.
wrapped_key?: BlobProject key wrapped with the vault key (kind `0x02`); absent once deleted.
meta?: BlobEncrypted metadata; absent once deleted.
created_at: numberCreation time (Unix milliseconds).
updated_at: numberLast change (Unix milliseconds).
deleted_at?: numberDeletion time (tombstone).

`GET /v1/vaults/{vault_id}/projects/{project_id}/keys`: every item key wrapped with the project key, to rotate it.

Framework
serde
Shape
›{2 fields }
version: numberCurrent version of the project.
keys: WrappedItemKey[]Current rows (not purged) and stored versions.

`GET /v1/vaults/{vault_id}/projects`.

Framework
serde
Shape
›{1 field }
projects: Project[]Projects (deleted ones excluded).

An attachment key wrapped again for a new item key.

Framework
serde
Shape
›{2 fields }
attachment_id: AttachmentIdThe attachment.
wrapped_key: BlobIts key wrapped with the new item key (kind `0x04`).

Role of a member in a vault.

Framework
serde
Shape
"owner" | "member"

`POST /v1/vaults/{vault_id}/projects/{project_id}/rotate`: a new project key, and every item key of [`ProjectKeys`] wrapped with it, applied in one transaction.

Framework
serde
Shape
›{4 fields }
version: numberNew version: the current one plus one.
wrapped_key: BlobThe new project key wrapped with the vault key (kind `0x02`).
meta: BlobThe metadata sealed with the new key for `version`.
keys: WrappedItemKey[]Exactly the keys of [`ProjectKeys`], re-wrapped (409 if the project changed in between).

`PUT /v1/vaults/{vault_id}/signature`: the owner signs the vault key of a vault created before the signature existed (TOFU, ADR 0030 §1).

Framework
serde
Shape
›{1 field }
shared_key_signature: BlobEd25519 signature over the caller's `shared_key` (64 bytes, spec §8.3).

Trash filter for listings.

Framework
serde
Shape
"exclude" | "only" | "include"

`PUT /v1/vaults/{vault_id}/items/{item_id}`.

Framework
serde
Shape
›{7 fields }
version: numberNew version: must be the current version plus one; both sections must be encrypted for this version.
wrapped_key: BlobItem key wrapped with the project key (kind `0x03`).
project_version: numberVersion of the project whose key wrapped `wrapped_key`, as in [`CreateItem::project_version`].
overview: BlobOverview section (kind `0x10`).
details: BlobDetails section (kind `0x11`).
expires_at?: numberPlaintext copy of the authenticated expiry of a temporary item (Unix milliseconds, ADR 0056). Absent (`NULL` on the ser…
attachment_keys?: RewrappedAttachmentKey[]Present when the write gives the item a new key (ADR 0036 §18): every completed attachment of the item that is not dele…

`PUT /v1/vaults/{vault_id}/projects/{project_id}`.

Framework
serde
Shape
›{3 fields }
version: numberNew version: must be the current version plus one.
wrapped_key: BlobProject key wrapped with the vault key (kind `0x02`); changes when the vault key or the project key rotates.
meta: BlobNew encrypted metadata.

`PUT /v1/vaults/{vault_id}`.

Framework
serde
Shape
›{2 fields }
version: numberNew version: must be the current version plus one.
meta: BlobNew encrypted metadata.

A vault as seen by one of its members.

Framework
serde
Shape
›{11 fields }
id: VaultIdVault ID.
owner_account_id: AccountIdAccount that owns the vault (part of the AAD of everything inside).
role: RoleCaller's role.
revision: numberCurrent revision of the vault (highest revision of anything in it).
version: numberVersion of the vault metadata.
meta: BlobEncrypted metadata.
shared_key: BlobThe vault key shared with the caller (kind `0x20`).
shared_key_signature?: BlobThe owner's signature over `shared_key` (spec §8.3). Absent only on vaults created before it existed, until a device si…
created_at: numberCreation time (Unix milliseconds).
updated_at: numberLast change of the metadata (Unix milliseconds).
deleted_at?: numberDeletion time; deleted vaults are purged after the retention period.

`GET /v1/vaults`.

Framework
serde
Shape
›{1 field }
vaults: Vault[]Vaults the caller is a member of (deleted ones excluded).

An item key wrapped with a project key (kind `0x03`), in the current row of an item or in one of its stored versions.

Framework
serde
Shape
›{3 fields }
item_id: ItemIdThe item.
version?: number`None` for the current row; the version for a stored one.
wrapped_key: BlobThe wrapped key.