Who it is forA repository owner who wants to choose which findings block merges and does not want agents to change that in their own PRs.
The problemDifferent repos need different tolerance for TODOs and secret patterns, and per-PR changes should not weaken the rules.
The outcomeA policy file on the default branch sets the preset, blocking checks, labels and comment behavior for every matching PR.
What you need first
- A GitHub repository with Actions enabled and permission to add a workflow file
- Node.js with npx available on your machine
- A Git working copy of the repository (the init command runs from its root)
- Permission to change branch protection settings if you want the check to block merges
Steps
- Copy examples/codex-guard.yml from the Codex Guard repository into .github/codex-guard.yml.
- Set
preset: balancedand list your agent-labels and secret-exclude-paths. - Commit the file to the default branch.
- Run
npx --yes codex-guard doctorto check the policy file.
Prompt for your agent
In the repository at <repo-path>, create .github/codex-guard.yml with `preset: balanced` and `comment-mode: replace`, then run `npx --yes codex-guard doctor`. Expected output: the policy file is accepted with no errors. Verify that the file is on the default branch and not only in a feature branch.
Caveat. The policy file only counts when it is on the default branch, so changes made inside an agent PR do not apply to that PR.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for Akimiya-z/codex-guard and "Set a per-repo gate policy agents cannot loosen"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer