nomos/API Reference
Runtime API

NOMOS Runtime API

Ask a sealed policy whether an action is allowed, from your code. Every answer is deterministic, names the rule that decided it with its source, and comes with a signed record anyone can check offline.

Quick start

Ask a published authority whether an action is allowed. POST /api/v1/can (the SDK's nomos.can()) answers anyone: no account, no API key.

1

Pick an authority

Any authority listed on the Exchange, by its name: eu-ai-act, for example.

2

Send the facts

POST /api/v1/can with "artifact" and the facts of the action, as fields.

3

Read the verdict

AUTHORIZED, DENIED or ESCALATED, the rule that decided with its source, the facts that could still change it, and a signed record of the answer.

bash
# Ask a published authority whether an action is allowed. No account, no API key.
# While you're experimenting, add -H "X-Nomos-Purpose: test" — your answer is still
# sealed and signed, but stays out of the authority's public history and counts.
curl -X POST https://api.nomosprotocol.com/api/v1/can \
  -H "Content-Type: application/json" \
  -d '{
    "artifact": "eu-ai-act",
    "untargeted_facial_image_scraping": true
  }'

# → 200 OK (abridged)
{
  "verdict": "DENIED",
  "matched_rule_id": "art5_1_e_facial_scraping",
  "matched_rule_name": "Creating or expanding facial recognition databases through untargeted scraping of facial images from the internet or CCTV footage is prohibited.",
  "reason": "Rule ... triggered. The authority denies this action. A higher-priority exception may still apply — answer: exclusively_military_defence_national_security, ...",
  "query_id": "qry_38b2a4e2c179c6833936",
  "url": "https://www.nomosprotocol.com/queries/qry_38b2a4e2c179c6833936"
}

Ask by context: which laws apply

Instead of naming a law, describe the act. NOMOS works out which laws govern it, asks every one, and combines their answers: any deny denies, and a yes needs every law to say yes. The agent does not choose the law, so it cannot leave out the one that would have said no.

The facts that decide which law applies

jurisdictionWhere the act takes effect: EU, QA, AE (the UAE outside free zones with their own data law), DIFC, ADGM, QFC, US, ...
established_inWhere the acting organisation is incorporated or established (EU for an EU member state).
subjects_inWhere the people the act concerns are located or resident.
output_used_inWhere any AI system output is used.

What comes back

A verdict under every law that applies

answered_under names them; each law's own answer is a signed record in members.

A request for a missing fact

INSUFFICIENT_DATA with open_facts. A fact you did not state is asked for, never assumed.

Not covered

For a place the registrar does not list (Saudi Arabia, the US, an ADGM or QFC firm today). Never "no law applies".

CONFLICT

Two registrars each claim exclusive precedence. A person decides; the machine does not rank sovereigns.

Which laws apply where comes from the NOMOS registrar: a signed, append-only list in the public log at /.well-known/nomos-exchange-log, which anyone can verify offline. Each claim states the provision it rests on. Today it covers the EU AI Act, Qatar Law No. 13 of 2016, UAE Federal Decree-Law No. 45 of 2021, DIFC Law No. 5 of 2020, the ADGM Data Protection Regulations 2021 and the Saudi Personal Data Protection Law. A yes is never given from silence: if no listed law applies, the answer is not a permission, and every answer says the registrar lists only its own laws, so other law may also apply.

The system that commits a change resolves too: accept({ resolution }) in @nomosprotocol/sdk 2.7.0 pins registrars (registrarSource, checked against a key you pin), takes the context from your own knowledge, never from the Act, and commits only if the Act carries every law that governs it. Specified in NOMOS-SPEC-014 (Draft).
bash
# Describe the act; NOMOS works out which laws govern it, asks each one, and combines the answers.
curl -X POST https://api.nomosprotocol.com/api/v1/can \
  -H "Content-Type: application/json" \
  -d '{
    "context": {
      "jurisdiction":   "AE",
      "established_in": "DIFC",
      "subjects_in":    "AE",
      "output_used_in": "AE"
    },
    "action": "share_customer_data_with_analytics_vendor",
    "processing_fair_and_transparent": false
  }'

# → 200 OK (abridged): a DIFC firm acting in mainland Dubai answers to DIFC law, not the UAE federal law
{
  "mode": "resolution",
  "verdict": "DENIED",
  "authorized": false,
  "reason": "Denied by difc-data-protection-law-difc-law-no-5-of-2020.",
  "answered_under": ["difc-data-protection-law-difc-law-no-5-of-2020"],
  "coverage": "Answered under the laws the NOMOS registrar lists for this context: ... Other law may also apply.",
  "resolution": { "status": "RESOLVED", "applicable": [ ... ], "proof": { "heads": { "platform": "..." }, ... } },
  "members": [{ "authority": "difc-data-protection-law-difc-law-no-5-of-2020", "verdict": "DENIED", "query_id": "qry_..." }]
}

# Only which laws apply, without asking them (records nothing):
curl -X POST https://api.nomosprotocol.com/api/v1/resolve -H "Content-Type: application/json" \
  -d '{ "context": { "jurisdiction": "AE", "established_in": "DIFC", "subjects_in": "AE", "output_used_in": "AE" } }'

Base URL & versioning

All endpoints are versioned under /api/v1. Breaking changes will increment the version prefix — existing integrations are never silently broken.

Production base URL

https://api.nomosprotocol.com/api/v1

Response format

JSON everywhere — Content-Type: application/json

Timestamps

ISO 8601 UTC — 2024-01-15T10:30:00.000Z

Rate limits

120 req/min (public) · 600 req/min (API key)

TLS

TLS 1.2+ required — HTTP redirects to HTTPS

Endpoints overview

POST
/verify

Verify against public artifact

🌐 No auth
POST
/verify-decision

Verify against your artifact

🔑 API key required
POST
/generate-governance

Seal an authority artifact

🔑 API key required
POST
/detect-contradictions

Analyze policy contradictions

🔑 API key required
GET
/artifacts

List public artifacts

🌐 No auth
GET
/artifacts/:id

Get artifact by ID

🌐 No auth

What an Act is

can() asks whether an action is permitted. An Act makes the change. It carries one exact action together with everything needed to authorize it: the sealed rules it acts under, facts signed by the systems that know them, and the approvals of the people who must approve. The system that makes the change, the relying party, verifies all of it itself, locally, against a root it pinned, and commits exactly that action or nothing. No NOMOS service is in the path.

What an Act carries

action

The exact change: type, subject, params. The relying party commits this and nothing else from the request.

relying_party

Who the Act is addressed to. Any other system refuses it (WRONG_RELYING_PARTY).

authority

The sealed artifact and the key certificates that connect its signer to a root (SPEC-007 rev. 1.9).

testimony

Facts signed by witnesses, each key certified for exactly the claims it may state, with an as_of and a valid_until.

consents

Approvals over the Act's binding digest, by keys certified for a role. Counted by distinct person, not by key.

nonce · issued_at · expires_at

Single use, inside a window the relying party bounds. The nonce is also the idempotency key.

Verdicts

AUTHORIZED

Commit exactly the action. The only verdict that commits.

ESCALATED

A rule requires approval. The verdict names the role, the number of consents required and the act_digest to approve. Resubmit the same Act with the consents before it expires.

INCOMPLETE

A fact that could change the outcome is absent. open_facts names exactly which ones.

DENIED

A rule forbids the action. rule names it. No approval changes a denial.

REPLAYED

This nonce was already committed. The original receipt is returned; nothing commits twice.

Named refusals

The Act itself fails: SEAL_INVALID, EXPIRED, ISSUER_NOT_RECOGNIZED, TESTIMONY_OUT_OF_SCOPE, CONSENT_INVALID, SUPERSEDED, ARTIFACT_REVOKED and the others listed in SPEC-008 §6.

An absent fact is undecided, never false. Nothing commits while a rule that could stop the action is still undecided, so an agent cannot get a change through by leaving out the fact that would have stopped it. A fact the policy says comes from a witness is accepted only as testimony from a key certified for that claim; the agent cannot assert it.

Specs: SPEC-008 0.6.0 Act Binding · SPEC-009 0.1.0 Discovery & submission · SPEC-007 rev. 1.9 Chain of trust · SPEC-010 0.2.0 Signature suites. All Draft; second implementations are welcome against the published vectors.

An Act

json
{
  "act_version": "1",
  "act_id": "act-7f3c…",
  "nonce": "q8Jm2c4bS0y3i1K6aZ9nDw==",
  "issued_at":  "2026-10-26T09:00:00Z",
  "expires_at": "2026-10-26T09:15:00Z",
  "relying_party": "shop.local",
  "action": {
    "type": "purchase",
    "subject": "DEPT-17",
    "params": { "amount": 2000, "vendor": "paperco" }
  },
  "authority": {
    "artifact":  { "meta": { … }, "logic": { … }, "seal": { … } },
    "key_certs": [ { "parent_kid": "…", "child_kid": "…", "scope": "…", … } ]
  },
  "testimony": [{
    "claim": "budget_remaining", "value": 5000, "about": "DEPT-17",
    "as_of": "2026-10-26T09:00:00Z", "valid_until": "2026-10-26T09:16:00Z",
    "kid": "…", "algorithm": "Ed25519", "signature": "…"
  }],
  "consents": [{
    "binding_digest": "…", "role": "MANAGER", "decision": "approve",
    "signed_at": "2026-10-26T09:02:11Z",
    "kid": "…", "algorithm": "WebAuthn-ES256", "signature": "…"
  }]
}

Local sandbox & act()

npx @nomosprotocol/cli dev starts a complete local world: a shop that accepts Acts, the policy it accepts them under, a finance system that states budgets, and a manager who approves. Every key is a labelled test key. Then one call to act() discovers the shop, gathers the signed facts its policy needs, submits, and returns the shop's verdict.

What act() does

It reads the relying party's discovery document (/.well-known/nomos-relying-party), fetches the authority and certificates from the issuer it names, asks each witness for the claims the policy declares, builds and submits the Act, and on ESCALATED requests approval and resubmits the same Act when it arrives. Discovery documents are hints: they tell the carrier where to look, and the relying party still verifies everything it receives against its own configuration.

The result

status

committed · escalated · incomplete · denied · refused · replayed

summary

What happened, in one sentence.

receipt · result

When committed: the receipt, and what the relying party’s commit returned.

missing

When incomplete: each fact that could still change the outcome, where it would come from, and why it is missing.

approvalUrl

When escalated and not approved in time: where a person can approve.

verdict · act

The relying party’s verdict exactly as returned, and the Act as submitted, for your records.

