KDD - Govern AI agents with deterministic gates. No LLM judging.

KDD is a template repo + method to govern AI coding agents. Write a contract, seal its tests by SHA256, and let 12 deterministic gates (pure Python stdlib, no LLM, no network) verify — so the agent that implements never judges "done."

Add a comment

Replies

Best
Hey PH — I'm Mauricio, the maker. I built KDD because the part of AI-assisted coding I trust least is the "done, tests pass" moment: the verification is as non-deterministic as the agent. A human reviews the diff, or the same model that wrote the code also grades it. Both can be fooled. What's different: the agent that implements is never the one that decides "this is good." You author the tests before delegating and seal their SHA256 into the contract. If the implementer rewrites a test to make it pass, the hash mismatches and a deterministic gate catches it — no LLM judgment involved. The whole verification path is 12 gates in pure Python stdlib, no network, no LLM, exposed as an MCP server with 14 tools and as reusable GitHub Actions. The feedback I'd most like: does the frozen-test model actually hold once the tests themselves need to evolve? And is the upfront cost of writing a contract before each task worth it for your team, or only for the risky ones? Happy to go deep in the comments.

the sha256 sealed tests is honestly such a clean move, basically removes any wiggle room for the agent to rationalize its own work. love that it's pure stdlib too, no extra dependencies to babysit.

 Thanks, Filiz! That's exactly the design goal, the hash doesn't care how convincing the rationalization is, it just doesn't match. And yeah, stdlib-only was non-negotiable for me: the whole point is a verification path an agent (or a supply-chain attack) can't quietly influence by pulling in a new dependency.

 Also shipped, closing the loop on "weak-seal advisory": scripts/audit_. It flags frozen oracles that the seal certifies as intact but that can't actually fail — assert True, no test functions, or a test file that never references the target at all. Advisory by design (warnings, exit 0) so it doesn't become a second gate; --strict if your team wants to enforce it. Contract: .

Pinned the SHA sealed tests idea straight away, that is exactly the missing piece in every AI agent loop I've seen. twelve deterministic gates run locally without the model second guessing itself feels like the right amount of guardrail. Going to wire it into our internal tooling this week.

 Thanks for the pin, Zeliha! That’s exactly why I built it—I got tired of seeing agents rewrite their own evaluation criteria to fake a 'success' state.

I'd love to hear how the integration goes with your internal tools this week. Please feel free to tear it apart and drop any feedback, edge cases, or friction points you run into. Super curious to know if the contract-first approach feels smooth for your team!

Would love to see a built-in dry-run mode that shows which of the 12 gates would fail on the current contract before any agent touches the code. Would make onboarding way smoother for teams adopting KDD and help catch weak test seals early.

 This is a great catch, Serap. You’re right—right now the 'engine' is there, but the 'mouth' (the CLI) is missing, and that's a hurdle for onboarding.

I’ve been looking into a preflight command that runs exactly what you described: validation for the current contract, coverage for all 12 gates (including the local-only ones), and a nice CLI summary. I’m also weighing adding a 'weak seal' advisory mode as a follow-up.

It's definitely moving to the top of the roadmap. I'd love to loop you in when the first preflight prototype is ready if you're interested in testing it!

 Shipped: scripts/. Full mode runs all 12 gates locally against the current repo and reports which would fail — before any agent touches the code:

python scripts/preflight.py

There's also a --contract <task> mode that scopes it to 3 checks on a single task contract (frontmatter, oracle seal, test_command) — useful when you're only touching one contract and don't want the full sweep. Contract: . Came directly out of this thread — thanks for pushing on it.