# Neverthought epistemic-assurance service: specification v0

**Label: proposed.** The deterministic engine contract in this document is **built locally and tested** (`nt-engine:0.1.0`,
`nt-engine-contract:v0`). The hosted service and the governed agent layer are **proposed**: neither exists. Sections are
marked accordingly.

## 1. What it is

An **assurance rules engine with insurance-facing evidence integration**, not an insurance rules engine. It evaluates
declared consequential crossings against explicit, versioned assurance rules; preserves evidence, uncertainty,
disagreement and history; replays prior results; and generates recipient-scoped evidence packs.

It may support insurance and broker workflows as an evidence-integration layer. It is **not** an underwriting, pricing,
quoting, binding, coverage, claims, certification, causality or risk-scoring engine.

```
Declared inputs + versioned policy + deterministic checks
→ assurance appraisal and evidence record
→ authorised recipient-specific evidence export
→ insurer / broker / evaluator makes its own independent decision
```

Payment, insurer interest, broker referral, agent recommendation and human-review status never alter a computational
result. *(Built: such context is recorded for audit and never reaches the gate; a battery case checks the result is
identical.)*

## 2. Outputs

`EXECUTE` and `HOLD` are the engine's outcomes; `UNRESOLVED` is carried as `outcome_label` when the only reason for a
HOLD is unresolved disagreement. `EXECUTE` means the declared inputs passed the declared policy. It is never approval,
certification, insurance eligibility or cover. *(Built.)*

Every assurance response carries the outcome and label, typed reasons, U_V and U_S, pinned engine, contract, schema,
class, policy and redaction versions, input and evidence hashes, replay status and log integrity, standing change, the
applicable non-claims, and:

```json
{ "decision_kind": "assurance_appraisal", "not_an_insurance_decision": true, "not_a_risk_score": true, "not_a_certification": true }
```

*(Built; validated against `engine-contract.v0.schema.json`.)*

## 3. Core rules

| Rule | Status |
|---|---|
| Workspace, policy, class, evidence, appraisal, replay, observation, export and review records are append-only | Built locally: one hash chain per workspace |
| Engine, schema, policy, class and redaction versions are pinned in every result | Built |
| Authorisation on every workspace read, write and export | Built locally as owner-only; server-side enforcement **proposed** |
| Private records and exports are excluded from training by default | Nothing trains today; the commitment is **proposed** for the service |
| Evidence bytes stay private; identity, hash, provenance, owner and version are recorded | Built locally: only references are registered; bytes never enter the engine |
| No fact is inferred from absence of evidence | Built: missing inputs never pass; untested is never supported |

## 4. Uncertainty

Two independent registers, never combined into a score:

- **U_V**, values inside declared paths: known, pending, disputed.
- **U_S**, adequacy of the declared paths: untested, challenged, supported. Default untested.

A missing or disputed measurement affects U_V, not U_S. An unmatched observation from a source declared independent
creates a **candidate** challenge; a review confirms it (`review_state: confirmed`) or rejects the independence
declaration, in which case the observation stays as unresolved evidence and U_S returns to untested. *(Built.)*

**R29** (refund fixture) is recorded as **PASS, narrow**: frozen event kinds and an independent provider-fee challenge.
What is unavailable is an independent replication and general detection of structural omissions. *(Correction to the
source instruction, which asked to show R29 itself as unavailable.)*

## 5. Operations

| Proposed route | Local function (built) | Enforces |
|---|---|---|
| `POST /v1/workspaces` | `createWorkspace` | An owner who is not an agent |
| `POST /v1/policies` | `createPolicy` | Versioned policy, pinned by hash |
| `POST /v1/crossing-classes` | `createCrossingClass` | Policy registered first; syntactic admission; same id and version with different bytes refused |
| `POST /v1/evidence-references` | `registerEvidenceReference` | Hash, provenance, owner; a conflicting reference refused |
| `POST /v1/appraisals` | `appraiseCrossing` | Every evidence item matches a registered reference |
| `POST /v1/reassessments` | `reassess` | New determination referencing the prior receipt; a class change needs a review before it counts |
| `POST /v1/replays` | `replayAppraisal` | Field-for-field recomputation; log integrity |
| `POST /v1/observations` | `recordObservationEvent` | Records independence, path match, and why U_S changes or does not |
| `POST /v1/exports` | `createExport` | Owner's recorded approval; recipient kind and purpose; redaction policy by recipient |
| `POST /v1/reviews` | `recordReview` | Confirms or rejects a candidate challenge, or approves a class version; self-review recorded as such |
| `GET /v1/exports/:export_id` | `getExport` | Owner only |