Try amount: 2000 (the manager must approve; the approval link prints in the sandbox window), amount: 9000 (over budget), vendor: 'shadyco' (blocked by the shop's own fact) or subject: 'DEPT-99' (finance knows nothing, so the Act is INCOMPLETE). --auto-approve approves every request at once; --port moves the three ports.

1. Start the sandbox

bash
npx @nomosprotocol/cli dev
# :4747  shop.local     relying party, accepts purchase
# :4748  acme           issuer, and the manager who approves
# :4749  acme-finance   witness, states budget_remaining

2. Act as an agent

typescript
// npm install @nomosprotocol/sdk
import { act } from '@nomosprotocol/sdk';

const r = await act({
  to: 'http://localhost:4747',
  action: {
    type: 'purchase',
    subject: 'DEPT-17',
    params: { amount: 500, vendor: 'paperco' },
  },
});

r.status;   // 'committed'
r.summary;  // 'Committed by shop.local.'
r.receipt;  // the shop's receipt for this Act

// amount: 9000  → r.status === 'denied'
// DEPT-99       → r.status === 'incomplete'
//                 r.missing → [{ fact: 'budget_remaining', … }]

accept(): commit verified changes

Wrap your existing handler with accept(). It verifies each Act locally with @nomosprotocol/verify, then, in one transaction, records the nonce, re-reads your own facts to check nothing moved, hands commit a copy of exactly the verified action, and stores the receipt. It also serves your discovery document, generated from the same configuration, so what you advertise and what you enforce cannot drift apart.

HTTP status per verdict (SPEC-009 §6.2)

AUTHORIZED201

Committed. The body carries the receipt and your commit’s result.

ESCALATED202

role, consents_required, act_digest, retry_until. Resubmit the same Act with consents.

INCOMPLETE422

open_facts names exactly the absent facts.

DENIED403

rule names the rule.

REPLAYED409

The stored receipt from the first commit.

Any other refusal400

The verdict, with its reason_code where the spec defines one.

Wrong media type · too large415 · 413

Acts are posted as application/nomos-act+json, up to max_act_bytes.

Options that matter in production

root

The root you pin. Required; there is no default.

authorities

Each artifact you accept: its issuer, the action types it governs, its currencyPolicy (record or record_or_statement, no default) and your record of the seal hash in force.

localFacts

Facts you supply from your own state, for inputs the policy declares as relying_party. Called to verify and again inside the transaction.

store

Nonces and receipts: hasNonce, receiptFor and a transaction that runs your commit in the same database transaction. postgresStore(pool) is the production store: one transaction with your change, exactly one commit under concurrent duplicates, and the Act retained beside its receipt. memoryStore() is for development only.

revocations

revocationSource({ url, root, maxAgeSeconds }) reads the issuer's signed list (SPEC-007 rev. 1.10): a revocation counts only from a parent your root reaches, revocations are never forgotten, and when no current list can be established the Act is refused with 503 and Retry-After, never treated as "nothing revoked".

maxWindowSeconds

The longest Act window you accept. Default 900, long enough for a person to approve.

mode: 'shadow'

Verify and record every verdict, never commit. For pilots alongside an existing flow.

onVerdict

Called with every verdict and its receipt, committed or not.

A relying party

typescript
import pg from 'pg';
import { accept, postgresStore } from '@nomosprotocol/sdk';

const store = postgresStore(new pg.Pool({ connectionString: DATABASE_URL }));
await store.migrate();   // once

const rp = accept({
  relyingPartyId: 'orders.acme.example',
  root: ACME_ROOT_PEM,               // the root you pin
  actEndpoint: 'https://orders.acme.example/nomos/acts',
  authorities: [{
    artifactId: 'acme-purchasing',
    issuer: 'https://policy.acme.example',
    actions: ['purchase'],
    currencyPolicy: 'record',
    inForceSealHash: POLICY_SEAL_HASH,
  }],
  localFacts: async (act) => ({
    vendor_blocked: await isBlocked(act.action.params.vendor),
  }),
  commit: async (action, { tx }) => createOrder(tx, action),
  store,
});

// Express, Connect, node:http
app.use(rp.express());

// Hono, Next.js, Cloudflare Workers, Deno, Bun
export default { fetch: rp.fetch };

Issuer, witness, approver

Each other party to an Act is one call that returns a handler, mounted the same way as accept(). Each serves its own discovery document under /.well-known/ and signs only what its certificate allows. Witnesses and approvers can return their own certificate chains with what they sign, and act() presents exactly the certificates the Act relies on (SPEC-009 0.2.0), so an institution can certify any number of people without the issuer document growing.

issuer()

Publishes your sealed policies, the version of each that is in force, and the certificate pool carriers present (/.well-known/nomos-issuer). Its key signs the in-force statements a relying party with record_or_statement accepts.

witness()

Turns an existing lookup into signed statements (/.well-known/nomos-witness). You give it a function per claim; it returns undefined for a subject it knows nothing about, which reaches the relying party as an absent fact. authorize is your access control; maxValiditySeconds bounds how long a statement stays true (default 900).

approver()

Shows a person the exact change and signs their consent over the Act's binding digest. The key is certified with consent:<role> approver:<person>, so two keys belonging to one person count once. decide: 'page' (default) serves an approval page; 'auto' is for development only. For people, passkeyApprover() approves with Face ID, Touch ID or a security key: an administrator signs a single-use enrolment link (nomos enroll), the passkey is certified consent:<role> approver:<person> suite:WebAuthn-ES256, and each approval signs a challenge committed to exactly this change. The private key never leaves the device, and no server can approve for anyone.

Keys are Signers

Every role takes a Signer: a kid, the public key, the suite it signs under, and an async sign(payload). The private key never has to be in your process: @nomosprotocol/signers provides awsKmsSigner, gcpKmsSigner, azureKeyVaultSigner and remoteSigner for any other HSM, each emitting only the encoding NOMOS-SPEC-010 accepts and verifying every signature before returning it. localSigner(pem) and generateSigner() cover local keys for development. Certificates themselves are managed with nomos init, nomos cert issue, nomos cert revoke and nomos revocations (or certificateRegistry() in code), which refuse at issue time anything a relying party would refuse later, such as a scope wider than its parent's. Suites are fixed by SPEC-010: Ed25519, ES256, and WebAuthn-ES256 for consents signed with a passkey, permitted only where a certificate's scope names it.

A witness over an existing lookup

typescript
import { witness, localSigner } from '@nomosprotocol/sdk';

const finance = witness({
  origin: 'https://finance.acme.example',
  witnessId: 'acme-finance',
  signer: localSigner(process.env.FINANCE_KEY_PEM!),
  claims: {
    // undefined = unknown subject → an absent fact
    budget_remaining: async (dept) => budgets.remaining(dept),
  },
  authorize: ({ claim }) => claim === 'budget_remaining',
});

app.use(finance.express());

A Signer backed by your KMS

typescript
import { KMSClient } from '@aws-sdk/client-kms';
import { awsKmsSigner } from '@nomosprotocol/signers';

const signer = await awsKmsSigner({
  client: new KMSClient({ region: 'eu-west-1' }),
  keyId: 'alias/nomos-finance-witness',
});
// signer.kid, signer.publicKeyPem: certify it; pass it to witness()

Budgets: limits across acts

"No more than AED 20,000 per supplier per year" depends on every payment before this one, so no check of one act can enforce it. A budget is enforced where the acts are committed: accept() keeps a ledger per budget, scope and period, charges it in the same transaction as your change, and supplies its figures as facts the authority's rules read. Specified in NOMOS-SPEC-016 Budgets.

Where a budget is declared

In the policy

When the institution's text states the limit, it is sealed into the artifact as governance.budgets, and every system that accepts the artifact applies it with no configuration. In Studio: Enforce through Acts → Budgets.

By the receiving system

A limit of your own: pass budgets to accept(). It is counted alongside the policy's, never instead of it.

What it guarantees

Nothing the agent sends chooses the count

The scope ({ from: 'action.subject' } or fixed) and the amount come from the verified action; the period from your own clock, as a calendar day, month, quarter or year in a named time zone.

BUDGET_EXHAUSTED409

A hard budget with no room refuses. Nothing is committed and the nonce stays unrecorded, so the same Act may be resubmitted once room returns. REPLAYED is also 409: branch on decision.

Facts for the rules

facts: { remaining: 'budget_remaining' } supplies the ledger's room to rules that declare budget_remaining with source: 'relying_party', so amount > budget_remaining can escalate to an approver instead of refusing.

Advisory

Counts and informs, never refuses. Pair one with a hard ceiling to allow approved overruns up to a limit.

Holds and reversal

Two-phase ledgers reserve, then settle or release; a hold that is neither expires on its own. rp.budgets.reverse(entryId) gives back a charge that failed downstream, in the period it was charged to, once.

Receipts

Every receipt lists each ledger charged: its budget, scope and period, the amount and limit, what had been counted before (consumed_before) and the ledger's state digest before the charge.

The hosted ledger

For systems that would rather not keep the ledger themselves, NOMOS keeps it: /budgets shows what is left and who has drawn on it, period by period. client.budgets manages the same budgets from code (create, adopt a policy's budget, ledgers, history, grant spending rights to another organisation or key, putRelyingParty), and client.budgets.reserveAct(act) places a hold there. The owner decides who may spend; only the owner changes a limit.

A budget of your own, beside the policy's

typescript
const rp = accept({
  relyingPartyId: 'payments.acme.example', root, actEndpoint,
  store: postgresStore(pool),            // ledgers in your database
  authorities: [{ artifactId: 'acme-procurement.release-payment',
    actions: ['release_payment'], currencyPolicy: 'record', inForceSealHash }],
  budgets: [{
    id: 'payments_per_supplier_daily', applies_to: ['release_payment'],
    unit: { kind: 'money', currency: 'AED', minor_units: 2 },
    limit: 50_000_00,                    // AED 50,000, in fils
    period: { kind: 'day', time_zone: 'Asia/Dubai' },
    scope: { from: 'action.subject' },   // per supplier
    amount: { from: 'action.params.amount' },
    facts: { remaining: 'supplier_budget_remaining' },
  }],
  commit: async (action, { tx }) => releasePayment(tx, action),
});

A rule that reads the ledger

json
{
  "id": "over_supplier_budget",
  "when": "amount > supplier_budget_remaining",
  "then": [{ "type": "escalate", "escalation_id": "ESC_CFO" }]
}

Verifier, MCP & conformance

@nomosprotocol/verify is the verifier everything above is built on, and the one this platform runs. It is pure: given an Act and your configuration it returns a verdict, with no network call. It runs in Node 20+, browsers, Cloudflare Workers, Deno and Bun, and depends only on the audited @noble/curves and @noble/hashes.

Use it directly

Use verifyAct when you already have your own transport and transaction handling; accept() is this plus the nonce, receipt and commit discipline. verifyArtifact resolves a chain of key certificates on its own, and the SDK's verifyChain now calls it locally (pass { remote: true } to ask the hosted endpoint instead). verifySeal checks an artifact's seal alone.

Any MCP agent

nomos-mcp 1.2 adds an act tool. The agent names the system and the action; the tool does what act() does and returns the verdict, including which facts are missing and where to approve. It holds no key, and it runs only as a local stdio server: a carrier fetches the origins it is given, which a hosted server must not do on behalf of anonymous callers.

Conformance

The spec repository ships the vectors: 43 Act vectors and 1,693 mutants for the verifier, 37 chain-of-trust cases for rev. 1.9, and an HTTP runner for relying parties (submission-vectors/run.mjs, 17 checks). The runner speaks only HTTP, so it tests a relying party in any language. accept() passes all 17, and so does the spec's reference relying party, written separately from it on the same verifier.

verifyAct

typescript
import { verifyAct } from '@nomosprotocol/verify';

const v = verifyAct(act, {
  relyingPartyId: 'acme-bank:core-ledger',
  rootPublicKeyPem: ROOT_PEM,     // no default
  currencyPolicy: 'record',       // no default
  inForce: { 'pub_lending_v1': SEAL_HASH },
  seenNonces,
  localFacts: { is_first_loan: false },
});

if (v.commit) {
  // record act.nonce and apply exactly act.action,
  // in one transaction
}

MCP: the act tool

json
{
  "mcpServers": {
    "nomos": { "command": "npx", "args": ["-y", "nomos-mcp"] }
  }
}

// tool: act
{
  "to": "http://localhost:4747",
  "action": {
    "type": "purchase", "subject": "DEPT-17",
    "params": { "amount": 500, "vendor": "paperco" }
  }
}

Test your relying party

bash
git clone https://github.com/nomos-spec/spec
cd spec/submission-vectors && npm install
# configure your relying party with profile.json, then:
node run.mjs https://your-relying-party.example

Authentication

Public endpoints (/verify, GET /artifacts) require no credentials. All other endpoints require an API key.

X-Nomos-Api-Key header

Pass your API key as a request header. Keys are prefixed nmk_live_ for production and nmk_test_ for testing.

X-Nomos-Api-Key: nmk_live_abc123...

How to get your API key

1

Create an account

Sign up at nomosprotocol.com — free tier included, no credit card required.

2

Open Settings → API Keys

From the top-right menu in your dashboard, go to Settings → API Keys.

3

Create a new key

Click "New API Key", give it a name, and optionally scope it to specific operations.

4

Copy and store it

The full key is shown once. Store it in an environment variable — never hard-code it in client-side code.

Authentication errors

UNAUTHORIZEDMissing X-Nomos-Api-Key header or invalid key format
KEY_REVOKEDKey was revoked via the dashboard
KEY_EXPIREDKey has passed its expiry date
FORBIDDENKey does not have permission for this operation
bash
# Pass your API key in the X-Nomos-Api-Key header
curl -X POST https://api.nomosprotocol.com/api/v1/verify-decision \
  -H "Content-Type: application/json" \
  -H "X-Nomos-Api-Key: nmk_live_abc123..." \
  -d '{ ... }'

# A missing, invalid or revoked key returns:
# HTTP 401 Unauthorized
{
  "error": "Invalid or revoked API key",
  "code": "UNAUTHORIZED",
  "hint": "Provide a valid X-Nomos-Api-Key header or use session authentication"
}
POSThttps://api.nomosprotocol.com/api/v1/verify
🌐 No auth120 req/min per IP

Verify (public artifact)

Check whether an AI decision is allowed, denied, or needs escalation against a pre-built public authority artifact. No account required — ideal for prototyping, demos, and testing rule behaviour.

Body parameters

artifact_id
stringrequired

Public artifact ID (e.g. pub_lending_v1) or your sealed artifact ID from NOMOS Studio.

decision
stringrequired

Decision string your agent is making — e.g. approve_loan, deny_claim, process_payment.

inputs
objectrequired

Key-value inputs consumed by the artifact's rules. Field names must match the artifact's input contract.

metadata
objectoptional

Arbitrary metadata passed through to the audit log. Not evaluated against rules.

Response fields

verdict
string
allow · deny · escalate · escalate_strict
confidence
float
0–1. Confidence of the matched rule.
audit_hash
string
SHA-256 of the decision + inputs + rule. Immutable proof of evaluation.
latency_ms
float
Engine evaluation time in milliseconds.
rule_applied
string?
Name of the rule that produced the verdict.
rule_id
string?
Machine-readable rule ID from the artifact.
verdict_description
string?
Human-readable reason for the verdict.
evaluated_at
string
ISO 8601 timestamp of evaluation.
bash
curl -X POST https://api.nomosprotocol.com/api/v1/verify \
  -H "Content-Type: application/json" \
  -d '{
    "artifact_id": "pub_lending_v1",
    "decision": "approve_loan",
    "inputs": {
      "amount": 5000,
      "credit_score": 550
    }
  }'

# → 200 OK
{
  "allowed": false,
  "outcome": "auto_rejected",
  "rule_applied": "subprime_hard_floor",
  "rule_id": "R2",
  "rule_reference": "R2",
  "rule_description": "Hard reject: credit score below 580 — below minimum underwriting threshold",
  "verdict_description": "Hard reject: credit score below 580 — below minimum underwriting threshold. Decision is blocked. A governing rule was violated.",
  "confidence": 0.92,
  "contradictions": [],
  "audit_hash": "sha256:4dace67eae6cadbece536e8c445f7dc8e5673910b2be96be8cdbf4b200de76a1",
  "audit_record": "sha256:4dace67eae6cadbece536e8c445f7dc8e5673910b2be96be8cdbf4b200de76a1",
  "latency_ms": 0.2,
  "artifact_id": "pub_lending_v1",
  "artifact_name": "Consumer Loan Approval",
  "evaluated_at": "2026-07-27T03:27:52.293Z"
}
POSThttps://api.nomosprotocol.com/api/v1/verify-decision
🔑 API key required600 req/min per key

Verify decision (custom artifact)

Verify a decision against your own authority artifact created and sealed in NOMOS Studio. Every call is appended to an immutable, hash-chained audit trail visible in your Console dashboard.

Body parameters

artifact_id
stringrequired

Your sealed artifact ID from NOMOS Studio. Starts with art_.

domain_id
integerrequired

Domain ID associated with the artifact. Shown in Studio after sealing.

decision
stringrequired

Decision string your agent is making.

inputs
objectrequired

Rule inputs — must satisfy the artifact's data contract.

caller
objectoptional

Caller metadata: { agent_id, correlation_id, user_id }. Appended to the audit trail.

metadata
objectoptional

Arbitrary metadata for tracing and audit.

Finding your domain_id: After sealing an artifact in Studio, the domain ID is shown on the artifact detail page and in the Studio URL — /studio/domains/42/artifact. It is also returned in the generate-governance response as domain_id.

Using a public artifact? Public artifacts (pub_lending_v1, etc.) are not callable via /verify-decision. Use POST /verify instead — no API key needed.

Possible errors

404 NOT_FOUNDartifact_id does not match any sealed artifact in your account
422 CONTRACT_VIOLATIONOne or more required input fields defined in the artifact's data contract are missing from inputs
401 UNAUTHORIZEDMissing or invalid X-Nomos-Api-Key header
403 FORBIDDENAPI key does not have permission to access this artifact
Caller metadata: The caller.correlation_id field flows through to your audit trail and appears in verification logs. Use it to trace decisions back to your own request IDs.
bash
curl -X POST https://api.nomosprotocol.com/api/v1/verify-decision \
  -H "Content-Type: application/json" \
  -H "X-Nomos-Api-Key: nmk_live_abc123..." \
  -d '{
    "artifact_id": "art_9f2c3d...",
    "domain_id": 42,
    "decision": "approve_loan",
    "inputs": {
      "amount": 12000,
      "credit_score": 695,
      "region": "US-CA"
    },
    "caller": {
      "agent_id": "loan-bot-v2",
      "correlation_id": "req_abc123"
    }
  }'

# → 200 OK
{
  "verdict": "escalated",
  "confidence": 0.97,
  "audit_hash": "sha256:b7c12e34...",
  "latency_ms": 5.1,
  "rule_applied": "high_value_manager_review",
  "verdict_description": "Loan exceeds auto-approval threshold; requires manager sign-off"
}
POSThttps://api.nomosprotocol.com/api/v1/generate-governance
🔑 API key required60 req/min per key

Generate an authority artifact

Upload policy documents — optionally paired with behavioral decision logs — to extract rules, detect contradictions, score ARI readiness, and produce a cryptographically sealed .nomos authority artifact.

Body parameters

name
stringrequired

Human-readable artifact name.

organization
stringrequired

Organization name — appears in the artifact metadata.

