{"openapi":"3.0.3","info":{"title":"NOMOS API","version":"1.0.0","description":"Ask a sealed authority whether an action is allowed: AUTHORIZED, DENIED or ESCALATED, with the rule that decided and a hash-chained record. /can answers for public Exchange authorities with no key; /verify-decision answers for your own sealed policies (the SDK's client.can()). Acts (NOMOS-SPEC-008) are verified by the system that commits them, with @nomosprotocol/sdk accept() and @nomosprotocol/verify, not by this API.","contact":{"name":"NOMOS Support","email":"support@nomosprotocol.com","url":"https://www.nomosprotocol.com"},"license":{"name":"Commercial","url":"https://www.nomosprotocol.com"}},"servers":[{"url":"https://www.nomosprotocol.com/api/v1","description":"Production"},{"url":"/api/v1","description":"This host"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Nomos-Api-Key","description":"An API key from the developer console (/console?tab=keys). A key made for one policy reaches only that policy."}},"schemas":{"Error":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string","example":"Missing artifact_id"},"code":{"type":"string","example":"INVALID_INPUT"}}},"Decision":{"type":"object","description":"POST /verify-decision. Recorded in Logs and hash-chained per artifact.","properties":{"id":{"type":"string","example":"req_5ba2abd6-18d1-439d-b1e6-ecc2b2082b19"},"object":{"type":"string","enum":["decision"]},"artifact_id":{"type":"string"},"artifact_name":{"type":"string"},"artifact_version":{"type":"string"},"allowed":{"type":"boolean","description":"True only when the outcome is auto_approved."},"verdict":{"type":"string","enum":["approved","rejected","escalated"]},"outcome":{"type":"string","enum":["auto_approved","auto_rejected","escalated"]},"rule_id":{"type":"string","nullable":true,"description":"The rule that decided; null when no rule applied and the sealed default decided."},"rule_description":{"type":"string","nullable":true},"verdict_description":{"type":"string"},"confidence":{"type":"object","description":"The policy's evidence tier, not a per-call probability.","properties":{"tier":{"type":"string","enum":["DECLARED","VALIDATED","CERTIFIED","PROVEN","SOVEREIGN"]},"score":{"type":"number"},"description":{"type":"string"}}},"audit":{"type":"object","properties":{"hash":{"type":"string","description":"This record's entry hash in the artifact's chain"},"timestamp":{"type":"string","format":"date-time"}}}}},"PublicVerification":{"type":"object","description":"POST /verify against a public demo artifact.","properties":{"allowed":{"type":"boolean"},"outcome":{"type":"string","enum":["auto_approved","auto_rejected","escalated"]},"outcome_code":{"type":"string"},"rule_id":{"type":"string","nullable":true},"rule_description":{"type":"string","nullable":true},"missing_inputs":{"type":"array","items":{"type":"string"}},"unrecognized_inputs":{"type":"array","items":{"type":"string"}},"audit_hash":{"type":"string"},"latency_ms":{"type":"number"}}},"AuthorityQuery":{"type":"object","description":"POST /can. The permanent transcript lives at `url`.","properties":{"query_id":{"type":"string"},"url":{"type":"string"},"verdict":{"type":"string","enum":["AUTHORIZED","DENIED","ESCALATED"]},"authorized":{"type":"boolean"},"reason":{"type":"string"},"rule":{"type":"string","nullable":true},"outcome_code":{"type":"string"},"missing_inputs":{"type":"array","items":{"type":"string"},"description":"Facts that would let the authority decide an ESCALATED query"},"unrecognized_inputs":{"type":"array","items":{"type":"string"}},"revoked":{"type":"boolean","description":"Present when the sealed version is revocable; a revoked version always answers DENIED"},"artifact":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"version":{"type":"string","nullable":true},"standing":{"type":"string"}}}}},"Document":{"type":"object","required":["filename","content"],"properties":{"filename":{"type":"string","example":"loan-policy.txt"},"content":{"type":"string","description":"Plain text or base64-encoded document content"},"source_type":{"type":"string","enum":["policy","email","spreadsheet","transcript"],"default":"policy"}}},"Contradiction":{"type":"object","properties":{"conflict_type":{"type":"string","enum":["threshold_mismatch","overlapping_range","precedence_ambiguity","rule_collision","ghost_term","de_jure_vs_de_facto","undocumented_behavior","outcome_divergence"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"rule_a":{"type":"string"},"rule_b":{"type":"string"}}},"AgentConstraint":{"type":"object","required":["field","operator","value"],"description":"A single input constraint evaluated by the runtime guard (Phase 5) before rule evaluation. Missing fields are skipped. Type mismatch on numeric operators is skipped.","properties":{"field":{"type":"string","description":"Input field from the execution request","example":"risk_score"},"operator":{"type":"string","enum":["lt","lte","gt","gte","eq","neq"],"description":"lt=<  lte=≤  gt=>  gte=≥  eq==  neq=≠"},"value":{"oneOf":[{"type":"number"},{"type":"string"},{"type":"boolean"}],"example":0.6}}},"AgentDefinition":{"type":"object","required":["agent_id"],"description":"Registers an agent in the artifact manifest. The runtime guard enforces these rules before rule evaluation.","properties":{"agent_id":{"type":"string","example":"loan-review-agent"},"display_name":{"type":"string","example":"Loan Review Agent"},"permissions":{"type":"array","items":{"type":"string"},"example":["READ_RULES","EVALUATE"],"description":"Actions the agent is allowed to invoke"},"cannot_call":{"type":"array","items":{"type":"string"},"example":["SEAL","MODIFY_RULES"],"description":"Actions explicitly denied regardless of permissions"},"constraints":{"type":"array","items":{"$ref":"#/components/schemas/AgentConstraint"},"description":"Input constraints evaluated in guard Phase 5"},"audit_level":{"type":"string","enum":["standard","full","none"],"default":"standard"}}},"AgentsManifest":{"type":"object","description":"Optional NOMOS-SPEC-002 agents manifest embedded in the sealed artifact. Governs which agents may query the artifact at runtime.","properties":{"manifest_version":{"type":"string","example":"1.0"},"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentDefinition"}}}}}},"paths":{"/artifacts":{"get":{"operationId":"listArtifacts","summary":"List public governance artifacts","description":"Returns all pre-built public governance artifacts. No authentication required.","tags":["Public Artifacts"],"responses":{"200":{"description":"Array of public artifacts","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}}}},"/artifacts/{id}":{"get":{"operationId":"getArtifact","summary":"Get a public governance artifact by ID","tags":["Public Artifacts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"pub_lending_v1"}],"responses":{"200":{"description":"Artifact details including rules and example inputs","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/can":{"post":{"operationId":"can","summary":"Ask a public authority: can I do this?","description":"The SDK's can({ authority, ...facts }). Public Exchange authorities need no key or account; a paid one not yet purchased answers 403 PURCHASE_REQUIRED with its price and purchase_url. Facts go at the top level, or under `inputs`; both give the same verdict. The same fact given two different values in both places is refused with 400 CONFLICTING_FACTS.","tags":["Verification"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["artifact"],"properties":{"artifact":{"type":"string","description":"Exchange slug or id of the authority","example":"eu-ai-act.nomos"},"action":{"type":"string","description":"What you are about to do, in words, for the transcript"},"inputs":{"type":"object","description":"Facts (alternatively, pass them at the top level)"}},"additionalProperties":true},"example":{"artifact":"eu-ai-act.nomos","action":"screen a new feature before launch","untargeted_facial_image_scraping":true}}}},"responses":{"200":{"description":"The verdict and its permanent transcript","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorityQuery"}}}},"403":{"description":"A paid authority not yet purchased (PURCHASE_REQUIRED, with price_usd and purchase_url)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such authority","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/verify":{"post":{"operationId":"verifyPublic","summary":"Verify a decision against a public artifact","description":"Check whether an AI decision is allowed, denied, or needs escalation. Uses a pre-built public artifact — no account required.","tags":["Verification"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["artifact_id","decision","inputs"],"properties":{"artifact_id":{"type":"string","example":"pub_lending_v1"},"decision":{"type":"string","example":"approve_loan"},"inputs":{"type":"object","example":{"amount":5000,"credit_score":720,"income_to_repayment_ratio":4.2}}}},"example":{"artifact_id":"pub_lending_v1","decision":"approve_loan","inputs":{"amount":5000,"credit_score":720,"income_to_repayment_ratio":4.2}}}}},"responses":{"200":{"description":"The verdict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicVerification"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/verify-decision":{"post":{"operationId":"verifyDecision","summary":"Ask one of your sealed policies","description":"What the SDK's client.can({ artifact_id, ...facts }) calls. Requires an API key; a policy-limited key reaches only its own policy.","tags":["Verification"],"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["artifact_id","decision","inputs"],"properties":{"artifact_id":{"type":"string","description":"Your sealed artifact ID from Studio"},"decision":{"type":"string","example":"evaluate","description":"What is being asked; the SDK sends \"evaluate\" unless given an action"},"inputs":{"type":"object","description":"Facts, named as the artifact reads them (GET /artifacts/{id}/schema)"},"decision_type":{"type":"string","description":"Limit missing-input advice to one domain of the policy (see /artifacts/{id}/schema)"},"caller":{"type":"object","properties":{"agent_id":{"type":"string"},"tool":{"type":"string"},"correlation_id":{"type":"string"}},"description":"Who is asking; shown in Logs and the console's Agents"}}}}}},"responses":{"200":{"description":"The verdict, recorded in Logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Inputs the artifact does not read (DATA_CONTRACT_VIOLATION); details.expected_fields lists the ones it does","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly verification limit reached (QUOTA_EXCEEDED)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/generate-governance":{"post":{"operationId":"generateGovernance","summary":"Convert policy documents into a sealed governance artifact","description":"Upload policy documents (and optional behavioral logs) to extract rules, detect contradictions, and produce a sealed .nomos artifact with an ARI readiness score.","tags":["Studio"],"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","organization","documents"],"properties":{"name":{"type":"string","example":"Loan Approval Policy"},"organization":{"type":"string","example":"Acme Bank"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"behavioral_logs":{"type":"array","items":{"type":"object"},"description":"Historical decision records for behavioral triangulation"},"domain":{"type":"string","description":"Industry or domain hint (e.g. lending, hr)"},"agents":{"$ref":"#/components/schemas/AgentsManifest","description":"Optional NOMOS-SPEC-002 agents manifest to embed in the sealed artifact"}}}}}},"responses":{"200":{"description":"Sealed artifact with ARI score","content":{"application/json":{"schema":{"type":"object","properties":{"artifact_id":{"type":"string"},"ari_score":{"type":"number","description":"Autonomy Readiness Index (0–1)"},"autonomy_band":{"type":"string","enum":["autonomous","bounded","human_governed"]},"rules_extracted":{"type":"integer"},"contradictions":{"type":"array","items":{"$ref":"#/components/schemas/Contradiction"}},"confidence_band":{"type":"string","enum":["DECLARED","VALIDATED","CERTIFIED"]},"agents_registered":{"type":"integer","description":"Number of agents embedded in the manifest (0 if no manifest provided)"}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/detect-contradictions":{"post":{"operationId":"detectContradictions","summary":"Detect contradictions between policy and behavioral logs","description":"Stateless analysis — no artifact is created. Returns contradiction types, hidden rules, and layer divergences between declared policy and observed behavior.","tags":["Analysis"],"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["documents"],"properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"behavioral_logs":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"Contradiction analysis report","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string"},"contradiction_count":{"type":"integer"},"contradictions":{"type":"array","items":{"$ref":"#/components/schemas/Contradiction"}},"hidden_rules":{"type":"array","items":{"type":"object"}},"layer_divergences":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/artifacts/{id}/schema":{"get":{"operationId":"getArtifactSchema","summary":"Get the input field schema for a sealed artifact","description":"Returns every input field the artifact expects — name, type, required flag, and a ready-to-use example_inputs object. Use this to build forms or validate payloads without reading rules manually.","tags":["Verification"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Sealed artifact ID (art_*)"}],"responses":{"200":{"description":"Field schema with example inputs","content":{"application/json":{"schema":{"type":"object","properties":{"artifact_id":{"type":"string"},"name":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean"},"description":{"type":"string"}}}},"required_fields":{"type":"array","items":{"type":"string"}},"example_inputs":{"type":"object"},"field_count":{"type":"integer"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Artifact not yet sealed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/artifacts/{id}/audit":{"get":{"operationId":"getArtifactAudit","summary":"Get the audit chain head for a sealed artifact","description":"Returns the current hash-chain head and recent decision audit trail entries. Store the chain_head hash for tamper-evidence verification.","tags":["Verification"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Audit chain head and recent entries","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Artifact not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/executions/{id}/verify":{"get":{"operationId":"verifyExecution","summary":"Verify a past execution record by ID","description":"Retrieve and re-verify a historical execution. Returns the original verdict, the rule that fired, and whether the audit hash is still intact.","tags":["Verification"],"security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"execution_id from a previous verify-decision response"}],"responses":{"200":{"description":"Execution record with audit hash verification","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Execution not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"tags":[{"name":"Public Artifacts","description":"Pre-built governance artifacts — no auth required"},{"name":"Verification","description":"Verify AI decisions against governance artifacts"},{"name":"Studio","description":"Create sealed governance artifacts from documents. Supports optional NOMOS-SPEC-002 agents manifest embedding."},{"name":"Analysis","description":"Stateless contradiction and gap analysis"}]}