{"slug": "ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced", "title": "AI Audit Evidence, Part 11: Written Down Is Not the Same as Enforced", "summary": "A single-maintainer engineering team building a runtime for AI agents with write access to enterprise systems found that its CI contract's \"must\" language was unenforced, after a reader noted that deleting the PG_SNAPSHOT_REQUIRED flag from one test step's environment would let the suite skip and report green. The team moved the flag from step-level to job-level environment and added a pre-suite step that exits non-zero when PG_SNAPSHOT_REQUIRED is not '1', but acknowledged the guard and the thing it guards still live in the same file with no CODEOWNERS file or required reviewer on workflow changes. The episode, Part 11 of the AI Audit Evidence series, argues that a written requirement is only a description until something can turn the build red.", "body_md": "# AI Audit Evidence, Part 11: Written Down Is Not the Same as Enforced\n\nAI Audit Evidence, Part 11: Written Down Is Not the Same as Enforced We build a runtime that lets AI agents take real write actions inside enterprise systems: create a record, send a call to another service. Every action carries permissions, approvals, and a record someone can review afterwards. T\n\nhe earlier pieces in this series asked what a record can prove. This one asks a question one step earlier: what makes a sentence in a contract actually count? The short answer: writing it down is a description; only something that can turn the build red is a constraint. Between the two lie four layers, and each one was pulled out by a reader.\n\nA reader followed this thread for several rounds. At one of them he asked: Does the contract now name the skip-fails behaviour as a requirement, or does it describe the test and leave the enforcement implied? He was not questioning whether the thing should be done. He was asking whether the contract wrote it as a requirement or only as a status report.\n\nThat question stopped us, because the answer was embarrassing. Our contract said: A run that would skip it is a failure. It reads firmly, but it is a declarative sentence: it states a fact — if someone skips it, that is a failure. It does not say must.\n\nIt imposes nothing on any later edit. The problem with a declarative sentence is not that it is wrong. It is that it correctly describes only the day it was written. At that time the same section still called the concurrency test \"a guard to add when such a deployment exists\".\n\nThe test already existed. The contract lagged the code by one line, and a reader meeting it first would think the test was not built yet. Two things changed. One restored the fact the contract had lagged — the test is built, so it now says to extend it, not to write it.\n\nThe other mattered more, and it changed not the fact but the mood: a run that would skip it must fail; a lane that passes without running does not satisfy this section; a green lane may be read only as \"the property was exercised\". The rule that came out of that round: anything a reader might rely on cannot be written as a status report. A status report rots with the implementation, and it rots silently. With the wording fixed, the reader asked the next question: is 'a run that would skip must fail' enforced by the workflow itself, or written in the contract?\n\nAnother cut straight to the bone. A \"must\" in prose rots exactly the way a \"is\" does. We checked the CI. The flag lived in the environment of one test step.\n\nAnyone deleting that line would make the suite skip and the lane go green — on a requirement we had just written as \"must\". He had described that rot line for line. The fix was two minimal moves: the flag moved from step-level env to job-level env (PG_SNAPSHOT_REQUIRED: '1'); a step before the suite reads the same variable and exits non-zero when it is missing: - name: the snapshot case must not skip run: | if [ \"$PG_SNAPSHOT_REQUIRED\" != \"1\" ]; then echo \"::error::PG_SNAPSHOT_REQUIRED is not 1 - the snapshot case would skip and report green\" exit 1 fi Now the cheapest accident — deleting the flag — breaks the job instead of quietly falsifying a claim. After that step I felt settled.\n\nThe reader did not let us stay settled for long: The remaining gap is honest too: the guard and the thing it guards live in the same file, so a careless delete takes both. Right. The flag and its self-check both sat inside migration-consistency-postgres. One careless edit could remove both without that job turning red — it would simply stop checking itself.\n\nHe asked whether there was a CODEOWNERS file, or a required reviewer on workflow changes. The answer was no to both. There is no CODEOWNERS anywhere in the repo; branch protection is a server-side setting invisible from the checkout; and on a single-maintainer repository \"a required review\" is not something the owner can satisfy — GitHub will not let someone approve their own change. Adding a file that looks like protection and blocks nothing would be worse than adding none.\n\nWhat can actually go red is a different job that reads the file from outside: workflow-invariants: steps: - uses: actions/checkout@v5 - name: the snapshot lane keeps its flag and its self-check run: | set -eu f=\".github/workflows/ci.yml\" grep -q \"PG_SNAPSHOT_REQUIRED: '1'\" \"$f\" || { echo \"::error::the snapshot flag is missing from $f\"; exit 1; } grep -q \"the snapshot case must not skip\" \"$f\" || { echo \"::error::the snapshot self-check step is missing from $f\"; exit 1; } Delete either line from the job above, and workflow-invariants fails. But delete workflow-invariants itself, and nothing catches it. That is the last answer of this round, and the reader gave us the words: The recursion point is the real lesson: at some layer the check has to be a human reading a diff. We wrote that into the contract: a human reviewing the diff is not an optional fallback, it is the final layer of the chain.\n\nAnd the person needs a standard to compare against, not improvisation — the \"must fail\" line is in the contract, and the workflow points at it. A diff that removes the guard does not just look careless; it contradicts a written requirement. The same reader also asked whether the contract is hand-written or generated from the code it governs. Hand-written, and the sentences that matter cannot be otherwise.\n\nWhat can be pinned is pinned: protocol vectors live in the contract repo, byte-hashed and replayed by tests; a release gate refuses to let a release claim a capability with no implementer; a compatibility check resolves what the pinned submodule actually holds instead of trusting the table that names it. Those mismatches turn the build red. What remains is prose: no generator, no monitor, and the detector is the person reading it. The two fixes this round — the isolation assumption and the workflow self-guard — were both pulled out by a reader, which is exactly the proof: for these sentences, the last detector really is a person.\n\nEvery layer of this chain moves the check earlier and makes the failure louder. The last layer is still a person. So: if the last layer is always a person reading a diff, is the sentence in the contract constraining the code, or constraining the person who reads it? The two answers lead to different maintenance.\n\nThe first requires the sentence to change with the code. The second requires it to stop a person. We currently write for the second — as an obligation, checked by a human — but I am not sure that is the right one. Three branches of the same thread are still open.\n\nThey share a status: registered, not implemented. The idempotency key is enforced by the target. We mint an Idempotency-Key per logical call, but our own replay guard only fires when an effect row was recorded. A not_executed leaves no effect row, so the same call in the same conversation can be sent again; the target's dedupe is the only thing standing between the retry and a second write.\n\nThe receipt has no first-party producer. A target may declare basis=receipt, and we record the kind. But none of our own endpoints accepts Idempotency-Key, so KeelBase as a target keeps no record of what it accepted. The declaration slot exists (ToolCapabilityDeclarations.dedup, three-valued) and has no consumer.\n\nbasis does not reach the export. The read surfaces carry it (the claim list, the lookup history, the console); the six-column export has no column for it. The field exists so a reader can tell \"not there now\" from \"never accepted\" — and the export flattens it back into one word. All three are registered as remediation items (R-9 / R-10 / R-11), not planned deliverables.\n\nThey are listed here because this piece is about writing down not counting — and that applies to us too. The implementation described here comes from the open-source project KeelBase: https://github.com/rain6fish/KeelBase Drafted with an AI assistant. The system, the positions and the mistakes are mine.\n\n## Key Takeaways\n\n- •This one asks a question one step earlier: what makes a sentence in a contract actually count?\n- •This story was reported by **Dev.to** , covering developments in the**dev** space.\n- •AI advancements continue to reshape industries — read the full article on Dev.to for complete coverage.\n\n📖 Continue reading the full article:\n\n[Read Full Article on Dev.to →](https://dev.to/rain6fish/ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced-g8b)", "url": "https://wpnews.pro/news/ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced", "canonical_source": "https://ainexusdaily.vercel.app/article/2026-12-02-ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced", "published_at": "2026-12-02 00:48:42+00:00", "updated_at": "2026-12-02 01:45:10.880084+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "mlops", "developer-tools"], "entities": ["GitHub", "PG_SNAPSHOT_REQUIRED", "migration-consistency-postgres", "CODEOWNERS"], "also_reported_by": [], "takeaway": "Move a required-test flag from step-level to job-level environment and add a pre-suite step that exits non-zero when PG_SNAPSHOT_REQUIRED is not '1', so deleting the flag breaks the job instead of letting the suite skip and report green.", "recommendation": {"advice": "Enforce skip-fails requirements in CI, not prose: put the flag at job level and add a pre-suite check that exits non-zero when it is missing, so a careless delete turns the build red.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced", "markdown": "https://wpnews.pro/news/ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced.md", "text": "https://wpnews.pro/news/ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced.txt", "jsonld": "https://wpnews.pro/news/ai-audit-evidence-part-11-written-down-is-not-the-same-as-enforced.jsonld"}}