documents
Document[]required

Policy documents to extract rules from. Each document: { filename, content, source_type? }.

behavioral_logs
object[]optional

Historical decision logs for triangulation. Used to detect de facto vs de jure divergences.

domain
stringoptional

Optional domain hint (e.g. "lending", "hr") to improve rule classification.

defaults
objectoptional

Defaults: { posture: "conservative" | "balanced" | "permissive" }.

Document object

filename
stringrequired
Original filename — used for provenance tracking.
content
stringrequired
Full text content of the document. For PDFs, extract text before sending.
source_type
string
policy · procedure · regulation · contract. Defaults to policy.
bash
curl -X POST https://api.nomosprotocol.com/api/v1/generate-governance \
  -H "Content-Type: application/json" \
  -H "X-Nomos-Api-Key: nmk_live_abc123..." \
  -d '{
    "name": "Loan Approval Policy v2",
    "organization": "Acme Bank",
    "documents": [
      {
        "filename": "credit-policy.txt",
        "content": "Applicants below 620 credit score are declined...",
        "source_type": "policy"
      }
    ],
    "behavioral_logs": [
      { "decision": "approve", "amount": 8500, "credit_score": 710 },
      { "decision": "deny",    "amount": 15000, "credit_score": 580 }
    ]
  }'

# → 200 OK
{
  "artifact_id": "art_9f2c3d...",
  "ari_score": 0.74,
  "autonomy_band": "bounded",
  "confidence_band": "VALIDATED",
  "rules_extracted": 8,
  "contradictions": [
    {
      "conflict_type": "threshold_mismatch",
      "severity": "high",
      "description": "Policy escalates >$10k; logs show >$12k"
    }
  ],
  "policy_gaps": 2
}
POSThttps://api.nomosprotocol.com/api/v1/detect-contradictions
🔑 API key required60 req/min per key

Detect contradictions

Stateless analysis — no artifact is created or stored. Returns contradiction types, hidden (inferred) rules, and layer divergences between declared policy and observed behavioral data. Useful for pre-flight audits and continuous monitoring.

Body parameters

policy_documents
Document[]required

Policy documents to analyze. Each: { filename, content, source_type? }. No artifact is created.

behavioral_logs
object[]optional

Historical decision data to compare against declared policy.

Contradiction types returned

rule_collision

Two rules apply to the same case with different decisions and the policy does not settle it soundly: an approval overriding a stricter rule outside a narrower exception, a rule that never takes effect, or rule order deciding. The description names the case and what the policy would do. Overlaps the policy settles (priority, tie rule, narrower exception) are not returned.

ghost_term

An undefined standard ("reasonable", "promptly", "approximately 500") in a rule's own text.

layer_divergence

A policy rule and a rule of practice that one case meets with different decisions, with that case.

bash
curl -X POST https://api.nomosprotocol.com/api/v1/detect-contradictions \
  -H "Content-Type: application/json" \
  -H "X-Nomos-Api-Key: nmk_live_abc123..." \
  -d '{
    "policy_documents": [
      {
        "filename": "hr-leave-policy.txt",
        "content": "All leave requests over 5 days require manager approval. Leave cannot exceed 14 days without HR sign-off.",
        "source_type": "policy"
      }
    ],
    "behavioral_logs": [
      { "decision": "approve", "days": 8,  "approver": "self" },
      { "decision": "approve", "days": 12, "approver": "self" }
    ]
  }'

# → 200 OK
{
  "summary": "1 issue(s) found across 9 rules: 1 rule collision(s). …",
  "rules_found": 9,
  "contradictions": [
    {
      "type": "rule_collision",
      "layer": "de_jure",
      "severity": "high",
      "description": "Rules "manager_approval_over_5_days" and "self_approve_senior_staff": A rule that allows the action wins over a rule that would escalate it, and it is not a narrower exception to that rule. For days = 6, role = "senior", the policy will allow it."
    }
  ],
  "hidden_rules": [
    { "description": "Senior staff self-approve without manager review", "frequency": 0.4, "confidence": 0.91 }
  ],
  "policy_gaps": [],
  "layer_divergences": []
}
GEThttps://api.nomosprotocol.com/api/v1/artifacts
🌐 No auth

List public artifacts

Returns all five pre-built public authority artifacts with their rules, example inputs, and metadata. No account required. Use these as starting points before creating custom artifacts in Studio.

Public artifacts

pub_lending_v1lendingdecision: "approve_loan"

Consumer Loan Approval

Credit decisions — denial floors, escalation tiers, dual-approval thresholds

inputs: amount, credit_score, dti_ratio, employment_type, loan_purpose, is_first_loan, has_cosigner, bankruptcy_active, days_since_delinquency, delinquency_severity

pub_refund_v1e-commercedecision: "process_refund"

Customer Refund Policy

Return window enforcement, high-value dual-approval, serial-returner detection

inputs: days_since_purchase, refund_amount, product_type, item_condition, is_defective, proof_of_purchase, returns_this_quarter, subscription_months_remaining

pub_fraud_v1paymentsdecision: "process_transaction"

Transaction Fraud Detection

Velocity limits, geo-mismatch, card status, impossible travel detection

inputs: amount, transactions_last_hour, transactions_last_24h, geo_mismatch, country_risk_tier, account_age_days, card_reported_lost, impossible_travel, is_round_amount, merchant_category, card_present, is_international, declined_attempts_last_hour

pub_hr_leave_v1hrdecision: "approve_leave"

HR Leave Approval

Leave balance, advance notice, team coverage, probation and blackout rules

inputs: days_requested, advance_notice_days, team_coverage_ratio, is_blackout_period, days_remaining_balance, leave_type, is_on_probation, leaves_this_quarter

pub_kyc_v1compliancedecision: "onboard_customer"

KYC Customer Verification

ID verification, sanctions, PEP status, jurisdiction risk, source of funds

inputs: id_verified, risk_score, is_pep, sanctions_match, country_risk_tier, adverse_media_hits, source_of_funds_declared, customer_type, ubo_disclosed, expected_monthly_volume, account_age_days

GEThttps://api.nomosprotocol.com/api/v1/artifacts/:id
🌐 No auth

Returns a single artifact by ID including its full rule set, example inputs, and jurisdictional metadata. Same response shape as an item in the list endpoint.

bash
# List all public artifacts
curl https://api.nomosprotocol.com/api/v1/artifacts

# → 200 OK
{
  "artifacts": [
    {
      "id": "pub_lending_v1",
      "name": "Consumer Loan Approval",
      "category": "lending",
      "confidence_band": "VALIDATED",
      "tags": ["lending", "credit", "banking"],
      "version": "1.0.0",
      "rules": [ ... ],
      "example_inputs": { ... }
    },
    { "id": "pub_refund_v1",    "name": "Customer Refund Policy",     ... },
    { "id": "pub_fraud_v1",     "name": "Transaction Fraud Detection", ... },
    { "id": "pub_hr_leave_v1",  "name": "HR Leave Approval",          ... },
    { "id": "pub_kyc_v1",       "name": "KYC Customer Verification",  ... }
  ],
  "total": 5
}

# Get a single artifact
curl https://api.nomosprotocol.com/api/v1/artifacts/pub_lending_v1

How a query actually resolves against sealed rules

The Exchange's /query path does not go through executeNomos() — the domain-based runtime used elsewhere on the platform, with its configurable conflict_policy (first_match / highest_priority / collect_and_resolve). Sealed Exchange artifacts run a separate, simpler, fixed algorithm: evaluateStudioRules.

1Sort the sealed rules — conditional (non-blank) rules first, "always applies" rules last; within each tier, descending priority. Fixed order, not configurable per artifact.
2Walk that order. The first rule whose condition tree evaluates true against your inputs wins the verdict slot.
3Classification rules (set_field) never occupy the verdict slot — the first one whose condition passes, per field, wins separately and rides alongside the verdict.
4Informational-only rules (emit / log / notify / track / record / audit) never occupy the verdict slot either; a firing one is recorded as an obligation.
5If nothing conditional fires, the artifact's declared evaluation_model default applies — deny_list defaults to auto_approved, require_all defaults to auto_rejected.

evaluateStudioRules is a pure fold over (rules, inputs) — no I/O, no Date.now() or randomness in the decision path, zero imports in the file. Given the same sealed rules and the same inputs, it's byte-for-byte deterministic — and there's no LLM call anywhere in this path.

The one real caveat. Rules can carry a valid_from/valid_until window, and every evaluation filters against wall-clock now, not against the query. Two identical queries against the same sealed artifact, run on either side of a rule's validity boundary, can legitimately return different verdicts. This is deliberate (time-scoped regulation changes), but it's the one honest exception to "same facts, same artifact, same answer" — and it isn't disclosed anywhere in the response itself today.
typescript
// server/lib/authority-query.ts
// Wall-clock filtering — the one non-deterministic input
export function activeRulesAt(rules, at = new Date()) {
  return rules.filter(r =>
    (!r.valid_from  || new Date(r.valid_from)  <= at) &&
    (!r.valid_until || new Date(r.valid_until) >  at)
  );
}

// server/lib/rule-evaluator.ts — evaluateStudioRules, abridged
// 1. sort: conditional rules first, blank/"always" rules last,
//    descending priority within each tier
// 2. first rule whose `when` tree is true wins the verdict slot
// 3. set_field rules resolve separately, per field
// 4. emit/log/notify/track/record/audit rules become obligations
// 5. no conditional match → the artifact's evaluation_model default
// Zero external imports in this file — no network, no LLM.

open_higher_priority_count — completeness, not a gate

Overlapping rules are disambiguated purely by priority-sort-then-first-match (previous section) — there's no "collect every match and merge" behavior in the live Exchange query path. What open_higher_priority_count adds is a second, honest pass over the same rules using three-valued logic instead of two.

A companion function, getConditionalVerdict, walks the identical priority-sorted rule list, but each rule's condition can resolve true, false, or unknown — unknown when a field it reads is simply absent from your inputs. It stops at the first definitively-true rule (the verdict), and every higher-priority rule still unknown at that point becomes a caveat. The count is just how many caveats there were.

0Every rule ranked above the matched one was fully resolved by the facts you sent. The verdict is unconditionally final on what you supplied.
>0You got an official, permanently-minted answer while some higher-priority condition was never confirmed either way — disclosed, not hidden.
Computed once, at mint time, from the rules as they existed then — never recomputed against a later rule revision. Deliberately excluded from audit_hash: it discloses completeness, not a new fact being attested, and anyone can independently recompute it from the public sealed rules plus the same inputs.
typescript
// server/lib/authority-query.ts
// Disclosure, not a gate: how many higher-priority rules were
// still open (fields absent from inputs) at the moment of this
// exact evaluation — reuses the same priority walk as
// evaluateStudioRules, so it can never disagree with the
// verdict actually returned.
const openHigherPriorityCount =
  getConditionalVerdict(rules, inputs, defaultVerdict)
    .caveats.length;

How rule values get plain-language labels — without an LLM

When /interaction shows you a question with human-readable options, each option's label and definition is compiled at request time by walking a fixed priority chain over the artifact's own already-extracted content — never generated or paraphrased by a model.

1. definition

Literal search for the source text's own "'<term>' means …" sentence, tried against case/singular/hyphen variants of the value.

2. annex

If the field name matches /annex/i, the value is looked up as a point reference (e.g. "1(a)") inside the artifact's own Annex text.

3. authored

Falls back to a small hand-written, human-reviewed vocabulary — only reached if steps 1–2 found nothing traceable in the source.

4. rule_graph

Describes the value by concatenating the description of every rule that actually gates on it — flagged for review if only one rule references it.

5. unsourced

Nothing traceable. Always flagged for review rather than guessed.

The authored vocabulary is deliberately small — roughly 20 entries, version-stamped, and it never overrides an actual source-grounded definition; it only fills gaps steps 1–2 couldn't find. And it's presentation-only: evaluateStudioRules never reads a label or a definition, only the raw sealed value your selection maps to. A prettier label can never change what gets evaluated.
typescript
// server/lib/interpretation-compiler.ts
// Imports: getVerbatimSectionText (pure string search over
// cached extracted text), parseWhenString, a static label map.
// No Anthropic/OpenAI import anywhere in this file.

function compileValueMeaning(field, value, artifact) {
  return findSourceDefinition(value, artifact)      // 1
      ?? findAnnexMeaning(field, value, artifact)    // 2
      ?? AUTHORED_LABELS[canonical(value)]           // 3
      ?? compileRuleGraphMeaning(field, value, rules) // 4
      ?? { label: value, source: 'unsourced',
           needsReview: true };                       // 5
}

// authored-vocabulary.ts — "the one hand-written, human-
// reviewed surface in the whole interpretation layer"
export const AUTHORED_VOCABULARY_VERSION = '2026-07-22.1';

Sealing and independent offline verification

A .nomos artifact is sealed once, in Studio — never by the Exchange itself, which only ever reads an already-sealed payload at publish time.

Canonicalize

A hand-rolled, JCS-style canonicalizer — object keys sorted lexicographically, undefined stripped, NaN/Infinity rejected. It's labeled JCS in comments but isn't a certified RFC 8785 implementation; for this artifact shape (no exotic Unicode/number edge cases) it's consistent.

Hash

SHA-256 over the canonicalized artifact — with the seal field itself, and any attestations, excluded from what gets hashed.

Sign

Ed25519 by default, over the raw canonicalized {hash, signed_by} payload — not pre-hashed. Falls back to caller-supplied RSA/EC, or, only outside production, a symmetric HMAC the code explicitly documents as not third-party verifiable.

kid

A content-derived key id — first 16 chars of base64url(SHA-256(public key)) — so keys can rotate without breaking old seals.

Excluding attestations from the hash is deliberate: a third-party regulator or auditor can co-sign a sealed version after the fact (NOMOS-SPEC-004) without ever invalidating the original seal, because attestations were never part of what the seal covers.

Fully offline verification exists as a zero-dependency script — it needs only the .nomos file and the publisher's public key (fetch it once, or pass it locally with --pubkey for a fully air-gapped check). It independently recomputes both the hash and the signature check — it doesn't ask the server whether the artifact is valid, it proves it. HMAC-sealed artifacts explicitly fail this script, by design.
bash
# Fully offline — only needs the file + a public key
node scripts/verify-nomos.mjs artifact.nomos --pubkey key.pem
# → VALID  (or INVALID, with the specific check that failed)

# Or fetch the public key once, verify locally after that
node scripts/verify-nomos.mjs artifact.nomos \
  --url https://www.nomosprotocol.com

Intake questions

A large law has many rules, and NOMOS answers AUTHORIZED only when no rule that could forbid the action is left unanswered. Intake questions make that reachable: a few broad yes/no questions, sealed in the law's data_contract.gates, where one "no" settles every rule in the articles it covers.

An ordinary action needs only the questions

On the DIFC Data Protection Law (199 rules), 12 questions settle all 163 rules that block or escalate. All twelve answered "no" is AUTHORIZED. Answer "yes" to one and pass the facts its articles need. The questions are listed on each law's page, and POST /api/exchange/artifacts/:id/plan asks them one at a time.

