What you fill in and tick stays in this browser window only. Nothing is sent unless you ask for your result by email. It is gone when you close the page, so print your result.
For CTOs and tech leads whose team already writes code with Claude Code, Codex or Cursor. An agent can get around a rule in AGENTS.md. It cannot get around a gate in CI. The snippets are for GitHub Actions and pnpm. In GitLab CI every gate is the same command under script:.
AI writes all of our code today, and a senior is accountable for the result. Most snippets come from our public repository claude-code-production-starter, where you will find them in full.
1. Which gates do you already have?
Tick only what really blocks the merge. A gate that only reports does not count.
2. Ten gates with snippets
Lint blocks the merge
An agent ignores lint that only warns. Run it in CI and let it fail. When you bring a new strict rule into old code, record today's violations and let CI fail when their number grows.
- run: pnpm lint --max-warnings 0Type checking in strict mode
Agents like to change a type to any to make the code pass. Strict mode and a separate CI step stop that.
# tsconfig.json: "strict": true
- run: pnpm exec tsc --noEmitTests are required and prove something
A test that also passes on the main branch proves nothing. Changed source code needs a changed test, and that test must fail on the main branch and pass on yours. An exception (a pure refactor) is approved by a human with a label, not by the agent.
- name: Changed tests fail on base and pass here
if: "!contains(github.event.pull_request.labels.*.name, 'skip-red-proof')"
run: bash scripts/gate.sh red-proof "origin/${{ github.base_ref }}"Forbidden patterns
Some agent shortcuts can be found with a plain search: .only in a test, disabled type checking, disabled lint. Make them fail in CI.
- name: Forbidden patterns
run: "! git grep -nE '(it|test|describe)\\.only\\(|@ts-ignore|eslint-disable' -- src tests"Secret scan
A key in a commit is a problem even after you delete it, because it stays in the history. Scan before the commit (a hook) and in CI.
- uses: actions/checkout@v5
with:
fetch-depth: 0
- run: docker run --rm -v "$PWD:/repo" ghcr.io/gitleaks/gitleaks:latest git /repo --redactMigration guard
A database migration is not as easy to undo as code. A PR that changes migrations only passes with a label from a human. Running a production migration requires confirmation in the agent's settings.
- name: Migrations only with a label
if: "!contains(github.event.pull_request.labels.*.name, 'migration-ok')"
run: "! git diff --name-only origin/${{ github.base_ref }}... | grep -E '(^|/)migrations/'"Dependency check
The agent adds a package when the task needs it. Check that it has no known serious vulnerability and keep dependencies updated regularly.
- run: pnpm audit --audit-level high
# .github/dependabot.yml: package-ecosystem npm, schedule weeklyPR template with an AI section
A PR has to say how the change was checked and what the author did not do. The reviewer then knows where to look.
## How it was checked
- [ ] the gate is green, including red-proof
- [ ] no test was weakened, skipped or deleted
## What the agent wrote and what the author checked
<!-- Which parts the agent generated, what you went through line by line. -->
## Not doneReview rule
A change is approved by someone who did not write it. Rules for agents and CI are changed only by their owners, otherwise the agent loosens its own gates over time.
# .github/CODEOWNERS
* @your-org/team
/.claude/ @your-org/rules-owner
/.github/ @your-org/rules-owner
/AGENTS.md @your-org/rules-ownerProtected branch
Everything above holds only if the main branch cannot be bypassed. One summary check ci, a required PR, approval from the code owner, and the rules apply to admins too.
gh api -X PUT repos/YOUR-ORG/REPO/branches/main/protection \
-F 'required_status_checks[strict]=true' -f 'required_status_checks[contexts][]=ci' \
-F 'required_pull_request_reviews[required_approving_review_count]=1' \
-F 'required_pull_request_reviews[require_code_owner_reviews]=true' \
-F enforce_admins=true -F restrictions=nullMore tools for you
12 questions on rules for AI agents, CI checks and accountability. See where your team is today.
Rules in AGENTS.md, CI gates and hooks, review and measurement. Four weeks with snippets from our public repository.