docs(prd): anti-hallucination contract for agent writes

Operator requirement (2026-07-11): mechanical measures against
hallucinated values in agent-performed edits. Four deterministic
layers in agent-architecture: (1) no free-text critical fields —
code copies values from validated extraction/bank-feed payloads,
the model never re-types them; (2) provenance anchors per critical
field {source_sha256, raw_excerpt} re-verified by a deterministic
checker against re-extracted source text (locale-normalized);
(3) cross-system corroboration against FRESH bank pulls + arithmetic
/checksum invariants; (4) read-back closes the loop. A failed check
refuses, never repairs. Woven into hub goal, C1 strategy, and QA
write-path (seeded-wrong-value fixtures must FAIL). Proven live:
the books-regularization pack shipped with a standalone
verify-provenance checker — 36 field-level checks green against
source PDFs + fresh Qonto/Wise feeds before the human gate.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-07-11 17:41:56 +02:00
co-authored by Claude Fable 5
parent 8e4186dbeb
commit 58968135d0
4 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ Each challenge states what breaks, the mitigation strategy, and the **residual**
## C1 — Extraction reliability
**Breaks:** a hallucinated amount, date, or IBAN lands in the books; supplier PDFs vary wildly in layout and quality.
**Strategy:** deterministic validators on every payload (arithmetic, VAT-rate whitelist, SIREN/IBAN checksums, date plausibility); **dual independent extraction** with exact agreement required on critical fields; confidence thresholds with refuse-and-escalate (an "I can't read this" is a *good* output); quarantine queue instead of best-effort guesses; per-field accuracy measured on a golden set before any autonomy ([QA strategy](qa-strategy.md#golden-datasets)).
**Strategy:** deterministic validators on every payload (arithmetic, VAT-rate whitelist, SIREN/IBAN checksums, date plausibility); **dual independent extraction** with exact agreement required on critical fields; **provenance anchors on every written field** — the value must be mechanically re-findable in its source document or bank feed, or it cannot be promoted ([write contract](agent-architecture.md#anti-hallucination-contract-for-agent-writes)); confidence thresholds with refuse-and-escalate (an "I can't read this" is a *good* output); quarantine queue instead of best-effort guesses; per-field accuracy measured on a golden set before any autonomy ([QA strategy](qa-strategy.md#golden-datasets)).
**Residual:** two models can agree on the same wrong value (same-family bias) — mitigated by picking *diverse* extractor families and by the human approval card showing the source PDF side-by-side.
## C2 — ERP write integrity