A "no" can never trip a rule

The publisher words each question and picks the articles it covers. The value each covered fact is set to is computed from the rules (the opposite boolean, "not_applicable" for text, a number inside every limit), and proved when the law is sealed: all questions "no" fires no rule. A "no" contradicted by a covered fact is CONTRADICTORY_INPUTS.

typescript
import { nomos } from "@nomosprotocol/sdk";

// an ordinary action: every question "no"
const r = await nomos.can({
  authority: "difc-data-protection-law-difc-law-no-5-of-2020",
  q_principles_not_met: false, q_relies_on_consent: false,
  q_other_lawful_basis_issue: false, q_special_category_data: false,
  q_setup_gap: false, q_processor_involved: false,
  q_transfer_outside_difc: false, q_information_not_given: false,
  q_individual_request: false, q_automated_decision: false,
  q_personal_data_breach: false, q_commissioner_matter: false,
});
// r.verdict → "AUTHORIZED"

Enforce a law with Acts

Asking a law gives advice. To enforce it, the system that commits a change checks each action against the sealed law itself, with accept(), and an agent sends an Act with act(): the exact action, with its proof.

Every fact says where it comes from

In an Act, "the customer consented" can't be the agent's word. Each fact the law reads arrives through the channel it declares: stated in the action, from the receiving system's own records, or signed by a witness such as a regulator or a register. Each intake question says the same: the agent answers questions about its action; the receiving system answers questions about its own standing, from its records.

A held act comes back as questions

When an act can't be decided yet, act() returns the law's open questions in plain words, not its facts. Answer the agent's own and call it again. Where several laws govern the act, one Act carries all of them and each law asks its own questions.

Ready on the Exchange

The DIFC, ADGM, UAE and Saudi data protection laws, Qatar's data privacy law and the EU AI Act carry their channels and questions. Each law's page shows them under "Enforce it with Acts". To enforce one as your institution, build on it in Studio, seal it as yourself, and pin your own root in your systems.

typescript
import { act, accept } from "@nomosprotocol/sdk";   // 2.9.0+

// The system that commits the change
const system = accept({
  relyingPartyId: "payments.example",
  root: YOUR_ROOT_PUBLIC_KEY,
  authorities: [{ artifactId: YOUR_SEALED_COPY_ID,      // your seal of the DIFC law
                  registrarName: "difc-data-protection-law-difc-law-no-5-of-2020",
                  issuer: "https://<your-org>.issuer.nomosprotocol.com",
                  actions: ["share_personal_data"] }],
  localFacts: () => ({ q_setup_gap: false, q_personal_data_breach: false /* … */ }),
  commit: (action) => ledger.apply(action),
});

// The agent
let r = await act({ to: "https://payments.example", action });
// r.questions → the law's open questions, each with who answers it
r = await act({ to: "https://payments.example", action,
                answers: { q_transfer_outside_difc: false, q_relies_on_consent: false /* … */ } });
// r.status → "committed" | "denied" | "escalated" | "incomplete"

Bring your own policy

The Exchange holds public law. Most of what an organisation enforces is its own: a payment approval policy, admission rules, an AI-use policy. Everything on this page works the same with yours, and none of it needs the Exchange.

From a document, in Studio

Upload the policy as a PDF or Word file. Studio reads it into rules, each citing the sentence it came from; you review them, confirm where each fact comes from, and seal it as your institution. Ask it with client.can({ artifact_id }), or enforce it with Acts: your systems pin your own root.

From code, with your own key

Write the rules, seal them with seal(), publish them with issuer(), and enforce them with accept(). It runs entirely on your infrastructure, offline. npx @nomosprotocol/cli dev starts a complete local example in one command.

Or both

Build on a public law and add your own rules on top, in Studio. Or carry a public law and your own policy together in one Act: each decides on its own facts, and any that says no means no.

typescript
import { generateSigner, seal, issuer, accept } from "@nomosprotocol/sdk";

const key = generateSigner("Ed25519");     // or a key in your KMS / HSM
const policy = await seal({
  nomos_version: "2.2.0",
  meta: { artifact_id: "acme-payments", version: "1.0.0" },
  data_contract: { inputs: { amount: { type: "number", source: "action" } } },
  logic: {
    decisions: [
      { id: "P2", when: "amount > 10000", then: [{ type: "escalate", escalation_id: "ESC_CFO" }], priority: 50 },
      { id: "P1", when: "amount <= 10000", then: [{ type: "allow" }], priority: 10 },
    ],
    resolution: { conflict_policy: "highest_priority", tie_breaker: "deny_wins", default_outcome: "block" },
  },
  governance: { escalations: [{ id: "ESC_CFO", role_required: "CFO", required_consents: 1 }] },
}, key, "Acme Treasury");

// Publish it, then enforce it where payments are made:
const iss = issuer({ origin: "https://policies.acme.example", issuerId: "acme", signer: key, authorities: [policy] });
const system = accept({ root: ROOT_PEM, authorities: [{ artifactId: "acme-payments", issuer: "https://policies.acme.example", actions: ["pay"] }], /* … */ });

When a person must decide

The law decides what is routine and what is forbidden. A person decides only what the law reserves for a person, and the answer comes back to the calling code.

"Use this law"

Signed in, on the law's page. From then on, when a call made with your API key is answered ESCALATED, an approval request for that exact action and those facts is emailed to your approvers: the holders of the role the law names in your organisation, or else you. The same call made again finds the same request; nothing is emailed twice.

A person approves; an agent never can

The approval page shows the law's questions as written, the facts, and the article that requires a person. Only a signed-in person can answer; an API key never can. An approval is spent once, for that exact action, within an hour, and is refused if the law is revoked in the meantime.

awaitApproval

The call waits for the answer. Approved: allowed: true, with the law's own verdict unchanged. Rejected, timed out or no longer usable: allowed: false, and approval.status says which. A call without your key, or on a law you don't use, gets the verdict only.

typescript
import { Nomos } from "@nomosprotocol/sdk";   // 2.5.0+

const nomos = new Nomos(process.env.NOMOS_API_KEY);
const no = { q_principles_not_met: false, q_relies_on_consent: false, /* …all 12 questions "no" */ };
const r = await nomos.can(
  { authority: "difc-data-protection-law-difc-law-no-5-of-2020",
    ...no,
    q_individual_request: true,            // "yes": a request from a person
    access_request_received: true, days_since_access_request: 45,
    identity_doubt_unresolved: false, response_period_extended_with_notice: false },
  { awaitApproval: { timeoutMs: 10 * 60_000,
                     onApproval: (a) => console.log("waiting on", a.url) } },
);
// r.verdict  → "ESCALATED" (Art. 33(1): the one-month deadline has passed)
// r.approval → { id, url, status: "approved" | "rejected" | "timed_out" | … }
// r.allowed  → true only if a person approved this exact action

Versions & replaced listings

A law changes; its listing gets a new version. Anyone who chose "Use this law" is emailed the rules added, changed and removed, and the follow carries to the new version.

A replaced address points to its replacement

When a publisher retires a version that a newer one replaced, its page stays up with a link to the new version, and every query to it (nomos.can(), MCP ask_authority, nomos-guard) is answered 410 AUTHORITY_REPLACED with the new version in replaced_by. It is never answered from the old rules. A listing withdrawn with nothing to replace it answers 410 AUTHORITY_WITHDRAWN.

Only the publisher continues its own law

A new version is linked to the one it replaces only by its publisher, who chooses it when publishing. A listing can never be named as replacing someone else's.

json
// POST /api/v1/can  { "artifact": "<a replaced version>", ... }
// HTTP 410
{
  "error": "This authority was replaced by version 1.1.0. Ask the new version: difc-data-protection-law-difc-law-no-5-of-2020.",
  "code": "AUTHORITY_REPLACED",
  "replaced_by": {
    "artifact_id": "art_1ab32fdc-…",
    "slug": "difc-data-protection-law-difc-law-no-5-of-2020",
    "version": "1.1.0"
  }
}

What a query record proves

Every query is stored and retrievable at /queries/:id, and every query answered since signing began carries the platform's signature over what was decided. Here is exactly what that does and does not prove.

The record is signed when the query is answered

The platform signs a statement with its Ed25519 key (published at /.well-known/nomos-signing-keys): the artifact and its seal hash, the facts as recorded, the verdict, outcome code and deciding rule, how many higher-priority rules were left unchecked, a digest of the full rule-by-rule evaluation, the evaluator version and the time. The response carries it as signature. Check a downloaded record offline with node verify-nomos.mjs qry_….json --pubkey nomos.pem (the verifier is served at /verify-nomos.mjs, no dependencies). It does not show that the rules give this verdict for these facts: that is a re-evaluation with the named evaluator version. Records answered before signing began carry only audit_hash, a plain SHA-256 over five fields, and say they are unsigned; they are never signed afterwards.

The replay isn't byte-identical to the original response

Fetching the transcript later omits fields the original /query response had (paths_to_approval, classifications, obligations aren't persisted), and adds one the original didn't: the artifact's current status, joined live — the one field in a transcript that's deliberately not frozen, since an artifact can be suspended after the fact.

Append-only by convention, not by database enforcement

The application code only ever inserts a query row — nothing anywhere updates or deletes one. But there's no DB trigger, no revoked write privilege, and no hash-chain linking successive transcripts the way the platform's separate decision-audit trail does elsewhere. It's a strong operational guarantee, not a structural one.

typescript
// server/lib/query-statement.ts — what is signed
statement = {
  type: 'nomos.authority_query.statement/1',
  query_id, artifact: { id, version, seal_hash },
  inputs,                      // as recorded, after redaction
  verdict, outcome_code, matched_rule_id,
  open_higher_priority_count,
  rules_evaluated_digest,      // SHA-256(JCS(rules_evaluated))
  evaluator_version, queried_at, audit_hash,
}
signature = { algorithm: 'Ed25519', kid,
              value: base64(Ed25519(JCS(statement))), statement }

// The only write this table ever gets, anywhere in the codebase:
await db.insert(authorityQueries).values({ ...record });
// No UPDATE, no DELETE route touches it.

Forking preserves lineage, not the seal

Forking a paid or free artifact copies its rules into a new Studio session so you can reconcile them against your own policy documents and behavioral data — but the copy is unsealed by construction.

The parent's seal block is stripped from the copied payload immediately — a fork must be reconciled and independently resealed before it can itself become a queryable artifact; carrying forward a seal over rules you're about to edit would be meaningless. What is preserved is provenance: a forkedFrom record on the new session — the parent artifact id, title, publisher, and critically its seal hash — so lineage back to the exact sealed version you forked from survives even though the seal itself doesn't travel with the copy. Nothing else is regenerated at fork time; no re-extraction, no new ARI score, until the fork is itself sealed and published.

What travels with a fork

Rules

Copied into the new session's draft — fully editable.

Seal

Stripped. The fork is unsealed until independently resealed.

forkedFrom.sealHash

Preserved — proves exactly which sealed parent version this descends from.

ARI / extraction

Not carried forward — recomputed only if and when the fork is sealed.

What's guaranteed deterministic, and what isn't

The honest summary, in one place, of every claim made across this section — so nothing here has to be taken on faith.

✓ Deterministic, LLM-free, network-free at query time

— Rule evaluation and priority resolution (evaluateStudioRules, getConditionalVerdict) — zero imports, pure functions.

— The interaction compiler and its label vocabulary — no model calls, pure text/lookup logic.

— The catalog's /interpret-query matcher — deterministic keyword scoring, not inference.

⚠ Real caveats, stated plainly

— Wall-clock dependency: valid_from/valid_until windows are checked against server time at each call, not against the query itself.

— A different part of the platform (reading documents in Studio) uses a language model to propose rules from the text, each confirmed by a person before sealing. No model is called on any Exchange query route.

— Rate limits and access gating can block a query before it runs — but never change the verdict of one that does.

— Each query record is signed with the platform's published Ed25519 key when it is answered, and checks offline with /verify-nomos.mjs. Records from before signing began are labelled unsigned and are never signed afterwards.

— Query transcripts are append-only by application convention, not by a database-enforced constraint.

Every mechanism on this page is described from the actual implementation, not from what it's supposed to do — including its limits. If a claim here ever stops matching the code, that's a bug in this page, and worth reporting.
POSThttps://www.nomosprotocol.com/api/exchange/artifacts/:authority/query
🌐 No auth

Query a public Exchange authority

Ask a sealed .nomos artifact whether an action is allowed, from your code. Every public artifact in the Exchange network is queryable this way — no account, no API key. The SDK's nomos.can() calls a separate endpoint (POST /api/v1/can) that shares this exact evaluation logic, so the verdict is identical either way.

Body parameters

inputs
objectrequired

The facts to evaluate. Field names must match the artifact's data contract — the /interaction endpoint (below) will tell you which ones matter most.

action
stringoptional

Optional human-readable label for what's being asked. Recorded in the permanent transcript.

Response fields

verdict
string
AUTHORIZED · DENIED · ESCALATED — the authority's own verdict, verbatim.
verdict_description
string
Human-readable explanation.
matched_rule_id
string?
The rule that decided it, if any.
open_higher_priority_count
number?
Higher-priority conditions still open at the moment this was sealed. 0 = every relevant fact was resolved. Absent on records from before this field existed.
query_id
string
Permanent, addressable transcript id — open it any time at /queries/:id.
audit_hash
string
SHA-256 over the query, inputs, verdict, and the artifact's seal — independently re-computable.
latency_ms
number
Engine evaluation time in milliseconds.
Not sure which facts to send? Call /interaction first — it compiles the sealed rules into the highest-impact questions to ask, with plain-language options. Submit whatever you have; a partial query still returns a real, sealed verdict, honestly labeled by open_higher_priority_count.
bash
# Query any public .nomos artifact on the Exchange — no API key
curl -s https://www.nomosprotocol.com/api/exchange/artifacts/<authority-slug>/query \
  -X POST -H "Content-Type: application/json" \
  -d '{"inputs": {"some_relevant_fact": true}}'

# → 201 Created
{
  "query_id": "qry_...",
  "url": "/queries/qry_...",
  "verdict": "DENIED",
  "verdict_description": "Rule \"...\" triggered. The authority denies this action.",
  "matched_rule_id": "rule-...",
  "open_higher_priority_count": 0,
  "audit_hash": "...",
  "queried_at": "2026-07-22T10:00:00.000Z",
  "latency_ms": 42
}
POSThttps://www.nomosprotocol.com/api/exchange/artifacts/:authority/interaction
🌐 No auth

Build a guided intake

For a form, wizard, or chat flow that needs to ask a person one thing at a time instead of assuming your code already knows every fact. Stateless — the response depends purely on which fact keys are already in inputs; no session to manage.

Body parameters

inputs
objectrequired

The facts known so far. Start with {} — the response tells you what to ask next.

Three possible screens

situationThe highest-impact fields, ranked by how many rules each one narrows down. Each option carries a plain-language label, the exact sealed value, and — where traceable — the authority's own definition.
checklistThe remaining single-condition gates, grouped by consequence (blocks / requires review / permits). Most people confirm none apply.
conditional_verdictThe answer now — firm (no open conditions) or provisional, with every still-open higher-priority rule listed as an inline, independently resolvable caveat.
No LLM anywhere. Labels and definitions are compiled deterministically from the sealed artifact's own contents — its rules, its Annex/section text, its declared definitions — never generated or paraphrased at request time. Submit the accumulated facts to /query once nothing's left open.
bash
# Ask the artifact what to ask next — the sealed rules compiled into
# plain-language questions, ranked by how many rules they narrow down.
curl -s https://www.nomosprotocol.com/api/exchange/artifacts/<authority-slug>/interaction \
  -X POST -H "Content-Type: application/json" \
  -d '{"inputs": {}}'

# → 200 OK — one of three screens, chosen purely by which fact keys exist
{
  "screen": "situation",
  "fields": [
    {
      "field": "entity_role",
      "label": "Entity Role",
      "rule_count": 13,
      "options": [
        {
          "value": "provider",
          "label": "You develop or build the system",
          "definition": "'provider' means a natural or legal person… that develops…",
          "source": "definition"
        }
      ],
      "none_sentinel": "__none_of_the_listed"
    }
  ]
}
GEThttps://www.nomosprotocol.com/api/exchange/artifacts/:authority/atlas
🌐 No auth

Browse the whole rule set

Every decision rule in the sealed artifact, grouped by the verdict it produces — every way to get DENIED, every way to get ESCALATED, every way to get AUTHORIZED. For readers who'd rather scan the rules than be interviewed, and for tooling that wants the full decision structure as data.

Deliberately omits provenance citations on artifacts whose extraction hasn't yet passed source verification — an honest gap, not a hidden one.
bash
# Every decision rule in the sealed artifact, grouped by the verdict it
# produces — for reading instead of interviewing.
curl -s https://www.nomosprotocol.com/api/exchange/artifacts/<authority-slug>/atlas

# → 200 OK
{
  "artifact": { "id": "...", "title": "..." },
  "total_rules": 487,
  "outcomes": [
    {
      "verdict": "DENIED",
      "count": 20,
      "rules": [
        { "rule_id": "rule-...", "description": "...", "priority": 1000, "fields": ["..."] }
      ]
    },
    { "verdict": "ESCALATED", "count": 450, "rules": [ ... ] },
    { "verdict": "AUTHORIZED", "count": 17, "rules": [ ... ] }
  ]
}

Verdict values

Every verification returns one of four verdicts. Your integration should handle all four — a verdict of escalate is not an error; it means the authority artifact requires human review.

allow

All applicable rules passed. Decision is permitted under the authority artifact.

deny

A hard rule was triggered. Decision is not permitted. Do not proceed.

escalate

Decision requires human review before proceeding — a threshold or role condition was met.

escalate_strict

Hard escalation — decision is blocked until a senior approver explicitly releases it.

Recommended handling

typescript
switch (result.verdict) {
  case 'allow':
    // Proceed with the decision
    executeAction(decision, inputs);
    break;

  case 'deny':
    // Hard block — do not proceed
    rejectWithReason(result.verdict_description);
    break;

  case 'escalate':
    // Route to human review queue
    createReviewTask({ decision, inputs, audit_hash: result.audit_hash });
    break;

  case 'escalate_strict':
    // Hard block until senior approval
    blockAndNotify('senior-approver@company.com', {
      decision, inputs, audit_hash: result.audit_hash,
    });
    break;
}

Idempotency

request_id is the idempotency key for every execution. Send the same request_id twice and the runtime returns the original cached verdict — no second evaluation, no second audit entry. Safe to retry on network failure.

Use a UUIDv4

Generate a fresh request_id per logical operation. Do not reuse IDs across different decisions.

Dedup window

Duplicate request_ids are detected within a 5-minute window. After that, a new evaluation runs.

Cached response

A cache hit returns the original verdict with "cached": true. The audit trail entry count does not increment.

Omitted request_id

If you omit request_id, the runtime generates one and returns it. That call is not idempotent.

Idempotency is normative in NOMOS-SPEC-001 §6.5. Any conformant runtime must implement it. This means your retry logic is safe across any NOMOS-compatible backend, not just the hosted API.

First call — executes and caches

json
// POST /verify-decision
// request_id: "550e8400-e29b-41d4-a716-446655440000"

{
  "verdict":    "ALLOW",
  "confidence": 0.97,
  "audit_hash": "sha256:b7c12e34...",
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "cached":     false
}

Second call — returns cache, no new audit entry

json
// POST /verify-decision (same request_id, within 5 min)

{
  "verdict":    "ALLOW",
  "confidence": 0.97,
  "audit_hash": "sha256:b7c12e34...",
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "cached":     true
}

Safe retry pattern

typescript
import { randomUUID } from 'crypto';

async function verifyWithRetry(payload: object, maxRetries = 3) {
  const request_id = randomUUID(); // one ID per logical operation
  for (let i = 0; i <= maxRetries; i++) {
    const res = await fetch(`${BASE}/verify-decision`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json', 'X-Nomos-Api-Key': API_KEY },
      body: JSON.stringify({ ...payload, request_id }),
    });
    if (res.ok) return res.json();
    const err = await res.json();
    const retryable = ['RATE_LIMITED', 'SERVICE_UNAVAILABLE', 'ENGINE_ERROR'];
    if (!retryable.includes(err.error?.code) || i === maxRetries) throw err;
    await new Promise(r => setTimeout(r, 2 ** i * 200));
  }
}

