Skip to content

Quality Gates

Quality gates define where human approval is required. As agents become more capable, gates prevent automation from bypassing critical checkpoints.

Requirements before code merges to main/production branches.

Standard: Passing tests, code review approval, no conflicts, docs updated.

AI-specific: Different requirements for AI-heavy PRs? AI assist vs. replace review? Disclosure required?

Requirements before deploying to environments.

Standard: Pre-deployment tests pass, security scan clean, performance benchmarks met, production approval.

AI-specific: Extra scrutiny for first deploy of AI-generated code? Automated rollback triggers?

Approval required before significant architecture changes.

Standard: Design doc approved, security review for sensitive areas, architecture review.

AI-specific: AI can inform but not decide architecture. Human approval required for AI-suggested design changes.

Controls around data access and modification.

Standard: Database migration reviewed, data deletion requires approval, PII access controlled.

AI-specific: AI-generated migrations need extra review. No direct AI access to production data.

CI/CD checks: Automated testing, coverage thresholds, security scanning, linting.

Branch protection: Required reviewers, status checks must pass, no direct pushes.

Required reviewers: Minimum approvals, specific approvers for specific paths, CODEOWNERS configuration.

Checklists: PR templates with required confirmations, security checkboxes, AI disclosure prompts.

Required human involvement:

  • Production deployments
  • Database migrations
  • Security-sensitive changes
  • Customer-facing feature changes

Cannot be automated:

  • Final deployment approval (critical systems)
  • Architecture decisions
  • Security exception approvals
  • Compliance sign-off
Risk LevelExamplesGates
LowDocs, tests, style fixesAutomated checks, single reviewer, auto-merge
MediumFeature code, non-critical bugsFull automated checks, human review, standard approval
HighSecurity, payments, data handlingEnhanced checks, senior reviewer, security review
CriticalAuth, encryption, complianceAll gates + security team + lead approval + staged rollout

Agents can: Run automated checks, flag issues, suggest reviewers, generate artifacts (changelogs, migration scripts).

Agents shouldn’t: Approve their own output, bypass human checkpoints, deploy to production without human trigger, grant elevated permissions.

  • Rubber-stamp gates: Approval always granted without review
  • Gate proliferation: So many gates people game them
  • Inconsistent enforcement: Gates apply sometimes but not others
  • AI gate avoidance: Routing AI code around tighter reviews
MetricQuestion
Pass rateAre legitimate changes passing?
Catch rateAre issues caught before production?
LatencyHow much do gates slow the process?
Bypass rateHow often are gates skipped?

Use these metrics to tune gates—neither too permissive nor too restrictive.