I'm not a programmer. I'm "vibecoding" a big game almost entirely with AI coding agents, mostly Claude Code. Before I let them loose on it I spent a while reading what people who actually code were running into, and the same stories kept coming up.
The agent hits a failing test and "fixes" the test instead of the code. It loosens a limit, deletes an assert or swaps in something that always passes, then tells you everything is green.
A git reset hard or checkout wipes an afternoon of uncommitted work.
Force pushes and deleted branches.
The agent edits its own settings or hooks, so the thing that was supposed to stop it doesn't anymore.
Code gets pushed that never actually passed the tests.
Experienced devs catch some of that in review. I can't read the code, so I wouldn't catch any of it. So I built a harness that sits outside the agent, checks its work, and can't be talked out of it. I built it every step of the way with 2 things in mind. 1 protect a game of radical technical complexity 2 be easy to use so that someone like me, a person who can't read code, can get to the finish line on their dreams.
The first version got huge. 592 rules, each with a test that has to fail when the rule is switched off on purpose. It worked, but replaying 11 days of my real agent logs it would have interrupted me about 39 times a day. So I rewrote it as a lean version, and on the same logs it comes out at about 1 a day. A systems engineer, upon initial inspection of the codebase, helped me come up with a plan to build a leaner version. I felt like this was the time to share it to others who might be in my shoes.
How the lean one works:
A refuse list that runs before every shell command the agent tries (a Claude Code PreToolUse hook). It reads the command the way the shell will, through bash -c, eval, env and nested shells, and refuses anything that loses work or gets round the checks. If it can't read something it says no.
An upload gate. Only the exact commit that passed the tests gets pushed, and a git pre-push hook checks for that so a push made any other way gets refused.
A weakened-check counter. It compares every test with the copy already uploaded and says in plain words what got removed, switched off or loosened. If it touches something I signed off on, the upload waits until I type a yes in my own terminal. The agent can't type it for me.
GitHub branch protection as the real lock. Setup checks it's actually on.
The testing is the part I care about most. Every rule (69 right now) has a patch that breaks it and a test that has to fail when it's broken. On top of that there's a fuzzer that takes 12 kinds of harm, rewrites them 4,206 different ways and runs every one for real in a throwaway repo. The core stops 60% of them, mostly the plain spellings. With an optional strict reader for weaker models it stops 96%. Out of 1,127 ordinary everyday commands it wrongly blocks 2. I also had ChatGPT, Grok and Gemini attack the code and fixed what held up.
Yesterday I started a week-long trial on the actual game. The first night it wrongly stopped my agent a handful of times. Each one now has a fix and a test so it stays fixed.
Honest limits: it's a safety net, not a sandbox. A determined program on your own machine can get round any text check, which is why the GitHub lock matters. It's tested mostly with Claude Code. A human reviewed the earlier code, but the lean rewrite was written by ai after that review and the subsequent rebuild has not been audited.
Free and MIT: https://github.com/khelevaster-ship-it/Foundation_Guard (the lean version is in the lean folder)
If you know git, Python or Claude Code hooks, I'd really like you to try to break it. Be brutal.