Error codes

All errors return HTTP 4xx/5xx with a consistent JSON body. Always check the code field for machine-readable handling — the error string is for humans.

400invalid_inputMissing or malformed request body. Check required fields.
400spec_version_unsupportedArtifact spec_version is not recognised by this runtime. (§3.3)
400seal_verification_failedArtifact hash or signature does not match the seal block — may be tampered or forged. (§8.1)
401UNAUTHORIZEDMissing or invalid X-Nomos-Api-Key header.
401KEY_REVOKEDAPI key was revoked. Generate a new key in Settings.
403FORBIDDENKey lacks permission for this operation or artifact.
404artifact_not_foundartifact_id + version combination not in registry. (§6.2)
404DOMAIN_NOT_FOUNDdomain_id does not exist or belongs to another org.
409duplicate_request_idrequest_id already processed within the dedup window. Return the cached response. (§6.5)
422data_contract_violationOne or more required_fields declared in data_contract are missing from context. (§3.9)
429RATE_LIMITEDToo many requests. Back off with exponential retry.
500ENGINE_ERRORInternal runtime error. Retry — if persistent, contact support.
500chain_corruptionAudit chain hash verification failed. Operator alert — do not continue writes. (§7.2)
503SERVICE_UNAVAILABLETemporary outage. Retry with exponential backoff.

Error response shape

json
// All errors share this envelope (NOMOS-SPEC-001 §11.1):
{
  "error": {
    "code":    "data_contract_violation",
    "message": "Required context field 'credit_score' is missing",
    "hint":    "Supply all required_fields in the artifact's data_contract.",
    "doc_url": "https://nomosprotocol.com/spec#data-contract-violation"
  },
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}

// Example — tampered artifact:
// HTTP 400
{
  "error": {
    "code":    "seal_verification_failed",
    "message": "Artifact hash does not match seal block",
    "hint":    "The artifact may have been modified after sealing. Re-seal from source."
  },
  "request_id": "7f6e5d4c-..."
}

// Example — duplicate request:
// HTTP 409
{
  "error": {
    "code":    "duplicate_request_id",
    "message": "request_id already processed within the dedup window",
    "hint":    "Retrieve the cached response from your first call, or use a fresh UUIDv4."
  },
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}

Retry strategy

typescript
async function withRetry<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try {
      return await fn();
    } catch (err: any) {
      const retryable = ['RATE_LIMITED', 'SERVICE_UNAVAILABLE', 'ENGINE_ERROR'];
      if (!retryable.includes(err.code) || attempt === maxRetries) throw err;
      await new Promise(r => setTimeout(r, 2 ** attempt * 200)); // exponential backoff
    }
  }
  throw new Error('unreachable');
}

Rate limits

Limits are applied per IP (unauthenticated) or per API key (authenticated). Authenticated keys have significantly higher limits — use an API key even for public-artifact calls in production.

Unauthenticated (IP)
/verify, /artifacts
120 req/min
API key
All endpoints
600 req/min
generate-governance
Per key
60 req/min
detect-contradictions
Per key
60 req/min
When you hit a rate limit, back off using exponential backoff starting at 200 ms. The Retry-After header contains the seconds until your window resets.

Rate limit headers

http
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit:     120
X-RateLimit-Remaining: 0
X-RateLimit-Reset:     1705316400
Retry-After:           12

{
  "error": "Rate limit exceeded — retry after 12 seconds",
  "code": "RATE_LIMITED"
}

Usage quota

Each account has a monthly verification pool. Verifications reset on your monthly billing date. The quota is account-wide — all API keys under the same account share one pool.

Free
1,000 / month
Hard block at limit — upgrade required
Production
100,000 / month
Overage charged at $1 per 100 additional calls
Regulated
Unlimited
No quota enforcement
Every response includes two quota headers:
X-Verifications-Used — calls consumed this billing period
X-Verifications-Limit — your plan limit (unlimited for Enterprise)

Quota exceeded response

json
HTTP/1.1 429 Too Many Requests

{
  "error": "Monthly verification limit reached",
  "code": "QUOTA_EXCEEDED",
  "tier": "free",
  "used": 1000,
  "limit": 1000,
  "reset_date": "2025-07-01T00:00:00.000Z",
  "upgrade_url": "/subscription",
  "message": "Your free plan includes 1,000 verifications/month. Upgrade to continue."
}

Quota response headers

http
X-Verifications-Used:  847
X-Verifications-Limit: 1000

Single sign-on (OIDC and SAML 2.0)

Your people sign in through your own identity provider: Microsoft Entra ID, Okta, Ping, AD FS, Google Workspace or any OIDC or SAML 2.0 provider. Part of the Regulated plan; an organisation owner or admin manages it at /api/v1/sso.

1. Add a connection

OIDC needs the issuer URL, client ID and client secret (the secret is encrypted at rest); register the redirect URI that GET /api/v1/sso shows (it ends in /api/sso/oidc/callback). SAML needs the IdP's entity ID, single sign-on URL and signing certificate; NOMOS returns the ACS URL and service-provider metadata to give your IdP. Responses and assertions must both be signed.

2. Prove your email domain

Claim a domain and add the TXT record NOMOS returns at _nomos-sso.<domain>, then verify. Until a domain is verified, no one is signed in through it, so no organisation can claim another's employees.

3. Sign in

People choose "Single sign-on" and enter their work email. New people are created in your organisation with the connection's default role. An existing account at your domain is claimed: its password, other sessions and API keys stop working. SSO sessions last 8 hours.

Admin API

bash
# OIDC connection
POST /api/v1/sso/connections
{ "protocol": "oidc", "name": "Entra ID",
  "issuer": "https://login.microsoftonline.com/<tenant>/v2.0",
  "client_id": "...", "client_secret": "...",
  "default_role": "member" }

# SAML connection
POST /api/v1/sso/connections
{ "protocol": "saml", "name": "Okta",
  "idp_entity_id": "http://www.okta.com/...",
  "idp_sso_url": "https://acme.okta.com/app/.../sso/saml",
  "idp_cert": "-----BEGIN CERTIFICATE-----..." }

# Claim a domain → the TXT record to add
POST /api/v1/sso/connections/:id/domains   { "domain": "acmebank.eu" }
# → { "dns_record": { "type": "TXT",
#       "name": "_nomos-sso.acmebank.eu", "value": "..." } }
POST /api/v1/sso/domains/:id/verify

# Everything configured, with the values for your IdP
GET  /api/v1/sso

Require SSO

Switch on require_sso for a connection and people at its verified domains can only sign in through your identity provider.

Password sign-in

Refused with SSO_REQUIRED; the sign-in page sends the person to your IdP.

Password reset

Sends nothing (the answer is the same as always, so it reveals nothing).

Google sign-in

Refused: Google proves the email, not your organisation.

New registrations at the domain

Refused: people come through SSO.

Open password sessions

Ended the moment enforcement is switched on.

API keys

Keep working so integrations do not break without warning; GET /api/v1/sso lists every key held by people at the domain so an admin can revoke them.

Organisation owner

Keeps password and two-factor sign-in: the way in if the IdP is down.

bash
PATCH /api/v1/sso/connections/:id
{ "require_sso": true }
# → { "id": 7, "ended_password_sessions": 12 }

Webhooks

Register an HTTPS endpoint to receive real-time event notifications. NOMOS delivers signed POST payloads with exponential-backoff retry (30s → 5m → 30m → 2h → 8h, max 5 attempts). Webhooks are on the Regulated plan.

Register an endpoint

Endpoints are managed from your dashboard at /settings/webhooks. Each endpoint has its own HMAC secret — never share it. You choose which event types each endpoint receives.

Delivery guarantee

NOMOS considers a delivery successful when your endpoint returns any 2xx status within 10 seconds. Non-2xx responses and timeouts are retried up to 5 times. After 5 failures the delivery is marked permanently failed — check your dashboard for the error log.

Respond quickly. Return HTTP 200 immediately on receipt, then process asynchronously. If your handler takes longer than 10 seconds NOMOS will retry the delivery even though you received it.

Payload envelope

json
POST https://your-server.com/webhook
Content-Type: application/json
X-NOMOS-Signature: t=1716300000,v1=a3f9c2d1...
X-NOMOS-Event:     decision.escalated
X-NOMOS-Delivery:  4f2a8b1c-...

{
  "id": "4f2a8b1c-...",
  "type": "decision.escalated",
  "created_at": "2025-05-21T10:30:00.000Z",
  "data": {
    "decision_id": "dec_abc123",
    "artifact_id": "art_xyz789",
    "outcome": "escalated",
    "assigned_role": "Compliance Officer",
    "sla_deadline": "2025-05-22T10:30:00.000Z"
  }
}

Event types

Subscribe to only the events you need. Each endpoint can subscribe to a different subset.

decision.created
A new decision entered the queue
decision.approved
Decision approved (auto or manual)
decision.rejected
Decision rejected
decision.escalated
Decision routed to human review
decision.sla_breach
SLA deadline passed without resolution
artifact.sealed
An authority artifact was sealed in Studio
artifact.published
Artifact published to the exchange
policy.attested
A third party co-signed a policy version (SPEC-004)
subscription.activated
Account subscription became active
subscription.canceled
Subscription was canceled
subscription.past_due
Payment failed — subscription at risk
exchange.purchased
Artifact purchased from the exchange
exchange.reviewed
Exchange artifact received a review

Register endpoint (curl)

bash
curl -X POST https://api.nomosprotocol.com/api/webhooks \
  -H "Content-Type: application/json" \
  -H "X-Nomos-Api-Key: nmk_live_..." \
  -d '{
    "url": "https://your-server.com/webhook",
    "events": [
      "decision.escalated",
      "decision.sla_breach",
      "artifact.sealed"
    ]
  }'

