Skip to content

Secret change requests

A protected App secret is changed only by a person's passkey. When the caller is a person acting as themselves, on a deployment with signing on, a call that would change one is staged as a change request instead of being applied. Otherwise (another kind of caller, or signing off) it is refused outright, with no request (see below). This page is the lookup for that surface. For the idea behind it, read Protected secrets.

Source and status

Everything below is read from hadron-server pull request #4177 as merged at e42bb189, and from the specs cor:sec:070:01 and cor:sec:070:02 (decided, unminted). File and line references are to that commit and can move. Nothing was run against a deployment. The released CLI (v0.55.0) predates this change. The portal and CLI surfaces for it are separate companion work and are not described here.

What changes are staged

Call Staged when
updateSecret(ref, metadata, value, protected) The secret is protected, or the call passes protected, true or false: staged, not applied (resolvers.secret.ts:417).
setSecretProtected(ref, protected) Always: turning protection on or off is staged (resolvers.secret.ts:239 to :241; SET_PROTECTED and CLEAR_PROTECTED).
deleteSecret(ref) The secret is protected: a delete is staged (resolvers.secret.ts:463).

Source: the three fields are in typeDefs.ts at lines 14282, 14284 and 14290; setSecretProtected resolves at resolvers.secret.ts:226. The operations a request records are STORE, DELETE, SET_PROTECTED and CLEAR_PROTECTED (changeRequests.ts:16). Creating a secret already protected is staged through updateSecret's protected argument per cor:sec:070:02 ("A protected create"); the exact call shape for a create was not read and is unverified.

Who may protect and unprotect: any App member who is a person protects (resolvers.secret.ts:234); only whoever manages the App unprotects (:235).

The refusal that carries the request

A staged change answers with the error code SECRET_PROTECTED_NEEDS_PASSKEY and the message "This secret changes only through your passkey ceremony." (changeRequests.ts:25 and :26). When a request was opened, the error's extensions also carry:

Extension Meaning
requestId The change request id.
ceremonyUrl A page on the server under /secret-changes/<requestId> (changeRequests.ts:15, :56).

A client hands the person the ceremonyUrl and never completes the passkey ceremony itself (cor:sec:070:02, "Only on the server's page"). The refusal never carries the value or ciphertext (per the code comment at changeRequests.ts:24 on needsPasskey; the function builds its error from the fixed message and extra only, :25 and :26).

A caller that is not a person acting as themselves (a worker-bound session, an App key, a run or an impersonated session) gets the same code with no requestId and nothing is staged (cor:sec:070:02, "Only a person, in person"; changeRequests.ts:37 and :38: :37 refuses when signing is off or the caller is an App key; :38 refuses a caller who is not a person acting as themselves; both use the same code).

Checking a request

secretChangeRequest(id: ID!): SecretChangeRequest (typeDefs.ts:10502) is for the requester only. It returns null for everyone else, and for a missing id (resolvers.secretChanges.ts:13 to :19).

SecretChangeRequest has five fields (typeDefs.ts:6431):

Field Meaning
id The change request id.
state "The effective state, with expiry judged on the server clock." (typeDefs.ts:6434)
operation The requested operation.
createdAt Creation time.
expiresAt Expiry time.

It never returns the value or the ciphertext. state is computed so that an open request past its time reads as expired even before the clearing job runs (changeRequests.ts:59).

States

The states that appear in the source at e42bb189, as lowercase strings (the state field is not an enum in the cited lines; its casing is read from changeRequests.ts:60):

State How it is reached
open A request was staged and has not ended (changeRequests.ts:33).
completed The person completed the ceremony (changeCeremony.ts:128).
expired Past its time, at completion (changeCeremony.ts:115), by the sweep (changeRequests.ts:64 to :66), or when read or withdrawn late.
stale The secret changed since the request was opened (changeCeremony.ts:119).
withdrawn The requester withdrew it (resolvers.secretChanges.ts:29).
declined Specified, not yet built. cor:sec:070:02 names it as a terminal state. At e42bb189 it exists only in the migration's state check (20261120180000_secret_change_requests, line 31); no code sets it and the ceremony page has no decline path (no code in the files cited here sets it). The follow-up is hadron-server#4703.

