← Back to Blog
EngineeringApril 6, 2026Updated August 7, 20267 min read

I built a governance layer for AI agents after watching them fail silently in production

In the last year, I've watched AI agents fail in ways that would have been catastrophic in regulated environments. A clinical triage agent that routed a patient to the wrong care pathway — no log, no audit trail, no rollback, no way to prove what happened or why. A financial reporting agent that executed a transaction based on stale data — silently. No error. No receipt. Just wrong output that passed downstream.

The problem isn't that the agents were bad. The problem is that there was nothing between the agent and the action.

What “governing” an agent actually means

A governance gate sits between the agent's intent and the action. Before the agent does anything, four questions must be answered:

  1. What is the risk tier of this action?
  2. Does it violate any policies?
  3. Is there a human override requirement?
  4. What's the rollback path if it goes wrong?

If any gate fails — the action doesn't execute. Fail-closed by default.

from dingdawg_loop import schedule_governed

@schedule_governed(
    agent_id="@hipaa-intake",
    cron="0 9 * * *",
    risk_tier="high")
def run_intake_agent():
    # This runs daily at 9am
    # If governance is unreachable → skipped, not silently executed
    return process_patient_intake()

What a governance receipt looks like

Every governed action produces a cryptographically signed receipt. This is what comes back after a patient record read:

{
  "receipt_id": "gov_1a2b3c4d5e6f",
  "agent_id": "@hipaa-intake",
  "action_type": "read_patient_record",
  "decision": "allow",
  "risk_score": 22,
  "explanation": {
    "primary_trigger": "read_only_access",
    "causal_chain": [
      "read_patient_record → read_only_access policy → +8pts",
      "cumulative_score=22 < 40 → decision=allow"
    ],
    "confidence": 0.98
  },
  "ipfs_cid": "bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi"
}

The explanation field is generated by an LNN (Liquid Neural Network) — a deterministic causal trace, not a black-box score. You can read it top to bottom and understand exactly why the decision was made. That matters when a regulator asks.

The regulatory context

This is where I have to correct something. An earlier version of this post pointed at Colorado SB 24-205 as the thing you were about to be measured against. It was repealed by SB 26-189 before it ever took effect, taking its duty of reasonable care, its algorithmic impact assessments and its NIST AI RMF rebuttable presumption with it. Two of the four requirements this section used to list were requirements of a law that never existed.

Here is what actually attaches, and under what. Colorado's ADMT regime under SB 26-189, from January 1, 2027:

  • Notice, before the fact, that a consequential decision is being made by an automated system
  • An explanation of that decision, and a route to correct the data behind it
  • A human appeal path
  • Records retained three years, enforced by the Attorney General with a 60-day cure period

And the EU AI Act's Article 50 transparency duties, which have applied since August 2, 2026: people must be told when they are interacting with an AI system, and synthetic output must be marked machine-readably.

Notice what survived the rewrite. The statute changed, the theory of liability changed, the dates changed — and every one of those obligations is still satisfied by the same artifact: a record of what the agent did, why, and what it was allowed to do. That is the argument for building the receipt rather than the checklist. Governance you can prove beats compliance you scheduled, because the proof survives a change in the law and the schedule does not.

Every governance receipt is that documentation. Not a PDF you generate once and forget — a live, pinned, cryptographically verifiable record of every action your agent took. The ipfs_cid in the receipt pins it to IPFS so it can't be modified after the fact, even by you.

The open-core model

The governance interface is Apache 2.0 on GitHub: github.com/dingdawg/governance-sdk. Fork it, audit it, run it locally. The LNN inference engine and IPFS pinning are cloud-tier — 25 free calls/day, $49/mo Pro.

The free tier is enough to instrument your most critical agent path and see governance receipts in real production traffic. The paid tier removes rate limits and adds IPFS pinning, receipt search, and webhook delivery for every decision.

Try it

Install in two lines. Claude Code / Cursor MCP config:

{
  "mcpServers": {
    "dingdawg-governance": {
      "command": "npx",
      "args": ["dingdawg-governance"]
    }}
  }}
}

Or Python: pip install dingdawg-loop

Score your agent against 12 governance primitives at dingdawg.com/harness.

DingDawg provides AI governance tooling and automated compliance assessment. This post reflects production patterns we've developed and is not legal advice. Consult qualified legal counsel for your specific regulatory obligations.

Instrument your first governed agent

pip install dingdawg-loop

25 free governed calls per day. No credit card. Full receipt on every action.