# → 201 Created
{
  "id": 42,
  "url": "https://your-server.com/webhook",
  "events": ["decision.escalated", "decision.sla_breach", "artifact.sealed"],
  "active": true,
  "secret": "whsec_live_..."
}

Signature verification

Every delivery is signed with HMAC-SHA256 using your endpoint secret. Always verify the signature before processing — this prevents replay attacks and forged payloads.

Signature format

The X-NOMOS-Signature header contains a timestamp and the HMAC:

X-NOMOS-Signature: t=1716300000,v1=a3f9c2d1...

The signed string is <timestamp>.<raw-body>. Reject payloads where the timestamp is more than 5 minutes old.

Verify signature (Node.js)

typescript
import crypto from 'crypto';

function verifyWebhookSignature(
  rawBody: string,
  signatureHeader: string,
  secret: string,
  toleranceSec = 300,
): boolean {
  const parts = Object.fromEntries(
    signatureHeader.split(',').map(p => p.split('='))
  );
  const timestamp = parseInt(parts['t'] ?? '0', 10);
  const received  = parts['v1'] ?? '';

  // Reject stale payloads
  if (Math.abs(Date.now() / 1000 - timestamp) > toleranceSec) return false;

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${timestamp}.${rawBody}`)
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(received, 'hex'),
    Buffer.from(expected, 'hex'),
  );
}

// Express handler
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const valid = verifyWebhookSignature(
    req.body.toString(),
    req.headers['x-nomos-signature'] as string,
    process.env.NOMOS_WEBHOOK_SECRET!,
  );
  if (!valid) return res.status(401).send('Invalid signature');
  const event = JSON.parse(req.body.toString());
  // process event.type ...
  res.sendStatus(200);
});

SDKs & MCP server

Use NOMOS directly from your AI agent via the Model Context Protocol — no HTTP client code needed. Works with Claude Desktop, Cursor, Windsurf, and Claude Code out of the box.

nomos-mcp (npm)

Available now

Official MCP server on npm. Run npx nomos-mcp. Exposes ask_by_context, find_authority, ask_authority, request_authority, act, verify_decision, generate_governance and detect_contradictions as AI-callable tools. No API key needed for the Exchange tools, act or the public demo artifacts.

@nomosprotocol/sdk (npm)

2.3

Official TypeScript SDK: can(), plus act(), accept(), issuer(), witness() and approver() for Acts. Auto-retry, typed errors, Node 20+. verifyChain() verifies locally. npm install @nomosprotocol/sdk.

@nomosprotocol/verify (npm)

1.2

The verifier on its own: verifyAct, verifyArtifact, verifySeal. Pure, no network, Node, browsers and edge runtimes; depends only on @noble/curves and @noble/hashes.

@nomosprotocol/signers (npm)

1.0

Signers whose keys never leave a KMS or HSM: AWS KMS, Google Cloud KMS, Azure Key Vault, and any HSM through remoteSigner. One encoding per signature, every signature verified before it is returned.

@nomosprotocol/cli (npm)

1.1

npx @nomosprotocol/cli dev starts a local relying party, issuer, witness and approver with labelled test keys. See Local sandbox & act().

nomosprotocol (PyPI)

0.1

NOMOS for Python 3.9+: the specification's reference verifiers, plus accept() (WSGI and ASGI), act(), witness() and issuer(). pip install nomosprotocol. For the hosted API, call REST directly.

OpenAPI spec

Available now

Full OpenAPI 3.0 spec — use with any code generator. Download from /api/v1/openapi.json.

bash
# Configure in Claude Desktop / Cursor / Claude Code:
# Add to your MCP settings (claude_desktop_config.json, etc.):
{
  "mcpServers": {
    "nomos": {
      "command": "npx",
      "args": ["-y", "nomos-mcp"],
      "env": { "NOMOS_API_KEY": "nmk_live_..." }
    }
  }
}

# NOMOS_API_KEY is optional — omit it to use public demo artifacts
# (pub_lending_v1, pub_refund_v1, pub_fraud_v1, pub_hr_leave_v1, pub_kyc_v1)

# Available MCP tools:
#   act                   — Take an action at a system that accepts Acts (SPEC-009)
#   ask_by_context        — Describe the act; NOMOS resolves the laws and asks each (keyless)
#   find_authority        — Find which Exchange authorities govern an action (keyless)
#   ask_authority         — Ask a public Exchange authority (keyless)
#   request_authority     — Ask for an authority to be added to the Exchange
#   verify_decision       — Check if a decision is allowed/denied/escalated
#   generate_governance   — Convert policies to a sealed .nomos artifact
#   detect_contradictions — Find contradictions between policy and behavior

ARI scoring methodology

The Autonomy Readiness Index (ARI) is a composite score measuring how ready an authority artifact is to safely authorize autonomous AI decisions. ARI ∈ [0, 1] — higher is better.

ARI = 0.35×LIS + 0.30×DRS + 0.20×GMS − 0.15×RES (clamped 0–1)
LISLogic Integrity Score

Measures internal rule consistency. Penalizes exception frequency, conflicts, decision depth, and undocumented rules. LIS = 1 − (0.30×exception_ratio + 0.25×conflicts + 0.25×depth + 0.20×undocumented).

DRSData Reliability Score

Measures data quality. Penalizes missing values, inconsistency, unstructured inputs, and latency. DRS = 1 − (0.35×missing + 0.25×inconsistency + 0.20×unstructured + 0.20×latency); when behavioral data is present, an exception-rate term is folded in.

RESRisk Exposure Score

Higher = more risk. Sums financial, reversibility, regulatory, and pattern penalties (capped 0–1). It enters ARI as a subtractive term (−0.15×RES), so exposure pulls readiness down.

GMSGovernance Maturity Score

Measures institutional controls. GMS = (owners + audit_trail + escalation + versioning) / 4, plus a small bonus (up to +0.15) for multiple owners holding decision authority.

Autonomy bands

autonomousARI ≥ 0.60

Artifact is ready for fully autonomous AI decision-making without human-in-the-loop.

bounded0.30 ≤ ARI < 0.60

Artifact can operate autonomously within defined bounds; escalates edge cases.

human_governedARI < 0.30

Insufficient data or too many contradictions for autonomous operation.

Example scores

json
{
  "artifact_id": "art_9f2c3d...",
  "ari_score": 0.74,
  "autonomy_band": "bounded",
  "component_scores": {
    "lis": 0.88,
    "drs": 0.91,
    "res": 0.18,
    "gms": 0.72
  }
}

Free ARI assessment

The AI Governance Readiness Assessment is a free, public tool that scores any AI system against the same ARI formula used in production NOMOS artifacts. No login required.

URLnomosprotocol.com/ari
Questions10 multiple-choice questions covering risk profile, policy coverage, data reliability, and governance maturity
OutputARI score (0–100), autonomy band, component breakdown (LIS / DRS / GMS / RES), top 3 gaps, shareable result
Auth requiredNone — fully public

Use case

Use the assessment to benchmark readiness before sealing a production artifact, identify which of the four ARI components is weakest, and share results with stakeholders to justify the investment.

Assessment components

Risk Profile4 questions→ RES

Decision domain, financial impact, reversibility, regulatory exposure

Policy Coverage2 questions→ LIS

Written policy maturity, frequency of gaps and contradictions

Data & Rules2 questions→ DRS

Decision rule documentation, volume of historical data

Governance Maturity2 questions→ GMS

Accountability ownership, audit trails and escalation paths

Contradiction type reference

Studio lists what a person must decide before sealing. Rules against rules: every pair is checked for a case both apply to with different decisions, found exactly and run through the evaluator that enforces the policy; overlaps the policy settles (a higher priority, the tie rule, a narrower exception) are counted, not listed. Policy against practice: measured from your decisions.

rule_overridehigh

The rules say

Refuse when the ID is not verified. Approve payments under 300 (higher priority).

What happens

amount = 299, id_verified = false: the policy approves it.

FIX

Confirm it is an intended exception, make the refusal apply here, or add a condition that separates the rules.

shadowed_rulehigh

The rules say

Refuse loans over 100,000. Approve loans over 50,000 (higher priority).

What happens

The refusal never decides a case: the approval always comes first.

FIX

Raise its priority, remove it, or confirm the other rule is meant to prevail.

authority_conflicthigh

The rules say

Regulation: refuse loans over 50,000. SOP: approve them (applied first).

What happens

loan_amount = 50,001: the SOP's rule decides.

FIX

Let the higher-ranking document prevail (recommended), or record why the lower one does.

precedence_ambiguityhigh

The rules say

Two rules, same priority, different decisions, under first-match resolution.

What happens

Only the order of the rules decides which applies.

FIX

Give one the higher priority, or separate their conditions.

de_jure_vs_de_factomedium

The rules say

Escalate loans over 10,000.

What happens

Decisions show escalation only above about 25,000.

FIX

Align practice to the policy, or update the policy. Better or worse is shown only with outcome data.

undocumented_behaviormedium

The rules say

No rule covers it.

What happens

Weekend applications are auto-approved.

FIX

Write it into the policy, or stop the practice. Better or worse is shown only with outcome data.

ghost_termmedium

The rules say

"High-risk applicants" require manual review.

What happens

Nothing defines high-risk.

FIX

Define the term with a measurable condition.

Contradiction response shape

json
{
  "summary": "2 issue(s) found across 14 rules: 1 rule collision(s), 1 undocumented behavioral rule(s). …",
  "rules_found": 14,
  "contradictions": [
    {
      "type": "rule_collision",
      "layer": "de_jure",
      "severity": "high",
      "description": "Rules "refuse_unverified_id" and "approve_small_payments": A rule that allows the action wins over a rule that would refuse it, and it is not a narrower exception to that rule. For amount = 299, id_verified = false, the policy will allow it."
    }
  ],
  "hidden_rules": [
    { "description": "Implicit auto-approve for VIP accounts", "frequency": 0.18, "confidence": 0.87 }
  ],
  "policy_gaps": [
    { "type": "missing_in_sop", "behavioral_rule": "customer_tier == "vip"" }
  ],
  "layer_divergences": []
}

.nomos file format

A .nomos artifact is a sealed JSON document. The schema is versioned — the runtime reads specific fields and ignores unknown ones. Every artifact, regardless of confidence tier, shares the same top-level structure.

Top-level fields

artifact_id
stringrequired

Unique artifact identifier. Assigned at seal time.

version
stringrequired

Semantic version of the rule set. Increment on each new sealed version.

domain
stringrequired

Decision domain this artifact governs. Used for routing in the agent registry.

confidence
stringrequired

DECLARED (policy-only) or CERTIFIED (triangulated against behavioral data).

issued_at
stringrequired

ISO 8601 timestamp of when the artifact was sealed.

owner
stringoptional

Email or identifier of the person who sealed the artifact.

rules
arrayrequired

Ordered array of rules. Evaluated in priority order at runtime.

contradiction_report
objectrequired

Result of pre-seal contradiction detection. Always clean in a sealed artifact — contradictions must be resolved before sealing.

readiness
objectrequired

ARI component scores at time of sealing. DRS and composite ARI are null for DECLARED artifacts.

seal
objectrequired

Cryptographic seal block. Computed last, covers all other fields. Verification fails if any field has changed.

Rule object (rules[])

id
stringrequired

Unique rule identifier within the artifact. Returned in runtime verdict as rule_id.

priority
integeroptional

default: 0

Evaluation order. Lower number evaluated first.

when
objectrequired

Condition tree. Root is an AND/OR operator node or a single condition object.

then
arrayrequired

Array of action objects executed when all conditions are satisfied.

Condition operators

eq / neqExact equality or inequality
gt / gte / lt / lteNumeric comparisons
in / not_inMembership in a list of values
containsString contains substring

Action types (then[].action_type)

allowdenyescalateflaghold
The seal covers the canonicalized document excluding the seal field itself. Any modification to any other field — including whitespace — invalidates verification. For the full normative specification including the sealing algorithm and verification procedure, see NOMOS-SPEC-001 ↗.

Full artifact example

json
{
  "artifact_id": "art_refund_dch_v1",
  "version": "1.0.0",
  "domain": "refund_management",
  "confidence": "DECLARED",
  "issued_at": "2026-05-30T09:41:00Z",
  "owner": "ops@example.com",

  "rules": [
    {
      "id": "high_value_escalation",
      "priority": 1,
      "when": {
        "operator": "AND",
        "conditions": [
          { "field": "amount",
            "op": "gt", "value": 2000 },
          { "field": "days_since_purchase",
            "op": "lte", "value": 30 }
        ]
      },
      "then": [
        {
          "action_type": "escalate",
          "target": "manager_approval"
        }
      ]
    },
    {
      "id": "standard_approval",
      "priority": 2,
      "when": {
        "operator": "AND",
        "conditions": [
          { "field": "amount",
            "op": "lte", "value": 2000 },
          { "field": "days_since_purchase",
            "op": "lte", "value": 30 }
        ]
      },
      "then": [
        { "action_type": "allow" }
      ]
    }
  ],

  "readiness": {
    "lis": 0.91,
    "drs": null,
    "gms": 0.68,
    "res": 0.12,
    "ari": null,
    "autonomy_band": null
  },

  "seal": {
    "hash": "a3f9c1d2e4b5f6c7...",
    "algorithm": "nomos-seal-v1",
    "sealed_at": "2026-05-30T09:41:22Z"
  }
}

Artifact lifecycle

An artifact moves through defined states from creation to deprecation. Transitions are one-directional — a sealed artifact cannot be unsealed. The runtime checks the current state before issuing any verdict.

draftDraft

Artifact is being built in NOMOS Studio. Rules can be edited, contradictions resolved, and thresholds adjusted. Not callable. The seal has not been applied.

activeActive

Artifact is sealed and callable. The runtime verifies the seal on every execution call. This is the only state in which verdicts are issued.

supersededSuperseded

A newer version of this artifact has been sealed. The prior version remains callable until explicitly deprecated — agents referencing the old artifact_id continue to work without interruption.

deprecatedDeprecated

Artifact has been manually retired. Still callable, but the runtime appends deprecated: true to every response. Agents can detect and act on the flag without a hard failure.

Versioning

Each sealed version is an independent artifact with its own artifact_id and seal. Version history is immutable. Your agent controls which version it calls by specifying artifact_id in the request. Rolling back is a matter of reverting that value.

Audit continuity

The execution log is never truncated on version change. Every call to every version is retained in the hash-chained audit trail. Regulators can reconstruct the complete decision history across all artifact versions for a given domain.

State transitions

bash
draft  ──→  active       (on seal)
              │
              ├──→  superseded   (new version sealed)
              │
              └──→  deprecated   (manual retirement)

Response — deprecated artifact

json
{
  "verdict": "allow",
  "rule_id": "standard_approval",
  "artifact_id": "art_refund_v1",
  "artifact_version": "1.0.0",
  "deprecated": true,
  "deprecation_notice":
    "Superseded by art_refund_v2.",
  "audit_hash": "c7d2e9f1a3b4..."
}

Deprecate via API

bash
curl -X POST \
  https://api.nomosprotocol.com/api/v1/artifacts/art_refund_v1/deprecate \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Superseded by art_refund_v2",
    "migrate_by": "2026-07-01"
  }'

Sealing algorithm

The NOMOS seal is a two-part cryptographic commitment. It proves the artifact content has not changed since it was sealed (integrity), and that it was sealed by a specific authority and no one else could forge it (authenticity) — both verifiable by anyone, offline, with a public key.

1

Canonicalize

The artifact JSON is serialized using JSON Canonicalization Scheme (JCS, RFC 8785). Field order, whitespace, and Unicode escaping are normalized to a deterministic byte sequence.

2

Hash

SHA-256 is applied to the canonical bytes, producing a 32-byte content hash stored in seal.hash. Anyone can recompute this offline to confirm the content is unchanged — no key needed.

3

Sign (Ed25519)

The authority signs { hash, signed_by } with its Ed25519 private key. The result is stored in seal.signature with the key id (seal.kid). Verification uses the matching PUBLIC key — which cannot forge a signature — so the seal is publicly verifiable without the secret.

4

Embed

The seal block (hash, signature, signature_algorithm, kid, signed_by) is written into the artifact. All other fields remain unchanged — the seal is a non-destructive overlay.

5

Freeze

The artifact file is written to disk and becomes immutable. Any subsequent modification — including whitespace — will cause seal verification to fail.

Verification

To verify a sealed artifact, offline: strip the seal and attestations fields, apply JCS, compute SHA-256, and compare against seal.hash (integrity). Then fetch the public key for seal.kid from /.well-known/nomos-signing-keys and verify seal.signature over {hash, signed_by} (authenticity). No secret, no call to NOMOS. Any mismatch indicates tampering or forgery. A ready-made verifier: verify-nomos.mjs <file> --url https://nomosprotocol.com.

The NOMOS runtime verifies the seal on every execution call before evaluating any rule. An artifact with a broken seal returns 403 SEAL_INVALID immediately. For the full normative sealing specification, see NOMOS-SPEC-001 ↗.

Sealing pipeline

bash
artifact_json
  │
  ├─ JCS canonicalize (RFC 8785)
  │      ↓
  ├─ SHA-256(canonical_bytes)
  │      → seal.hash
  │
  ├─ Ed25519.sign(private_key, JCS({hash, signed_by}))
  │      → seal.signature   (+ seal.kid)
  │      verify with the PUBLIC key — no secret
  │
  └─ write seal block → frozen artifact

Seal block

json
"seal": {
  "status":              "sealed",
  "canonicalization":    "JCS",
  "signature_algorithm": "Ed25519",
  "kid":                 "xgDEjI0EJ-lUAcu8",
  "hash":                "a3f9c1d2e4b5f6c7d8e9f0a1...",
  "signed_by":           { "name": "KHDA", "org_id": "27", "role": "owner", "timestamp": "2026-05-30T09:41:22Z" },
  "signature":           "MEUCIQD...base64..."
}

Tampered artifact response

json
HTTP/1.1 403 Forbidden
{
  "error": "SEAL_INVALID",
  "message": "Artifact seal verification failed.",
  "artifact_id": "art_refund_dch_v1"
}

Agents

Every execution request can carry an agent_id — a stable identifier for the calling agent. When an artifact's agents manifest is populated, the runtime checks the caller's identity, permissions, and deny list before evaluating any rule. This is the NOMOS-SPEC-002 runtime guard.

Why it matters

A sealed artifact without agent controls is callable by any process that knows the artifact_id. That works for single-caller deployments. In multi-agent pipelines — where a risk-scorer, a fraud-detector, and a compliance-checker all hit the same artifact — you need to express that the fraud detector can flag and escalate but can never auto-approve, and that the compliance agent logs at forensic level. Those constraints belong in the artifact, not in deployment configs that drift over time.

Permissive mode default

Artifacts sealed without an agents manifest run in permissive mode — any caller proceeds. This is a deliberate, auditable choice, not a gap. Every permissive call is tagged guard_mode: "permissive" in the audit trail. NOMOS Studio warns when sealing in permissive mode but does not block it.

Agents are part of the seal. Permissions, deny lists, and audit levels are cryptographically bound to the artifact hash. Changing an agent's permissions requires sealing a new artifact version.

Execution request with agent_id

json
POST /api/v1/verify
{
  "artifact_id": "art_1c76283d-fecc-4dd6-...",
  "agent_id":    "risk-scorer",
  "action":      "escalate",
  "inputs": {
    "consecutive_missed_installments": 4,
    "loan_amount": 25000
  }
}

Guard pass — response

json
{
  "verdict":    "escalate",
  "rule_id":    "rule-012",
  "guard_mode": "enforced",
  "guard_pass": true,
  "agent_id":   "risk-scorer"
}

Agents manifest

The agents field is a top-level object in the artifact, keyed by agent identifier. Each entry defines what that agent is allowed to do.

display_namestring

Human-readable label. Not used by the runtime.

permissionsstring[]required

Action names the agent may propose. Any action not listed is blocked. Maps to keys in execution.actions.

cannot_callstring[]

Explicit deny list. Blocked regardless of permissions. Evaluated before the allow list — cannot be overridden.

audit_level"minimal" | "standard" | "forensic"

Overrides the artifact's global logging level for this agent's calls. Defaults to standard.

authorityobject

RESERVED. Named authority overrides. Stored but not evaluated in v1.1.

output_contractobject

RESERVED. Required output fields for downstream propagation. Stored but not evaluated in v1.1.

constraintsSpecAgentConstraint[]

Input constraints evaluated by the runtime guard (Phase 5) before rule evaluation. Each entry: { field, operator, value }. Operators: lt lte gt gte eq neq. Missing field is skipped, not a violation.

Manifest example — loan artifact

json
"agents": {
  "loan-processor": {
    "display_name": "Loan Processing Agent",
    "permissions":  ["flag", "hold", "calculate"],
    "cannot_call":  ["auto_approve"],
    "constraints":  [
      { "field": "risk_score",   "operator": "lt", "value": 0.6 },
      { "field": "jurisdiction", "operator": "eq", "value": "US" }
    ],
    "audit_level":  "standard"
  },
  "compliance-reviewer": {
    "display_name": "Compliance Review Agent",
    "permissions":  ["auto_approve", "reject", "escalate"],
    "cannot_call":  [],
    "constraints":  [],
    "audit_level":  "forensic"
  }
}

Result

loan-processor can flag, hold, and calculate — but only when risk_score < 0.6 and jurisdiction = "US". It can never call auto_approve. compliance-reviewer can approve and reject with no input constraints, every call logged at forensic level.

Runtime guard

The guard runs six phases before rule evaluation. Each phase can pass, escalate (advisory mode), or block (enforce mode). The deny list — Phase 3 — always hard-blocks in both modes.

1
Manifest presence

No agents manifest → permissive pass-through. Emits guard_permissive event.

2
Agent registration

Is the agent_id registered in the manifest? Unregistered callers escalate (advisory) or block (enforce).

3
Deny listalways blocks

Is the requested action in cannot_call? Hard block in both advisory and enforce mode. Cannot be downgraded.

4
Allow list

Is the requested action in permissions? If not, block (enforce) or escalate with advisory tag (advisory).

5
Constraints

Evaluate each SpecAgentConstraint against the incoming request inputs. Missing field → skip. Violation → block (enforce) or escalate (advisory).

6
Audit level

Does the call include the audit context required by the agent's audit_level setting? Escalates if not met.

Modes

Advisory mode (default) — guard violations are tagged on the result but execution proceeds. Only Phase 3 hard-blocks. Use advisory mode during rollout to observe violations before committing to enforcement.

Enforce mode — all violations terminate execution. Set NOMOS_GUARD_ENFORCE=true on the runtime.

Deny list block — response

json
HTTP/1.1 403 Forbidden
{
  "error":       "GUARD_DENY_LIST",
  "phase":       3,
  "agent_id":    "loan-processor",
  "action":      "auto_approve",
  "message":     "Action 'auto_approve' is explicitly
                  forbidden for this agent."
}

Unregistered agent — advisory mode

json
{
  "verdict":          "escalate",
  "rule_id":          "rule-009",
  "guard_mode":       "advisory",
  "guard_pass":       false,
  "guard_phase":      2,
  "guard_reason":     "unregistered_agent",
  "guard_advisory":   true,
  "agent_id":         "unknown-bot"
}

Guard audit events

bash
guard_permissive           # Phase 1 — no manifest
guard_unknown_agent        # Phase 2 — agent not registered
guard_deny_list_hit        # Phase 3 — always blocks
guard_permission_denied    # Phase 4 — not in permissions
guard_constraint_violated  # Phase 5 — input fails a constraint
guard_audit_insufficient   # Phase 6 — audit context missing
guard_pass                 # All phases cleared

Permissive mode

An artifact sealed with no agents field — or with agents: {} — runs in permissive mode. Any caller proceeds. Every call is tagged and audited.

When to use it

Development & testing

Iterate on rules without managing an agent roster. All calls proceed; the audit trail still captures everything.

Single-caller deployments

When only one system ever calls the artifact and you trust it implicitly, permissive mode eliminates overhead with no practical risk.

Early-stage artifacts

Seal the policy logic first. Add agents after the pipeline topology is known. Permissive mode bridges the gap.

Migrating to enforced

Configure agents in NOMOS Studio Step 3 before sealing. Monitor guard_permissive event rate to understand your caller set. Seal a new artifact version with agents populated. Observe in advisory mode. Flip NOMOS_GUARD_ENFORCE=true when advisory logs show no unexpected violations.

Spec reference: Agents are defined in NOMOS-SPEC-002. NOMOS-SPEC-001 artifacts without an agents field remain fully valid under a SPEC-002 runtime — they run in permissive mode without modification.

Permissive mode — response tag

json
{
  "verdict":    "allow",
  "rule_id":    "standard_approval",
  "guard_mode": "permissive",
  "agent_id":   null
}

Migration path

bash
# 1. Add agents in Studio Step 3 → seal new version
#    (old artifact_id stays live — no breaking change)

# 2. Run advisory mode — watch the logs
NOMOS_GUARD_ENFORCE=false  # default

# 3. Check guard event distribution
GET /api/v1/artifacts/:id/audit
# look for guard_unknown_agent events

# 4. Once clean → enforce
NOMOS_GUARD_ENFORCE=true

Temporal rules

Each rule in a sealed artifact can carry optional valid_from and valid_until fields. Rules outside their active window are skipped — they never contribute to the verdict, but they are recorded in the audit trace as "expired".

Fields

valid_fromstring (ISO 8601 UTC)

Rule is inactive before this instant. Half-open: rule is active at valid_from.

valid_untilstring (ISO 8601 UTC)

Rule is inactive at and after this instant. Half-open: rule expires exactly at valid_until.

Interval semantics

The interval is half-open: [valid_from, valid_until). A rule with only valid_until is active from the beginning of time until that instant. A rule with only valid_from activates at that instant and never expires. A rule with neither field is unconditionally active (existing behavior — all SPEC-001/002 artifacts are unaffected).

Audit trace

Every skipped rule produces a trace entry with result: "expired". The audit trail records the complete rule set considered at each execution instant — including rules that were present but outside their window. This lets a verifier reconstruct which rules were live at the moment of any past decision.

Seal integrity: valid_from and valid_until are part of the sealed rule object. Modifying them after sealing invalidates the artifact hash. Time-bounded transitions should be authored before sealing, not patched after.

Deterministic replay

Pass execution_at in the request body to replay a decision at a specific historical instant. The runtime uses that timestamp for all temporal bound checks and returns replay: true in the response. execution_at must be ≤ now — future timestamps are rejected with 422.

Spec reference: NOMOS-SPEC-003 §3–7 ↗

Regulatory cutover — two rules, one artifact

json
// Rule active until 2026-01-01 (old threshold)
{
  "id": "legacy_threshold",
  "text": "Approve if amount <= 50000 (pre-2026 threshold)",
  "condition": { "op": "lte", "field": "amount", "value": 50000 },
  "action": "ALLOW",
  "priority": 10,
  "source": "policy",
  "valid_until": "2026-01-01T00:00:00Z"
}

// Rule active from 2026-01-01 (new threshold)
{
  "id": "updated_threshold",
  "text": "Approve if amount <= 35000 (2026 threshold)",
  "condition": { "op": "lte", "field": "amount", "value": 35000 },
  "action": "ALLOW",
  "priority": 10,
  "source": "policy",
  "valid_from": "2026-01-01T00:00:00Z"
}

Audit trace — expired rule recorded

json
// Execution on 2026-06-01 (after cutover)
"decision_trace": [
  { "decision_id": "legacy_threshold",  "result": "expired"  },
  { "decision_id": "updated_threshold", "result": "matched"  }
]

Replay — what verdict fired on 2026-01-01?

json
// POST /api/v1/verify-decision
{
  "artifact_id":  "art_7f3c9a...",
  "decision":     "loan_application_review",
  "inputs":       { "amount": 45000, "credit_score": 730 },
  "execution_at": "2026-01-01T00:00:00Z"
}

// Response
{
  "allowed":       false,
  "outcome":       "escalated",
  "ts":            "2026-01-01T00:00:00Z",
  "replay":        true,
  "expired_rules": ["updated_threshold"],
  "audit_hash":    "c9d6e3f0..."
}

Staleness signal

When an artifact has accumulated more than 500 executions since its last triangulation run, the runtime includes a staleness_advisory in the response envelope. The advisory is informational — it never changes the verdict.

Why it exists

An artifact is triangulated against real decision data at seal time. As decisions accumulate, the behavioral baseline ages. Drift can grow without triggering any observable error — the runtime executes correctly against sealed rules while reality quietly diverges. The staleness signal makes this invisible drift visible, giving you a fact to act on rather than a surprise to investigate.

staleness_advisory fields

triangulated_atstring (ISO 8601 UTC)

Timestamp of the last triangulation run.

decisions_since_triangulationinteger

Number of executions since the triangulation baseline was recorded.

thresholdinteger

The staleness threshold that was exceeded (default: 500).

recommendationstring

Always "consider_retriangulation".

When the advisory is absent

The advisory is omitted when fewer than 500 executions have accumulated since triangulation, or when the artifact was sealed in Quick Mode (policy-only, no behavioral data). Absence is not an error — it means the baseline is fresh or unavailable.

Non-blocking by design: The advisory is appended to the response envelope after the verdict is computed. It does not affect verdict, audit_hash, or any other required field. Your existing response-handling code is safe to ignore it until you're ready to act on it.

Spec reference: NOMOS-SPEC-003 §6–7 ↗

Response with staleness advisory

json
{
  "verdict":    "proceed",
  "allowed":    true,
  "artifact_id": "art_1c76283d-...",
  "ts":         "2026-06-24T14:00:00Z",
  "audit_hash": "a3f9c1d2e4b5f6...",
  "contradictions": 0,

  // Advisory present — delta exceeded 500
  "staleness_advisory": {
    "triangulated_at":              "2026-05-30T09:41:00Z",
    "decisions_since_triangulation": 503,
    "threshold":                    500,
    "recommendation":               "consider_retriangulation"
  }
}

Handling the advisory

typescript
const result = await nomos.verify({ artifact_id, action, inputs });

if (result.staleness_advisory) {
  const { decisions_since_triangulation, threshold } = result.staleness_advisory;
  // Log to your monitoring pipeline — or trigger re-triangulation
  console.warn(
    `Artifact stale: ${decisions_since_triangulation}/${threshold} decisions since triangulation.`
  );
  // Verdict is still valid — no need to block the caller
}

// Normal verdict handling
if (!result.allowed) escalate(result);

Composable artifacts

When the same rule lives in ten policies, changing it means editing ten places by hand — and the copies drift. Composition (NOMOS-SPEC-004 extends) lets one base artifact own the shared rules; a child carries only its overlay — the rules it overrides, adds, or removes.

How it resolves

Composition happens at build time: base + overlay are merged into a single self-contained sealed artifact whose flattened rules the runtime evaluates unchanged. You never need the base to execute or verify a child. The child records a composition provenance block (inherited / overridden / removed / local) pinned to the base version's seal hash.

Merge rules

overridesame id

An overlay decision whose id matches a base decision replaces it in place — priority and order preserved.

localnew id

An overlay decision with an id not in the base is appended.

removedid list

Base decision ids to drop from the child.

inheriteddefault

Everything else flows through from the base unchanged.

Change once, everywhere

When the base advances, each child is re-composed against the new base with its overlay re-applied: the updated shared rules flow in while the child's own overrides survive. Composed children land as unsealed drafts — a human seals them in Studio (the Registry never mints a seal).

Cross-tree contradiction detection: because base and overlay are flattened into one rule set, a child override that silently conflicts with an inherited base rule is caught before sealing.

Spec reference: NOMOS-SPEC-004 §1–2 → · Registry API: POST /api/v1/policies/:id/extend, GET /:id/composition, POST /:id/recompose

A child overlay

json
{
  "extends": {
    "artifact_id": "khda_teacher_base",
    "version":     "2.0.0",
    "seal_hash":   "a3f9c1d2e4b5…"
  },
  "overlay": {
    "decisions": [
      // same id as a base rule ⇒ override in place
      { "id": "min_experience",
        "when": "years_experience < 3",
        "then": [{ "type": "escalate", "role": "principal" }] }
    ],
    "removed":   ["police_clearance"],   // handled by our own HR system
    "variables": {}
  }
}

Frozen composition provenance

json
"composition": {
  "extends":     { "artifact_id": "khda_teacher_base",
                   "version": "2.0.0", "seal_hash": "a3f9…" },
  "parent_rule_count": 3,
  "inherited":  ["min_qualification"],
  "overridden": ["min_experience"],
  "removed":    ["police_clearance"],
  "local":      ["subject_specialization"],
  "composed_at": "2026-07-13T00:00:00Z",
  "warnings":   []
}

Attestations

The seal proves NOMOS issued an artifact and it hasn't changed. An attestation (NOMOS-SPEC-004) is a second signature — added by a different party (a regulator, auditor, or governing authority) — recording that they reviewed and stand behind one specific version.

How it works

The attester signs the artifact's seal hash with their own Ed25519 key. Anyone verifies the co-signature with the attester's public key — offline, no secret, no server call. The key is published in the same key set as seal keys (/.well-known/nomos-signing-keys), org-scoped entries carrying an org_id.

A verifier MUST check both

signatureEd25519

Verify the attester's signature against their public key (resolved by kid).

bindinghash

artifact_hash MUST equal the artifact seal.hash — this blocks replaying a genuine attestation onto a different (weaker) version.

Attestations never break the seal. They're added after sealing and are excluded from the seal-hash computation — the seal covers the artifact minus both seal and attestations. Appending or revoking a co-signature leaves the seal valid. Backward compatible: v1.0 artifacts have no attestations, so the hash is unchanged for every existing artifact.

Spec reference: NOMOS-SPEC-004 §3–4 → · Registry API: POST /:id/versions/:vid/attest, GET …/attestations, GET …/artifact (downloads the .nomos with attestations embedded)

An attestation, alongside the seal

json
"attestations": [
  {
    "attester":  { "name": "KHDA", "org_id": "27",
                   "role": "regulator" },
    "statement": "Reviewed and approved for AY2026",
    "artifact_hash":    "a3f9c1d2e4b5…",  // == seal.hash
    "artifact_version": "1.2.0",
    "algorithm": "Ed25519",
    "kid":       "butCZqTD1FWbWGc1",
    "signature": "MEUCIQ…",               // base64 Ed25519
    "attested_at": "2026-07-13T00:00:00Z",
    "revoked_at":  null
  }
]

The signed payload

text
# Ed25519 over the JCS canonical form of exactly:
{
  "artifact_hash":    "a3f9c1d2e4b5…",
  "artifact_version": "1.2.0",
  "attester":         { "name": "KHDA", "org_id": "27",
                        "role": "regulator" },
  "statement":        "Reviewed and approved for AY2026",
  "attested_at":      "2026-07-13T00:00:00Z"
}
# algorithm, kid, signature, revoked_at are NOT signed.

Revocation statements & lists

A seal proves the issuer produced an artifact and it hasn't changed. It says nothing about whether the issuer still stands behind it today. Revocation (NOMOS-SPEC-006) is the issuer saying, after the fact, that one specific sealed version should no longer be relied upon — a compromised signing key, an artifact sealed from corrupted data, a regulatory order to withdraw a ruleset. Distinct from a newer version superseding an older one: a deprecated-but-unrevoked version remains genuinely valid for verifying the decisions made under it.

Issuer-only, detached — same pattern as attestations

A revocation statement is never embedded in, or a mutation of, the sealed artifact — the seal must never need to change after sealing. It's signed by the exact key that sealed the version being revoked (kid must resolve to the artifact's own issuer key) — a third-party attester can only ever revoke their own attestation, never the artifact itself. Bound to one exact version by artifact_hash == seal.hash, so a statement genuinely revoking 1.2.0 can't be misapplied to 1.3.0.

Checking a version's standing

GET /.well-known/nomos-revocationslist

Signed, dated aggregate of every currently-active statement — sibling to the signing-keys endpoint. An empty list is a normal, signed response: "nothing revoked as of this timestamp."

REVOKEDresult

Distinct from a tampered/forged seal — the artifact is genuine, the issuer just no longer stands behind it.

uncheckedfail-open, never silent

Offline verification with no reachable revocation source still reports hash_match / signature_valid — but MUST surface an explicit notice that revocation was not checked, never represent that as "confirmed not revoked."

revoked / revocation_reason / max_age. The Exchange query path (nomos.can()) checks revocation before answering and surfaces revoked: true plus the issuer's revocation_reason when a version has been pulled. Responses on that path also carry max_age — how long a caller should hold a verdict before re-checking; absent it, treat the position as revocation-status-unknown, not safe to cache indefinitely. Disclosed gap: the authenticated execution path doesn't emit max_age yet — only the public query path does.

Spec reference: NOMOS-SPEC-006 → · Revocation list: GET /.well-known/nomos-revocations

A revocation statement

json
{
  "artifact_id":      "khda_teacher_licensing",
  "artifact_version": "1.2.0",
  "artifact_hash":    "a3f9c1d2e4b5…",  // == seal.hash
  "reason":    "Signing key rotated after suspected
                compromise.",
  "algorithm": "Ed25519",
  "kid":       "…",     // the ISSUER key that sealed it
  "signature": "…",
  "issued_at": "2026-08-25T00:00:00Z"
}

Offline verifier, no revocation source

text
$ node verify-nomos.mjs artifact.nomos --pubkey issuer.pem

[OK]   Payload hash matches
[OK]   Signature valid (Ed25519)
[WARN] Revocation not checked — no --revocations file
       supplied. This artifact's current standing with
       its issuer is UNKNOWN. Seal integrity does not
       imply the issuer still stands behind this version.

VALID (seal only — revocation unchecked)

Key certificates & chain verification

Every mechanism above resolves a key by looking it up somewhere the relying party already knows to ask — /.well-known/nomos-signing-keys, an org_id, this platform's own database. None of that helps an independent system with no prior relationship to the issuer — an artifact handed to it directly by an agent, never registered with NOMOS at all. A key certificate answers that: one key certifying that another is authorized to sign, resolved entirely offline against a root the relying party has already pinned — the same delegation pattern a browser uses against its certificate store.

How the walk resolves

Given an artifact, a presented set of certificates, and one root public key you supply, the verifier starts from the artifact's signing key and enumerates the candidate paths back to that root, tried in certificate-fingerprint order (rev. 1.8 §4.2a). Each certificate on a path is checked in a fixed order — key, kid, suite, signature, validity window, revocation, scope — and a path whose effective scope refuses the purpose is a failed candidate, so the next one is tried (rev. 1.9). The seal is checked against the key the selected path resolves. key_certs is a set, not a sequence: any presentation order reaches the byte-identical verdict, including tree-shaped sets that also certify witness and approver keys. A certificate's scope (e.g. industry:financial/lending, claim:budget_remaining, consent:MANAGER approver:jane, suite:WebAuthn-ES256) narrows monotonically down the chain: a link can tighten a constraint, never loosen one.

Distinguishable outcomes

ALLOWED200

Chain resolves to the pinned root; the artifact’s seal verifies against the resolved key.

ISSUER_NOT_RECOGNIZED403

The chain doesn’t connect the signer back to the root. A different or more complete chain may fix this.

KEY_REVOKED403

A key on the resolved path — root, intermediate, or leaf — was revoked by its own parent. Checked at every hop, not just the target: a revoked intermediate is dead on every path through it.

CERTIFICATE_REVOKED403

ONE delegation was withdrawn while the key remains valid under any other certificate it holds — a different, unrevoked certificate for the same key can still resolve this.

OUT_OF_SCOPE403

The issuer IS recognized, but wasn’t delegated authority over this artifact. Never collapsed into ISSUER_NOT_RECOGNIZED — the caller’s next move is different.

SEAL_INVALID422

The chain resolves fine, but the artifact itself was tampered with after sealing. Re-presenting a better chain won’t help.

No default root, ever. root_public_key_pem is required on every call — the relying party's own configuration, never sourced from anything in the request itself. This keeps "who operates a trust root" a decision the caller makes, not one NOMOS makes for them.

Spec reference: NOMOS-SPEC-007 (Draft) → · Endpoint: POST /api/v1/chain-of-trust/verify · SDK: nomos.can({ artifact, key_certs, root_public_key_pem, ...facts })

Draft, deliberately: exactly one implementation exists (this one). No interoperability claim is made until a second, independent implementation does — that's what publishing a Draft is for.

A key certificate

json
{
  "parent_kid": "V3HqL9zM2Nk4pQrT",
  "child_kid":  "8kR2Xw5dF7hJmN1s",
  "child_public_key_pem": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n",
  "scope":       "industry:financial/lending",
  "issued_at":   "2026-08-27T00:00:00Z",
  "expires_at":  "2027-08-27T00:00:00Z",
  "algorithm":   "Ed25519",
  "signature":   "MEUCIQD1a2b3c4…"
}

Presenting a chain

typescript
import { nomos, NomosIssuerNotTrustedError } from '@nomosprotocol/sdk';

// An artifact NOMOS has never seen or registered — handed to
// you directly by an agent, along with the certificates that
// vouch for whoever signed it.
try {
  const verdict = await nomos.can({
    artifact:             theArtifactYouWereHanded,
    key_certs:            theCertificatesTheyIncluded,
    root_public_key_pem:  yourPinnedRootKey,   // YOU decide this
    credit_score:         720,
  });
  verdict.verdict;             // 'AUTHORIZED' | 'DENIED' | 'ESCALATED'
} catch (err) {
  if (err instanceof NomosIssuerNotTrustedError) {
    // The chain itself never resolved — distinct from "rules said no"
    console.log(err.reason);
    // ISSUER_NOT_RECOGNIZED | KEY_REVOKED | CERTIFICATE_REVOKED
    // | OUT_OF_SCOPE | SEAL_INVALID
  }
}

Revocation & freshness staples

A resolved chain proves a key was validly certified. It says nothing about whether that certification still holds today — the same gap NOMOS-SPEC-006 closes for artifacts, one level down for keys. Section 5 of the spec adds two kinds of revocation, plus a way for a verifier with no revocation source of its own to still say something better than "I don't know."

Two kinds of revocation, deliberately distinct

Key revocation§5.1–§5.2

A key’s own parent withdraws its standing to sign ENTIRELY. Checked at every hop the walk visits, so a revoked intermediate is dead on every path a presenter might construct through it — not just the one that happened to be checked.

Certificate revocation§5.4

Withdraws ONE delegation while the key remains valid under any other certificate it holds — the difference between "this key is compromised" and "this particular grant was a mistake."

revocation_checked — how confidently it was actually checked

Every ALLOWED (and, once rule evaluation composes in, every AUTHORIZED/DENIED/ESCALATED) verdict carries revocation_checked. On this hosted deployment it's always "live" — can() always talks to an endpoint that holds its own revocation list. The tri-state exists for the pure reference implementation →, run standalone with no database behind it at all — the exact case this primitive was built for.

"live"

Every key on the resolved path was checked against a real revocation source.

"staple"

No source of its own, but every checkable key was covered by a short-lived, issuer-signed freshness staple — a "not revoked as of T" proof from the exact key that could revoke it. Never silently promoted to "live".

"unchecked"

Neither was available for at least one key (routinely the root itself — nothing certifies a root, so nothing but your own decision to un-pin it answers "is my root still good"). Always the WEAKEST result across every key checked, never the best.

A staple can only ever raise confidence, never substitute for a real check. If a verifier holds any revocation source — even an explicitly empty one — staples aren't even consulted, and nothing a presenter attaches can override a source that says a key IS revoked.

Spec reference: NOMOS-SPEC-007 §5 → · Mint a staple: POST /api/v1/chain-of-trust/freshness

A freshness staple

json
{
  "child_kid":   "8kR2Xw5dF7hJmN1s",
  "parent_kid":  "V3HqL9zM2Nk4pQrT",
  "as_of":       "2026-08-28T00:00:00Z",
  "valid_until": "2026-08-28T00:15:00Z",
  "algorithm":   "Ed25519",
  "signature":   "MEQCIF…"
}

Reading the disclosure

typescript
const verdict = await nomos.can({
  artifact:             theArtifactYouWereHanded,
  key_certs:            theCertificatesTheyIncluded,
  root_public_key_pem:  yourPinnedRootKey,
  credit_score:         720,
});

verdict.revocation_checked;
// "live"  — always the case on this hosted endpoint

// Signed by the SAME key that could revoke the kid —
// never a platform-wide key. This is what keeps freshness
// authority sitting exactly where revocation authority
// already sits, rather than centralizing it in one operator.