Withdrawing

withdrawSecretChangeRequest(id: ID!): Boolean! (typeDefs.ts:14286). Only the requester withdraws their own request. It returns true when it ended an open request and false when the request was no longer open (resolvers.secretChanges.ts:27 and :28). For a request that is not the caller's, it answers as a missing one (NOT_FOUND, :7). The staged value is cleared at withdrawal (typeDefs.ts:14285, "clear its staged value"). No manager can withdraw or override another person's request (cor:sec:070:02).

Completing, and what can refuse it

Completion happens only on the server's page, by the person who opened the request, with their own passkey (cor:sec:070:02). On completion the server re-checks the request, and these answers appear in the source. The list is the codes read, not a claim that it is complete; a person other than the requester is refused (changeCeremony.ts:54):

Code When
SECRET_CHANGE_REQUEST_EXPIRED The request is past its time (changeCeremony.ts:115).
SECRET_CHANGE_REQUEST_STALE The secret changed since the request opened (changeCeremony.ts:119).
PASSKEY_COOLING_OFF The passkey is a first passkey still in its cooling-off window, or no credential was found (changeCeremony.ts:120).

Expiry and limits

  • Expiry: 3600 seconds, one hour (changeRequests.ts:12, SECRET_CHANGE_TTL_SECONDS). A sweep clears expired requests' staged values every 60 seconds (sweepSecretChanges.ts:9 and :12). The spec calls this and the limit below "engineering bounds, not ruled values" (cor:sec:070:02), so they can change.
  • Open requests: at most 5 for one secret name in one App (changeRequests.ts:13, MAX_OPEN_SECRET_CHANGES; the count is over the App and the secret name, :40 to :43). The sixth is refused with SECRET_CHANGE_REQUEST_LIMIT, "Too many open secret changes." (changeRequests.ts:44).
  • Open requests: at most 2 from one requester on that secret (changeRequests.ts:14, MAX_OPEN_SECRET_CHANGES_PER_REQUESTER; counted inside the same query, :41 to :43). The third is refused with SECRET_CHANGE_REQUESTER_LIMIT, "Too many open secret changes for this requester." (changeRequests.ts:45). The aggregate limit is checked first. The spec records a ruling of 2026-11-20 for a per-requester cap "so one person cannot fill the secret's whole allowance" (cor:sec:070:02) and says its number and refusal code are not ruled, so treat 2 and this code as the server's current values. A request that expires, completes or is withdrawn frees its place.

On a deployment without signing

Passkey signing is a deployment switch (deploymentSchema.ts:7 and :24). When it is off:

  • setSecretProtected and withdrawSecretChangeRequest are removed from the schema, and so is the type SecretChangeRequest (deploymentSchema.ts:24 and :7). The query secretChangeRequest is declared to return that type, so it goes with it (inferred: a query cannot return a type the schema does not have; not a cited line).
  • A refused change on a protected secret carries no requestId, because the staging path throws the refusal before opening a request (changeRequests.ts:37).
  • A secret that was protected while signing was on is therefore frozen: storing and deleting it, and unprotecting it through updateSecret's protected argument (the only unprotect route left, since setSecretProtected is absent), all go through that path and are refused with no request (resolvers.secret.ts:417 to :421; a delete stages at :463). Read from the source, not run; how a secret comes to be protected on such a deployment is not described by the source.

Not described here: how a deployment turns signing on, and which signing state a given deployment is in.

Source and spec map

Claim Source at e42bb189 Spec
Refusal code, id and link changeRequests.ts:25, :26, :56 cor:sec:070:02
Requester-only reads resolvers.secretChanges.ts:13 to :19 cor:sec:070:02, "Reading a request"
Withdraw resolvers.secretChanges.ts:23 to :30 cor:sec:070:02
Who protects, who unprotects resolvers.secret.ts:234, :235 cor:sec:070:01
Expiry and the open limits changeRequests.ts:12 to :14, :44, :45 cor:sec:070:02 (bounds, not ruled)
Signing off deploymentSchema.ts:7, :24 none read