Nod: approvals for agents
Agents act for people. Most of what they do needs no one's attention, but some actions shouldn't happen on an agent's say-so alone: deleting a database, changing who can sign in, spending money. For those, a real person approves on their own device. That approval is a nod. Nod issues it, and the product's API checks it.
Design and reasons: design/nod.md. This page is how to use what's built.
The loop
- The API refuses a nod-level call with
403and a challenge naming the exact action:http WWW-Authenticate: Bearer error="insufficient_authorization", nod="https://auth.example.com/acme", authorization_details="<base64url of the JSON below>"json [{ "type": "urn:nod:action", "action": "flow.delete", "method": "DELETE", "resource": "workflows:flow:nightly", "summary": "Delete the flow nightly and every version of it", "locations": ["urn:workflows:api"], "org": "acct-…", "class": "delete" }] - The agent asks Nod with backchannel sign-in (CIBA), passing that action unchanged:
sh curl -u "$AGENT_ID:$AGENT_SECRET" https://auth.example.com/acme/bc-authorize \ -d scope=openid -d login_hint=ana --data-urlencode "authorization_details=$DETAILS"Nod checks the action before anyone is asked. There must be exactly oneurn:nod:action, withaction,resource,method(GET,POST,PUT,PATCHorDELETE), and asummaryof 1 to 200 printable characters, which is what the person reads.productandorg(strings),class(one ofdeploy,access,spend,delete,owners),locations(exactly one API) and aceilingobject may come too. Nod carriesceilinginto the approval and doesn't check it; the product does. The whole is at most 4 KiB. Anything else isinvalid_authorization_details. Discovery lists the type inauthorization_details_types_supported.login_hintis the person's username, verified email, orsub:<user id>. The last is for a server that holds only an agent's token (an MCP server): it asks for the person that token'ssubnames. An unknown person, a blocked one, or one with no verified email (who can't be told) isunknown_user_id. An agent (a client registered for a person) asks only for its own person: naming anyone else isaccess_denied.- A platform or a runtime asks for one of its agents with
agent=<the agent's client id>(see below). - The answer is
{"auth_req_id", "expires_in": 600, "interval": 5}: the request waits at most 10 minutes. CIBA's limits apply: three requests a minute and ten an hour per person, from all clients together (counted on each replica, not shared).
- A person decides. They get an email, and the approval page shows the summary, who asks and for whom. They approve with their own signed-in session, signed in within the last ten minutes (denying needs no fresh sign-in). Who else may decide is the org's policy (below). An agent can never decide.
- The agent polls
/tokenwithgrant_type=urn:openid:params:grant-type:ciba, gettingauthorization_pendinguntil someone decides, then the approval once, oraccess_denied, orexpired_token. The approval token:- carries
authorization_detailsexactly as approved; - has the action's
locationsAPI among its audiences (with the issuer); - lives 5 minutes;
- is bound to the agent's DPoP key when the poll has a proof (a
DPoPheader forPOST /token): it carriescnf.jkt,token_typeisDPoP, and kit-nod'sdpop_jktthen accepts it only with that key. The first poll with a proof pins its key: every later poll must prove the same key, or getsinvalid_dpop_proof; - has
subthe person asked (never the approver), andactthe agent when an agent asked or was asked for (see the chain); - says who approved, in
nod: {policy, approvers: [{sub, name}], delegation, approved_in?}.policyisself(the person asked),anyoneorroles;delegationis the delegation's id ornull.
- carries
- The agent retries with
Nod-Approval: <approval token>. The API checks it with kit-nod: issuer, audience, the same action, method and resource, the DPoP key if bound, and never used before (StoreSpentkeeps that across replicas).
What an approval is good for
An approval is for one call to one API, and nothing else:
- Single use. The API spends its
jti(kit-nod'sStoreSpent, or Nod's ownnod-spentfor its management API, shared across replicas). The same approval twice is refused; a refused approval isn't spent. - Five minutes. It expires 5 minutes after it's issued, whether used or not. The request itself waits 10 minutes for a decision.
- Never exchanged. Every token exchange at
/token(RFC 8693 on-behalf-of, a platform'sagent=, a runtime's) refuses it assubject_tokenwithinvalid_grant"an approval can't be exchanged", and every exchange refuses anactor_tokenanyway. - Never a person's own token.
/userinfo, the agents API,Nod-Person, the orgs API and the management API all refuse it (401). A nod never comes with a refresh token, even withoffline_access. - Introspection describes it, with its
authorization_details, and saysactive: falseonce Nod's own management API has spent it. Introspecting never spends it.
Waiting, an unreachable surface or an escalation never approves anything: an undecided request expires unapproved.
In Rust, the whole loop is a few calls:
// the API
if let Err(e) = kit_nod::verify_for_agent(&verifier, &approval, &action, caller_client_id, dpop_jkt, &spent).await {
return refuse(kit_nod::challenge_in(&issuer, &action, org, "delete"));
}
// the agent
let (nod, details) = kit_nod::parse_challenge(&www_authenticate).unwrap();
let asked = kit_nod::ask(&http, &nod, agent_id, agent_secret, "ana", &details).await?;
let approval = kit_nod::wait(&http, &nod, agent_id, agent_secret, &asked).await?;
Who may nod: the org's policy
A customer org (an account that owns realms; see design/orgs.md) first picks who decides:
| Who decides | What happens | Set it |
|---|---|---|
person (the default) | a person approves, as the policy below says | nod account nod-decider <org> person, or an owner's PUT /accounts/v1/orgs/{org}/nod-decider {"decider": "person"} |
auto | Nod approves at once: the same single-use token bound to the exact action (DPoP as usual), with nod: {"policy": "auto", "approvers": []} and acr urn:nod:auto; the security log records nod.auto_approved and the org's members (those named by address) get an email naming the action, the person and the client | … nod-decider <org> auto |
Under auto the agent is still capped at its person's role (below), for every policy, so someone outside the org gets nothing approved; every class is included, owners too. Switching back to person is the kill switch: the next request waits for a person again, and every automatic approval not yet collected is revoked in the same write (its poll answers access_denied, and switching back to auto doesn't bring it back). Both changes are owner-only and logged (org.nod_decider).
Owner domain. An org may require every owner to be a person with a verified address at one domain (nod account owner-domain <org> lunaor.com, or PUT …/owner-domain {"domain"}; empty turns it off). Then an owner is only ever email:<name>@<domain> (whose role counts once that address is verified at sign-in): never sub:-only, an agent, a machine client or another domain. It can't be set while an owner isn't at it, and the last owner stays, so the org always has one real owner there. Through the API the domain must be one of the org's verified domains (guide/accounts.md); the CLI may set it unverified, warning and logging that. Logged (org.owner_domain).
Under person, it picks one of two policies:
| Policy | Who decides | Set it |
|---|---|---|
anyone | any member of the org | nod account nod-policy <org> anyone, or an owner's PUT /accounts/v1/orgs/{org}/nod-policy |
roles (the default) | the person asked, a member holding the role the action's class needs, or a delegate | … nod-policy <org> roles |
Under roles, each class needs a role:
| Class | Role |
|---|---|
deploy | deployer |
access, spend | admin |
delete, owners | owner, and owners needs two different owners |
The policy applies when the action names an org (an account id), and then only for a member of it: asking for anyone else is access_denied, whatever the policy and whether or not the action names a class. An action naming no org, or under roles naming no class, can be decided only by the person asked. The PUT takes {"policy": "anyone" | "roles"} and answers {"id", "nod_policy"}.
The rules:
- The cap: under
roles(and always underauto), the person the agent acts for must hold the class's role, or the request is refused before anyone is asked. An admin's agent never gets an owner's action, however it's phrased. - Two owners for
ownersunderroles: each distinct owner's approval is kept, the same owner twice counts once, and the agent's poll staysauthorization_pendinguntil the second. A non-owner can't add to it; a denial by anyone who may decide ends it. The token lists both approvers. Underanyone, one approval is enough. - Membership is matched where an org's people can be told apart, read at each decision: in the accounts realm by subject (
sub:<id>) or an address verified there; in a realm the org itself owns (itsowner, as Lunaor ownslunaor) by an address verified there, since that realm's admin is the org. An action naming an org is asked only in those realms; in a realm owned by another account, or by none,bc-authorizeanswersaccess_deniedand nobody decides under the org's policy: that realm's admin can mark any address verified, so its verification proves nothing to the org. A SAML, OAuth 2.0, GitHub or LDAP connection naming one of this server's realms as its issuer is refused when it's made (connect to another realm here with OpenID Connect). - Only addresses people proved count. Even in the org's own realm, anyone holding
users:adminthere (an org admin, say) can mark an address verified, an owner's included, so for every org purpose (deciding, the cap, two owners, automatic approval, auto-join, delegations, invitations) an address counts only when the person proved it: an emailed link or code they completed, sign-up with an emailed code, or a connection asserting it for a domain the realm trusts that connection on (--verified-domain). One marked verified by an administrator (the management API'sverify-email,nod user verify-email, an import, a password-migration hook) stays verified for signing in and email, but holds no org role until the person proves it with the account page's link. Each user'semail_verified_bysays which (person,connection,admin); addresses verified before 2026-12-02 showunrecordedand still count.nod user verified-by-admin REALMlists the administrator-marked ones.
Escalation
If a request whose action names an org is still undecided after 5 minutes, each of the org's owners with an email: membership is emailed the same approval link (nod.escalated in the security log). An owner holds every class's role, so they may decide it under either policy. Escalation never decides anything, and the request still expires unapproved at 10 minutes. The due time is kept in the store, so any replica sends it, once, even after a restart.
Nods on Nod's own management API
Nod's management API asks for nods too, when it runs with serve --nod (see management-api.md): deleting an app, changing the realm's sign-up domains, a redirect on a new origin, and going past a standing ceiling. Who may approve those is checked at the API:
- in a realm an org owns, the approval must have been asked under the org's policy: the same
organdclassthe challenge named, so an agent can't drop the org to get "only the person asked"; - in a realm no org owns, every approver must hold the action's management API scope through their own roles (
clients:writeto delete an app,realm:adminfor sign-up domains), so a client can't name just anyone.
Standing ceilings
Some limits-level calls are free up to a ceiling, and a nod beyond it. One caller (the client, and the person it acts for) may admit 25 people a day from a waitlist and block 5 people an hour; counts are in the store, per realm, caller and window, shared by every replica. Past a ceiling, with serve --nod the call needs an approval of that one call (waitlist.admit_more or user.block_more, class access); without it the answer is 429 limit_reached with Retry-After until the window turns. Unblocking isn't counted.
Delegations
Someone whose role covers a class can lend part of it (a deployer deploy; an admin access and spend; an owner any class but owners):
curl -X POST -H "authorization: Bearer $CONSOLE_TOKEN" \
https://auth.example.com/accounts/v1/orgs/$ORG/delegations \
-d '{"to":"email:skye@example.com","class":"deploy","resource":"rankine:deploy:*","max":10,"expires_ms":…}'
The answer (201) is the delegation:
{ "id": "dlg-…", "from": "email:ruby@example.com", "to": "email:skye@example.com", "class": "deploy",
"resource": "rankine:deploy:*", "max": 10, "used": 0, "expires_ms": …, "revoked_ms": 0 }
toisemail:<address>(matched against an address the delegate proved, as for membership) orsub:<id>, inside the org or not. Asub:delegate is matched in the accounts realm only, where an org's ids are (as for its members); in a realm the org owns, name the delegate byemail:.- The resource is exact, or a prefix ending in
*(at most 300 characters). - A delegation has 1 to 1000 uses and ends within 30 days. An org has at most 200 live ones.
- Delegates can't delegate further (granting needs the role, not a delegation).
ownersis never delegated.- Each approval uses one.
- Its grantor or an owner revokes it (
DELETE …/delegations/{id}, 204). It stops at once. GET /accounts/v1/orgs/{org}lists them, used, revoked and expired ones included until 90 days past their end.- Grants and revocations are in the accounts realm's security log (
org.delegation.granted,org.delegation.revoked). - The approval token names the delegation, so the product can log "approved by Skye under Ruby's delegation".
Agents
An agent limited to scopes (a key for one thing)
POST <issuer>/agents {"name": "shop writer", "scopes": {"<API>": ["db:shop:write"]}} makes an agent whose tokens carry only those scopes, only on those APIs, and only while its person holds them (checked at each token). Each scope must be one the API defines and the person holds when it's made. GET <issuer>/agents lists each agent's scopes. It's how a product offers keys for one of its resources (TwilightDB's Keys). The product's server exchanges the signed-in person's token (RFC 8693) for the agents API, <issuer>/agents with agents:write, and calls these routes with it. Its client must be allowed that exchange and granted agents:write there, on the person's behalf only. A product sees and removes only the agents it made; the person sees all of theirs. The person's own token works too, as before.
A person registers an agent for themselves:
nod agent register --issuer https://auth.example.com/acme --client <a public client> --name Otto
The person approves the device sign-in with their own account. That's their consent. The agent's client id and secret go to a mode-600 file (~/.config/nod/agent-<name>.json, or --out), and aren't shown again.
Over HTTP, with the person's own access token (not an agent's, a machine's, a DPoP-bound one or an approval):
| Call | Answer |
|---|---|
POST <issuer>/agents {"name"} | 201 {client_id, client_secret, name, platform, token_endpoint, backchannel_authentication_endpoint}; the secret is shown this once. At most 20 per person |
GET <issuer>/agents | {"agents": [{client_id, name, created_ms, platform}]}: the person's own |
DELETE <issuer>/agents/{id} | 204; someone else's agent, or none, is 404. Its grant is revoked and its client goes |
Registering and removing are in the security log (agent.registered, agent.removed). An agent is a confidential client with CIBA on.
An agent's client_credentials token for an API acts for its person: sub is the person, act.sub the agent, and it carries only scopes the person holds there. It asks its person for nods with CIBA, as above. Blocking the person, or removing the agent, stops it at its next token.
In-app nods: platforms and surfaces
A nod should reach the person where the asking agent lives (design §13). An app whose agents run inside it (Nelm) is a platform, and the frame where it shows its people nods is its surface.
Make a platform (the realm's own confidential app that signs people in):
nod client platform acme nelm on --notify https://nelm.example/harpora/nods # prints the surface secret once
nod client ciba acme nelm on # only if it will ask for nods on its agents' behalf
Or PUT /api/v1/clients/nelm/platform {"platform": true, "surface_notify": "https://…"} with clients:write.
Calling as the platform, for a person: the platform's own client authentication (HTTP Basic, or its certificate), plus the person's own access token in the Nod-Person header. That token must have been issued to the platform, for this realm (the issuer among its audiences), and be live: no act, no cnf, not revoked, its grant standing, the person not blocked. An agent's token is refused with 401.
- Register an agent:
POST <issuer>/agents {"name"}called that way. The agent is the platform's ("platform": "nelm"in the answer and in the person'sGET /agents), and the person can still remove it. - Mint its token at
/token, as the platform:grant_type=urn:ietf:params:oauth:grant-type:token-exchange,subject_token=<the person's token>,subject_token_type=urn:ietf:params:oauth:token-type:access_token,agent=<the agent's client id>,resource=<API>,scopeoptional. Nod names the agent withagent=, not RFC 8693'sactor_token: the agent needs no token of its own, and the platform's authentication is the proof. The token hassubthe person,client_idthe platform,act: {"sub": <agent>, "platform": <platform>},gidthe agent's grant, scopes the person holds there, and never outlives the subject token. It's refused (invalid_grant) for another platform's agent, an agent with no platform, a client that isn't an agent, another person's agent, a removed agent or a blocked person. - Ask for a nod: the agent calls
bc-authorizewith its own credentials as any agent does, or the platform calls it withagent=<the agent's client id>. Either way the request is the agent's.
The surface is told. Nod POSTs to surface_notify:
{ "auth_req_id": "…", "user_code": "BCDF-GHJK", "summary": "Deploy shop v42 to production",
"agent": "agent-…", "person": "<the person's id>", "expires_at": 1764600000 }
signed as hooks are: Nod-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>" with the surface secret>. It's https to a public address only, five seconds, no redirects.
The phone is the fallback, after 60 seconds. The person isn't emailed when the surface is told. If nobody has decided the nod in the surface 60 seconds later, they get the email with the approval link then (once, however many servers run). Decided in the surface in time, there is no email. The surface may still decide after the email went. Failing to reach the surface (logged as nod.surface_failed) decides nothing, and the email follows the same 60 seconds later. A nod the surface may not approve (see below) isn't posted to it and is emailed at once.
The surface decides. When the person clicks, the platform calls POST <issuer>/nod/decide {"auth_req_id", "approve": true|false} authenticated as above. Nod checks:
- the request is from one of this platform's agents, still registered (else 403);
- the person may decide it, exactly as on the approval page: the person asked, or as their org's policy allows;
- to approve, the person signed in within the last ten minutes, as on the approval page: the
auth_timeof the token inNod-Person(a refresh keeps the original sign-in's). Otherwise 403login_required: sign them in again (prompt=loginormax_age) and retry. Declining needs no recent sign-in; - the class may be decided in a surface:
deployandaccessalways;spendanddeleteonly if the action's org allows them (nod account surface-classes <acct> spend,delete; default none);ownersnever. A refused class, or an action naming no class, is 403access_denied, "use your phone": such a nod isn't posted to the surface at all and goes to the phone and email at once. Name a class on every action.
The answer is {"approved": true|false}. The approval token carries nod.approved_in: "<platform>" besides the approvers and policy, so a product can log "approved by Ruby in Nelm".
Announce an org's nods to a Sendack topic. An org's owner may name a Sendack topic, and Nod publishes there each nod for the org and each automatic approval's notice:
curl -X PUT $ISSUER/accounts/v1/orgs/$ORG/nod-topic -H "Authorization: Bearer $OWNER_TOKEN" \
-d '{"topic": "nod.'$ORG'.deploys"}' # {"topic": ""} stops it
The topic is nod.<org id>.<name> (the name: letters, digits, -, _), so an org only writes in its own part of Sendack's topics; it's logged org.nod_topic, and GET of the org shows nod_topic. The message:
{ "type": "nod.requested", "action": "Deploy shop v42 to production", "person": "alice", "agent": "agent-…",
"client": "Otto", "link": "https://…/device?user_code=BCDF-GHJK", "expires_at": 1764600000 }
type is nod.auto_approved for an automatic approval, with link and expires_at null. The message never carries a token, and the link only works for someone signed in who may decide the nod. Failing to publish is logged (nod.sendack_failed) and changes nothing else. The server must have Sendack set up (409 otherwise).
Runtimes: a platform hands its agents to SocketLLM
A platform may run its agents on a runtime (design §14): SocketLLM drives the agent (model calls, tools), while the platform keeps the agents, the people's consents and the approvals.
Delegate (with clients:write, or the CLI; it replaces what the runtime had, and every grant and revocation is in the security log as runtime.granted and runtime.revoked):
nod client runtime acme nelm socketllm --resource urn:db --scope db:read --scope 'deploy:dcx:*'
nod client runtime acme nelm socketllm --remove
PUT /api/v1/clients/nelm/runtimes/socketllm {"scopes": ["db:read"], "resources": ["urn:db"]}
→ {"platform": "nelm", "runtime": "socketllm", "scopes": […], "resources": […], "created_ms": …}
DELETE /api/v1/clients/nelm/runtimes/socketllm → 204 (404 if there was none)
The platform's GET /api/v1/clients/nelm lists its delegations under runtimes. A runtime is a confidential client of the realm, never a platform (it has no surface) and never an agent. Each API must be the realm's, and each scope one of theirs or a pattern over them (* segments, as in roles). Turning the platform off ends its delegations. A runtime client deleted and registered again under the same id isn't the one that was delegated to.
Mint an agent's token, as the runtime. The platform passes on the person's own token (the one issued to the platform). The runtime exchanges it at /token with its own client authentication:
grant_type=urn:ietf:params:oauth:grant-type:token-exchange
subject_token=<the person's token, issued to the platform>
subject_token_type=urn:ietf:params:oauth:token-type:access_token
agent=<the platform's agent> resource=<API> scope=<optional>
It's refused unless all of these hold:
- the subject token was issued to a platform and is live (
invalid_grant); - that platform has a live delegation to this runtime (
unauthorized_client); - the person's grant with the platform stands, and the person isn't blocked (
invalid_grant); - the agent is the platform's, for that person, still registered (
invalid_grant); - the API is in the delegation (
invalid_target); - each scope asked for is held by the person and covered by the delegation (
invalid_scope). With noscope, the token gets what both allow.
The token:
{ "sub": "<person>", "client_id": "socketllm", "aud": "urn:db", "scope": "db:read", "gid": "<the agent's grant>",
"act": { "sub": "agent-…", "platform": "nelm", "act": { "sub": "socketllm" } } }
Read act from the outside in: SocketLLM, acting as Nelm's agent, for the person. It lives at most five minutes (and never past the subject token), so the runtime asks again for the next. Each mint is in the security log as runtime.minted (the person, the runtime, the platform, the agent, the API and the scopes). Revoking the delegation, removing the agent, the person signing out of the platform or being blocked: the next exchange fails.
Nods stay the platform's. The runtime may ask for a nod with bc-authorize and agent=<the platform's agent> (with CIBA on for the runtime's client; an action naming an API in locations must name one the delegation covers). It polls for the answer, but the request is the agent's: the platform's surface is told, and only the platform decides it. The runtime calling /nod/decide is refused (403), whatever person's token it presents. The agent's own nods go to the platform's surface as before.
The approval says who acted. An approval asked by an agent, or for one, carries the chain in act, outermost first, from what was recorded when it was asked: {"sub": <agent>} for an agent of its own, {"sub": <agent>, "platform": <platform>} for a platform's agent (whether it or its platform asked), and {"sub": <agent>, "platform": <platform>, "act": {"sub": <runtime>}} when a runtime asked. client_id stays the client that asked (and polls). A plain CIBA client's approval has no act. kit-nod's Approval.chain reads it, for a log line like "flow.delete by agent-otto via socketllm for nelm, approved by ruby". An approval is never a management token, act or not (401).
The Nod app on your phone
Nod's pages include an installable web app (a PWA) at /nod on a realm's host (https://auth.example.com/nod/; under /<realm>/nod/ where a realm has no host of its own). Open it on a phone, sign in, and add it to the Home Screen (Chrome and Edge offer "Install Nod"; on an iPhone use Share, then Add to Home Screen). It shows:
- Waiting for you: the nods asked of you, newest first, each with the action, who asks and how long is left, and Recent: what happened to the last ones (approved, denied or expired, and by whom).
- One nod: the action's summary, who asks (the agent and its platform, and a runtime driving it), the org and the class, the action and resource, and when it expires.
- Approve with passkey: your device asks for your passkey (fingerprint, face or PIN) right then. The server made that challenge for you and for this request only, so an assertion from earlier, for another request, from someone else's passkey, or without user verification is refused (
access_denied), and each is spent by trying. Your session's age doesn't matter: the assertion is the fresh proof. If you have no passkey, the app says so (add one in your account page). - Deny: one tap, no passkey (as on the approval page).
- Who may decide is unchanged: the person asked, or someone the org's policy lets (they open the request's link, and see it in the app only by that link: the list is the person asked's). An agent can never decide.
Push. On the app's page, "Turn on notifications" asks the browser's permission and subscribes it. From then on, when a nod is asked of you, you get a push that names the agent and the action ("Otto needs your nod: Delete the flow nightly") and opens that nod in the app. The email still goes, so a phone with push off, a blocked permission or no push service still gets the link. The push carries the action's summary and the request's code, never a token (nor the request's auth_req_id, which polls for one): approving needs you, signed in, and your passkey. Your notification preferences in Sendack apply (push off, quiet hours); you can turn it off per device in the app. It's offered only where an operator has set it up (operating.md).
Native push (the iOS and Android app). A native Nod app gets the same pushes by Apple's (APNs) or Google's (FCM) push service, beside any browser you turned on. Signed in, the app registers its device: POST /<realm>/nod/app/devices with {"platform": "apns" | "fcm", "token": <the APNs device token or FCM registration token>, "app": <its bundle id or package>, "environment": "production" | "sandbox"} (sandbox is for an iOS development build; FCM has only production). GET lists your devices (never their tokens) and what this server offers (available.apns with the bundle ids it accepts, available.fcm, or null where not set up); DELETE {"id"} removes one. As with browsers: at most 20 devices, the session (or the app's token, below) as the rest of the app, and a device whose token Apple or Google says is no longer valid is removed by itself. A phone's token belongs to whoever registered it last, so a handed-over phone stops getting its old owner's pushes. The notification carries the same title, body and request code as the Web Push one, never a token; the app opens the request with your own session or token, and approving still takes your passkey. A device on its own is enough for "Use the Nod app on my phone instead" at sign-in.
The native app signs in with OAuth. A native app has no browser cookie: it signs the person in with Nod's own sign-in and calls the app's routes with an access token instead. It is registered in the realm as a public client of the realm's own (first-party: not --third-party, not self-registered), with a redirect it can catch: a private-use scheme (com.example.nod:/oauth, RFC 8252 §7.1) or, better, a claimed https link (an iOS universal link or an Android app link, https://nod.example.com/app/oauth; at a custom scheme the person confirms every sign-in, since another app could claim the scheme). It signs in by the authorization code flow with PKCE S256 (required of a public client; plain is refused) in the system browser (ASWebAuthenticationSession, Custom Tabs), asking for resource=<issuer>/nod-app at both the authorization and the token endpoint (RFC 8707: the token is then for the Nod app's API alone) and the scopes it needs:
| Scope | Routes |
|---|---|
nod-app:read | GET requests, GET request?code= |
nod-app:decide | POST approve/start, approve/finish, deny, and signin/approve/start, signin/approve/finish, signin/deny |
nod-app:devices | GET, POST, DELETE devices |
Every person of the realm holds these scopes without a role (they reach only their own nods and devices, as their session does). The app sends Authorization: Bearer <token> (or DPoP <token> with its DPoP proof, for a token bound to the app's key), no cookie and no Origin. Nod checks the token as the accounts API checks a person's: this realm's issuer, aud exactly <issuer>/nod-app (a token for the issuer too, or another API, is refused), typ at+jwt, EdDSA; not revoked (the token, or the grant: signing the app out), not an approval, no act (an agent's token for the person isn't the person); the person not blocked; issued to a first-party app still there; and the route's scope (403 insufficient_scope naming it). A bound token needs its proof for that method and URL. A request with an Authorization header is judged by its token alone, whatever cookie comes with it. A token never approves on its own: approve/finish still takes the fresh, user-verified passkey assertion made for that one request by approve/start, as in the web app. The passkey is the realm's (its RP ID is the realm's host): an iOS app uses it through its associated domain (webcredentials:); an Android app's own origin (android:apk-key-hash:…) isn't accepted yet, so an Android app approves through the passkey in the system browser's page until it is. push (a browser's Web Push subscription) stays session-only: a native app registers its device instead.
Approving a sign-in. With push on, signing in somewhere with your password can use your phone as the second step instead of a code: the sign-in page offers "Use the Nod app on my phone instead", shows a number, and your phone gets a push ("Signing in to Acme?"). The app shows where and what is signing in and three numbers: pick the one the sign-in page shows, then use your passkey, and the other device is signed in (acr urn:harpora:password-push). The wrong number refuses the sign-in at once, and "It isn't me: deny" refuses it with one tap (the security log records mfa.push_denied: someone has your password, so change it). A tap alone approves nothing, the push carries no number and no token, and one sign-in sends one push, at most five per quarter hour (number matching, as CISA advises against push fatigue). The emailed code or authenticator app (or a texted code, where the realm offers SMS) still works beside it.
Offline. The service worker caches the app's own files and a plain offline page, never a nod, an answer from Nod or a token. Offline you see "You're offline"; nothing is approved without a connection.
The app's server side is under /<realm>/nod/app/… (cookie session and same-origin, or a native app's token as above; never cached): GET requests, GET request?code=, POST approve/start then approve/finish ({code, ceremony_id, credential}), POST deny, and GET, POST, DELETE push (the browser's subscription), and GET, POST, DELETE devices (a native app's). A decision is recorded as nod.decided, and a refused assertion as nod.approval_refused, in the security log; a push that couldn't be sent as nod.push_failed (mfa.push_failed for a sign-in), a device added as nod.push_device_added, and one removed because its platform said it's gone as nod.push_device_removed.
Token vault: your agents use your other accounts
An agent often needs one of the person's accounts elsewhere: their Google mail, their GitHub repositories. The token vault keeps that account's tokens at Nod, and gives the person's agents a fresh access token for it when they ask, within the scopes the person chose, and with the person's own nod for the scopes the realm marks sensitive. The agent never holds the refresh token, and never a password. (Auth0 calls this Token Vault; we learned from its shape.)
1. The realm offers a connection for agents. Any OpenID Connect, OAuth 2.0 or GitHub connection the realm already has (see sign-in.md); an administrator lists the provider scopes people may grant their agents, and which of them need a nod:
nod connection vault acme google --scope https://www.googleapis.com/auth/gmail.readonly \
--scope https://www.googleapis.com/auth/gmail.send --sensitive https://www.googleapis.com/auth/gmail.send
or PATCH /api/v1/connections/google {"vault_scopes": [...], "vault_sensitive": [...]} (connections:write), or vault_scopes and vault_sensitive in nod config apply. No scopes: the connection isn't offered for agents (and agents get nothing from accounts already connected through it until it is again). The provider app must allow those scopes, and its redirect URI is the same <issuer>/federation/callback sign-in uses.
2. The person connects their account on their account page ("Accounts for your agents"): they tick the scopes and which of their agents may use it (some of them by name, or "All your agents"), go to the provider, and agree there. Nod asks for those scopes only (with openid and offline_access for OpenID Connect, so it learns whose account it is and gets a refresh token; Google with access_type=offline instead, as it requires), with prompt=consent, PKCE and a flow bound to this browser and to the person, signed in (within ten minutes, as any account change). It keeps what the provider granted of what was asked (its scope answer; never more), and the tokens, sealed under the server's secret key (NOD_SECRET_KEY), each bound to the person, the connection and which token it is: a copy of the database gives nothing, and a sealed token moved onto someone else's record doesn't open. Connecting again replaces the old tokens and revokes them. The person is emailed, as for any change to how their account is reached, and the security log says vault.connected with the scopes.
Over HTTP, from the page (same origin, a recent sign-in): POST <issuer>/account/vault/connect/<connection> {"scopes": [...], "agents": [<client id>, ...] | ["*"]} → {"redirect"} (an agent that isn't theirs, or none, is refused; "label": "work" connects a further account at the same connection beside the first, which is default); POST <issuer>/account/vault/agents {"connection", "agents", "label"?} changes which agents, at once; disconnect takes label too; POST <issuer>/account/vault/disconnect {"connection"} → {"disconnected": true, "revoked": true|false}. The page's JSON has vault (connected accounts: connection, name, scopes, sensitive, account at the provider, connected_ms, last_used_ms, last_agent, agents, all_agents), vault_offered, and agents (their agents, to choose from). An account connected before agents were chosen (before 3 Dec 2026) is all their agents' until they choose.
3. An agent exchanges its own token (RFC 8693) at /token:
curl -u "$AGENT_ID:$AGENT_SECRET" https://auth.example.com/acme/token \
-d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
-d subject_token="$AGENT_TOKEN" -d subject_token_type=urn:ietf:params:oauth:token-type:access_token \
-d requested_token_type=urn:nod:token-type:connection:google \
-d scope=https://www.googleapis.com/auth/gmail.readonly
{ "access_token": "<Google's access token>", "issued_token_type": "urn:nod:token-type:connection:google",
"token_type": "Bearer", "expires_in": 3599, "scope": "https://www.googleapis.com/auth/gmail.readonly" }
requested_token_type is **urn:nod:token-type:connection:<connection id>, or …:<connection id>:<label>** for one of the person's further accounts there (…:github:work): each account has its own tokens, agents and nods (a sensitive scope's resource names it: connection:github~work:…). subject_token is the agent's own access token from this realm (any of its APIs, or the issuer), issued to the client that now authenticates, with sub the person and the agent in act. The chain must hold now:
| Who authenticates | act in the subject token | Also checked |
|---|---|---|
| the agent | {sub: <agent>} | the agent is registered for that person, with no platform |
| its platform | {sub: <agent>, platform: <platform>} | the agent is the platform's, for that person |
| a runtime | {sub: <agent>, platform: <platform>, act: {sub: <runtime>}} | the platform still delegates to the runtime |
and always: the token is live (not revoked, its agent's grant standing, the person not blocked), it isn't an approval, and a DPoP- or certificate-bound one comes with that proof. A person's own token (no act), a service's on-behalf-of token, another client's token or another person's agent: invalid_grant. The agent never names the person: they are its token's sub, so no agent can reach anyone else's accounts.
Then, in order:
- the connection is enabled and still offers the scopes (
invalid_target,invalid_scope); - the person connected that account and lets this agent use it (
invalid_grantotherwise: the agent in the chain, by client id, is one they chose, or they chose all), and every scope asked is among those they granted: **narrower is fine, wider isinvalid_scope**. Noscope: everything granted; - sensitive scopes need the person's own nod (below);
- Nod returns the provider's access token: the one it holds if it has more than a minute left, else a fresh one by refresh (one replica at a time; a rotated refresh token is kept). A narrower set is asked of the provider by a refresh with
scope(RFC 6749 §6); a provider answering with scopes beyond those asked is refused (invalid_grant), never passed on. Without a refresh token (GitHub's OAuth apps) the token is all of the grant, andscopesays so, and a sensitive scope in it needs the nod even when not asked for. A refresh token the provider no longer honours isinvalid_grant"connect the account again".
Never the refresh token, whatever is asked. Each exchange is in the security log as vault.exchanged (the person, the client, the agent's chain, the connection, the scopes, and who nodded): never a token.
The provider's ID token (an OpenID Connect connection only): ask for requested_token_type=urn:nod:token-type:connection-id-token:<connection id> (or …:<connection id>:<label>), with **no scope**: an ID token says who the account is and gives no access, so a scope with it is invalid_scope and it never needs a nod. The chain and the person's choice of agents are checked as above. The answer is RFC 8693's for an ID token:
{ "access_token": "<the provider's ID token>", "issued_token_type": "urn:ietf:params:oauth:token-type:id_token",
"token_type": "N_A", "expires_in": 3540 }
Nod keeps the one from connecting while it has more than a minute left; after that it refreshes the whole grant and checks the new ID token like a sign-in's (signature, issuer, audience, expiry; not the nonce, which OpenID Connect leaves out of refreshes) and that its sub is still the account's. A provider that sends none back, or another account's, is invalid_grant, never handed over. Use it where a partner of the provider wants the provider's word on who the person is; for calling the provider's APIs, use the access token.
Sensitive scopes need the person's nod. When the token would carry a scope the connection marks sensitive, the answer is the same kit-nod challenge as any API's: 403 insufficient_authorization with WWW-Authenticate: Bearer error="insufficient_authorization", nod="<issuer>", authorization_details="…", for this action:
[{ "type": "urn:nod:action", "action": "connection.token", "method": "POST",
"resource": "connection:google:https://www.googleapis.com/auth/gmail.send",
"summary": "Otto wants your Google account: https://www.googleapis.com/auth/gmail.send", "product": "nod" }]
The agent asks for it with bc-authorize as in the loop (login_hint=sub:<its token's sub>), and sends the approval back on the same exchange in Nod-Approval. It's always the person's own nod: the account is theirs, not the org's, so the action names no org and no class, and no org policy applies, in any realm: not roles (no admin is needed), not anyone (no other member may approve it), not automatic (an automatic org never approves use of someone's personal account), and no delegation. It's asked of the person whose account it is, and only they can approve it (the approval's nod.policy is self, with them as its one approver); an approval asked under an org's policy, naming an org or a class, is refused even for the same resource. The approval must name this exact resource (the sensitive scopes, sorted), the same person (sub) and the same agent (act.sub); it's good once (nod-spent), and if bound (cnf), only with that key. Scopes that aren't sensitive need no nod, so an agent asking for a narrower, harmless set doesn't bother the person. The resource holds at most 300 characters: ask for fewer sensitive scopes at once past that.
Disconnect. The person's page, or an administrator (DELETE /api/v1/users/{id}/connected-accounts/{connection}, users:write, or the console). The account is deleted at once (no agent gets its token again), then its tokens are revoked at the provider: RFC 7009 at the connection's revocation_endpoint (OpenID Connect reads it from discovery; give an OAuth 2.0 connection one with revocation_endpoint), or GitHub's grant API. The answer and the log (vault.disconnected) say whether the provider confirmed. Deleting the person, or the connection, disconnects every account it held, the same way.
The console. GET /api/v1/connected-accounts (realm-wide, at most 1000) and GET /api/v1/users/{id}/connected-accounts (users:read) list connected accounts with their scopes, which are sensitive, and the last agent use (time and chain), never a token. Over MCP: connected_accounts_list (free) and connected_account_disconnect (limits); the realm view (view_realm) lists them, and, as every view, changes nothing itself: Disconnect is that tool, at its level.
An MCP server
An MCP server that signs people in through its own authorization server (Linear's, Sentry's, a company's own) is a connection of kind mcp. Give only the server's URL; Nod finds the rest, as an MCP client does:
nod connection add-mcp acme tracker --resource https://mcp.tracker.example/mcp --public-url https://auth.example.com \
--name Tracker
or POST /api/v1/connections {"id": "tracker", "kind": "mcp", "name": "Tracker", "resource": "https://mcp.tracker.example/mcp"} (connections:write).
- Found: the server's protected resource metadata (RFC 9728, path-inserted first), which must name the URL as its
resourceand an authorization server; then that server's metadata (RFC 8414, else OpenID Connect discovery), which must name the same issuer and PKCE withS256(MCP requires it). Every address is https and public, as for any connection. - Its client id, without registering: where the authorization server takes client ID metadata documents (
client_id_metadata_document_supported, MCP 2025-11-25's preferred way), Nod's client id there is the realm's document,<issuer>/federation/client.json: a public client (PKCE), its one redirect URI the realm's callback. Nothing is registered. Only an https Nod can (the server fetches the document). - Registered: otherwise, without
client_idNod registers itself there (RFC 7591) as "Nod: <name>", with the realm's own<issuer>/federation/callbackas its one redirect URI, confidential where the server allows (client_secret_basic, elseclient_secret_post) and public otherwise (PKCE alone;token_authis thennone). The secret it gets is sealed at rest like any connection's. A server that doesn't register clients needs one registered by hand:--client-id(its secret on stdin, or--token-auth nonefor a public one). - Offered to agents at once: the scopes given, or the server's
scopes_supported, are itsvault_scopes(change them as for any connection). A server that names none, with none given, offers its default access: one marker scope,(default), that people grant and agents get as any scope, but that is never sent to the server (registration and authorization carry noscope, as MCP says to do then). Whatever the server says it granted is that access. The marker is an MCP connection's alone, never beside another scope, and can be marked sensitive like any. - For agents' accounts only: it is never on the sign-in page, a request naming it gets the page as without it, and a sign-in or link through it is refused. People connect it on their account page, as any vault connection.
- Its tokens are for that server alone: every authorization and token request (code, refresh) carries
resource=<the server's URL>(RFC 8707). MCP has no userinfo, so the account page names the account by the server's host. Disconnecting revokes at the server's revocation endpoint when it has one. - Configuration as code exports
kind: mcpwithresource, the registeredclient_idandtoken_auth; applying the file adds it with that client, never registering again.
SocketLLM then reaches the server as the person (its registry's {"vault": {"connection": "tracker"}}), through the resource-server path below.
A resource server asks for the person
An MCP gateway (SocketLLM) receives a person's access token from their MCP client (Claude, ChatGPT): issued to that client, for the gateway's API, with no act. To call a third-party MCP server as that person it needs their connected account's token. That is the resource-server path, deliberately narrow:
- An administrator names the API's resource server, one confidential client of the realm's own (never an agent, a platform, a third-party app, one registered by its developer or known by a metadata document):
nod api set acme https://mcp.example.com --resource-server socketllm, orPATCH /api/v1/apis/{api} {"resource_server": "socketllm"}(apis:write;""for none). It's never inferred from grants or introspection rights. A client deleted and registered again under that id must be named again. In configuration as code it's the API'sresource_server(nod config exportwrites it,nod config applysets it after registering the file's clients, and an empty one clears it); a file naming a client that isn't there or can't be one (public, an agent, a platform, someone else's app) is refused, with the reason, before anything changes. - The person names the app on their account page, beside the agents for that account ("Apps that may use it through their service"):
POST <issuer>/account/vault/apps {"connection", "label"?, "apps": [{"client_id", "scopes"}]}replaces the list (vault.appsin the security log). Only apps they signed in to, never an agent, never "all", each with its own scopes among those granted on the account, and never a sensitive scope (that needs a nod each time, which only an agent can ask). Connecting the account again clears the list. Both account pages offer it, Nod's own and the React app's (ui/app): a tick-box per app and scope, saved to the same endpoint. - The gateway exchanges the person's token exactly as an agent does (above), authenticating as itself (its secret, or
private_key_jwt, as it's registered), withsubject_tokenthe person's token as it came to the door.
The subject token must be a live at+jwt of this realm whose aud is exactly the API the client is the resource server of (["<api>"]: the MCP client names it as resource at the token endpoint too, RFC 8707; a token for the issuer, for another API, or for the API and the issuer is refused), not revoked (its grant standing, issued to a client still there), not an approval, not bound to a key (cnf), not on anyone's behalf (act: an agent's token goes the agent's way), for a person who isn't blocked. Then the person must have named the token's own app (client_id) on that account: consent given to ChatGPT is not consent for Claude, and "All your agents" covers no app. Without it: invalid_grant "the person hasn't let Claude use their Mail account: they can on their account page, under Accounts for your agents (<issuer>/account)". The token carries only what the person granted that app: no scope gives all of it, a wider scope is invalid_scope, a sensitive scope is invalid_scope, and an account Nod can't narrow (no refresh token) is refused unless the app was granted all of it. ID tokens aren't given on this path. Every exchange, answered or refused, is in the security log (vault.exchanged or vault.refused: the person, the resource server as the client, "claude via socketllm for mail" and the scopes or the reason), never a token.
Watching a request
GET <issuer>/api/v1/nods/{auth_req_id} (management API, users:read) shows one request: kind (nod or sign_in), state (pending, approved, denied, expired), collected, summary, action, who asks (client, agent, platform) for whom (for), decided_by, approvals (both owners' for owners), policy and approved_in. Never its user code or a way to decide it; another realm's request is 404. The MCP tool view_nod shows the same as a screen, which never has Approve or Decline.
MCP
Each realm serves its management API as MCP tools at <issuer>/mcp: free tools read, limits tools change things within the API's rules, and the nod tools (client_delete, realm_set_signup_domains, plan_delete) take an approval argument, sent as Nod-Approval. A refused call's error carries the challenge as JSON on its last line. MCP checks nothing itself: the API does. See management-api.md, and mcp.md for how assistants sign in.