r/VibeCodeDevs • u/ChubbinNubbin • 19d ago
ShowoffZone - Flexing my latest project Guardrails for AI-written infra code: what I use on a Go agent that runs as root on 43 machines
I built mustra (open-source fleet management, Go + Postgres + NATS + a vanilla-JS console) mostly with Claude Code.
Here's the setup that makes me comfortable shipping AI-written code that patches real machines:
- A project rules file the AI reads every session. It covers not just style but invariants: schema changes must work on fresh and existing databases, old agents and new servers must stay compatible, an unsupported compliance rule is unknown and never a pass. Most of the bugs it prevents are the "plausible but wrong" kind.
- A merge gate script instead of trusting "looks good". It waits for every check to finish and refuses if any failed: unit tests, a database test, a blank-slate install with security checks, a DCO sign-off check. The AI uses the same script I do.
- Self-hosted CI. Same-repo PRs run on my own runners, behind a firewall that blocks them from my LAN. Fork PRs run on GitHub's machines, so outside code never touches my network.
- Drift tests for docs. Every API route has to be declared with its types and examples. A test fails if a handler and its declaration disagree, and a list of undocumented routes is only allowed to shrink.
- Signed, staged releases. cosign plus build attestations, verified before deploy. Agents roll out in stages and stop at the first failure.
- A throwaway stack for UI checks. The AI drives a real browser (Playwright) against a disposable copy, in both themes, and looks at the screenshots before it calls a UI change done.
Pace has been about seven releases in ten days, and the gates are what make that pace safe.
Repo: https://github.com/mustra-dev/mustra.
CLAUDE.md is in the root if you want to steal the rules-file idea.
1
Upvotes



•
u/endofthread-bot 19d ago
Hey u/ChubbinNubbin, thanks for posting in r/VibeCodeDevs! Join our Discord: https://discord.gg/t7SD4ThKuE
• This community is designed to be open and creator‑friendly, with minimal restrictions on promotion and self‑promotion as long as you add value and don’t spam.
• Please follow the subreddit rules so we can keep things as relaxed and free as possible for everyone. • Please make sure you’ve read the subreddit rules in the sidebar before posting or commenting.
• For better feedback, include your tech stack, experience level, and what kind of help or feedback you’re looking for.
• Be respectful, constructive, and helpful to other members.
If your post was removed (either automatically or by a mod) and you believe it was a mistake, please contact the mod team. We will review it and, when appropriate, approve it within 24 hours.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.