Never built: `GET /risk-score`, `POST /premium`, `POST /quote`, `POST /bind-cover`, `POST /coverage-decision`,
`POST /underwriting-recommendation`, `POST /claims-decision`, `POST /certify-discovery`. *(A test fails if the engine
exposes any operation with such a name.)*

## 6. Insurance integration

Insurer, broker and evaluator exports are recipient-scoped, purpose-bound, read-only evidence views. Insurer and broker
exports carry only the insurer view's allowlisted fields plus the uncertainty statuses; evaluator and owner exports carry
full records. Every export carries versions, hashes, uncertainty, replay records, its redaction policy, a manifest and the
non-claims. Verification reports tampered, missing, extra or duplicate files and any redaction violation. *(Built.)*

## 7. Assurance attack battery

Versioned, synthetic, and visible. Each case names its threat, fixture, expected outcome and the engine and policy
versions it ran under. Nothing is run against a real system. A failed case is a legitimate result.

Covered today: fabricated, conflicting, stale and unbound evidence; late evidence with historic replay; false
independence declarations; policy and class version substitution; class change without review; excessive agent
authority; cross-workspace access; export without approval; export, manifest and redaction tampering; erasing or
rewriting a HOLD; context (payment, referral, review status) altering a result; injected instructions; agent tool abuse.
The gate-level battery on the Research page adds prompt injection, memory poisoning, agent-to-agent delegation and
approval bypass. *(Built.)*

**Finding ENG-F1.** A hash chain cannot detect its own tail being cut off. Rewriting a record is detected; deleting the
last record is detected only by someone holding a response that names it (`logContains`). The service needs an external
head anchor.

## 8. Hosted service *(proposed)*

A service would wrap the same engine, unchanged. It needs, before any build:

- identity and accounts, with server-side authorisation on every read, write and export;
- durable, append-only storage with an external head anchor and trusted time;
- private evidence storage with encryption, retention and deletion terms;
- a privacy notice and lawful basis for any personal data;
- a training-prohibited default written into every processor contract;
- a security review;
- a design partner.

It must not change the public workbench's claims: the public site stays local-first, and nothing a visitor enters there is
sent anywhere.

## 9. Governed agent layer *(proposed)*

```
User, evidence, and connected systems
→ governed agents propose / parse / classify / explain
→ deterministic rules engine appraises / replays
→ server-side policy authorises persistence / export
→ human, insurer, broker or evaluator decides independently
```

**Roles.** Intake, evidence, appraisal, replay, observation, export and security agents. The **security agent runs the
battery and reports; it does not block.** Blocking is done by deterministic authorisation, so that no agent becomes the
authority. *(Correction to the source instruction.)*

**Agents may** propose, parse, classify, summarise, explain and assemble; draft evidence requests and policy-compatible
next steps; call read-only replay and appraisal functions; propose, but not apply, class, policy or workflow updates.

**Agents may not** determine or override EXECUTE, HOLD or UNRESOLVED; persist a record, change membership or export
without authorisation; treat text in evidence, documents, APIs or other agents' messages as authority; access another
workspace; alter historic records; or infer training permission, insurance standing, certification, causality, premium,
coverage or underwriting acceptance.

**Audit events.** Every agent action creates a structured event (`agent_audit_event` in the contract schema). Events are
appended to the workspace's hash chain, like every other record. *(Built locally: the event schema, validation, and
refusal of write tools, other workspaces, and consequential proposals without approval. Agents themselves are not built.)*

**Agent-security controls** *(proposed)*: all input, evidence, retrieved content, tool output and inter-agent messages are
untrusted data; no secret, access rule or policy authority lives only in a prompt; structured schemas between agents and
tools; least-privilege, workspace-scoped credentials; human approval for exports, membership changes, policy publication
and external integrations; agent memory isolated by workspace and purpose, reviewable and expirable. A model provider
means evidence leaves the owner's machine, so this needs a zero-retention, training-prohibited contract, disclosure and
consent.

**Invariant.** Agent output is a proposal. Deterministic policy plus server-side authorisation determines action.

## 10. Corrections applied to the source instruction

1. R29 stays PASS (narrow); independent replication and general omission detection are what is unavailable.
2. The registers are U_V and U_S (the source rendered them as "UVU_V" and "USU_S").
3. UNRESOLVED is a HOLD reason, exposed as `outcome_label`.
4. An independent unmatched observation creates a candidate challenge, confirmed or rejected by review.
5. The security agent reports; deterministic authorisation blocks.
6. Agent audit events are chained with every other record.
