SDSection 7 →

Section 6 · Lesson 2

Verification Gates — Speed Without Sacrificing Safety

Harness AI velocity with hard-stop checkpoints: upstream spec and plan gates, downstream task and runtime gates, spec-first drift correction, and CI that makes quality mandatory.

"Your AI is unbelievably fast — but is it right? Gates turn governance from afterthought into guarantee.

Speed without the cliff

AI agents write code at mind-blowing speed — but velocity without verification can accelerate you toward a cliff. Verification gates harness that speed without sacrificing quality or product safety.

The agent's dilemma

The nail-biting trade-off: move at the speed of light vs make sure the thing actually works. Fast code built on a tiny misunderstanding is not a small bug — it accelerates the whole project in the wrong direction.

A philosophy of gates

The answer is not to slow the agent down. Build a smarter workflow: a verification gate is a hard stop, not a suggestion. The system cannot move forward until predefined conditions are met — governance as a guarantee from day one, not worry after launch.

Architect and executor

Stop asking the AI to be the genius architect. You set vision, constraints, and validate the blueprint. The AI becomes the perfect executor — incredible speed, always within safe, pre-approved boundaries.

Upstream gates (before code)

Spec gate locks the what and why — ambiguity here amplifies into flawed architecture and buggy code. Plan gate validates the how: human architects review the technical approach for soundness, compliance, and sensibility before implementation starts.

Downstream gates (implementation & runtime)

Task gate chops the approved plan into chunks small enough to review in one focused sitting — micro PRs, atomic and traceable. Runtime gate is continuous drift detection: does live behavior match the spec? Not a one-time checkpoint.

Spec is source of truth

Automated flows follow user journeys from the spec, capture evidence (logs, API responses), and compare to acceptance criteria. If there is a mismatch, you are forbidden from patching code first — update the spec, then align code. The spec leads; code follows.

Make gates unbreakable

Build gates into CI so they are unavoidable. Block merges without traceability to the plan; automate checks so quality is the path of least resistance, not a nice idea from a slide deck.

Fast and safe

Gates are not brakes on AI — they unlock its potential. You get agent speed on your terms. What becomes possible when you can build this fast and this safely?

The agent's dilemma

StrengthHidden cost
Speed & scaleContext drift — the agent forgets the original goal on long tasks
Autonomous gap-fillingSilent assumptions — filled-in instructions that are often wrong
Large batch changesQuality degrades as task size grows — whole projects can derail

Four verification gates

Upstream

Spec gate

Lock what & why — testable requirements, zero open clarifications, DO NOT constraints

Upstream

Plan gate

Validate how — constitution compliance, simplicity, contracts, local testability

Downstream

Task gate

Micro changes — atomic, verifiable, traceable to spec and plan

Downstream

Runtime gate

Continuous drift detection — live behavior vs acceptance criteria

Gate checklists

Spec gate

First line of defense — freeze intent before architecture (Spec Gate Checklist).

  • All acceptance criteria have verification
  • All success metrics are measurable
  • All assumptions are explicit
  • No [NEEDS CLARIFICATION] markers remain
  • All "do not" constraints are listed
Clarification Gate (Section 4) →

Plan gate

Architectural review before any implementation code.

  • Plan follows project technical rules (constitution.md / team standards)
  • Approach is simple and direct — no imaginary future-proofing complexity
  • Contracts with other systems defined up front
  • Clear instructions for how a developer tests on their own machine
constitution.md (Section 4) →

Task gate

Every agent-produced chunk — micro PRs only.

  • Atomic — one thing only; if you cannot say “correct” in one review sitting, split further
  • Provable — specific verification (test or command) included
  • Traceable — direct link to plan and spec (no orphan code)
/create-tasks (Section 2) →

Runtime gate — drift detection loop

  1. Run automated user flows defined in the spec
  2. Capture evidence — logs, API responses, UI state
  3. Compare outcomes to acceptance criteria
  4. On mismatch: update spec first, then code — never patch code alone
Runtime evidence with MCP (Section 5) →

Enforce gates in CI

  • ▸Block merge when tasks lack traceability links to requirements or plan
  • ▸Require verification commands to pass before merge
  • ▸Fail builds when clarification gate or spec checklist items are open
  • ▸Surface runtime drift alerts back to requirements.md, not silent hotfixes
Tier Two approval gates →

Practice

Check your understanding

A few minutes of recall now saves rereading later.

0 of 3 answered
  1. 1.A verification gate is…

  2. 2.Which item belongs on the spec gate checklist?

  3. 3.Runtime behaviour drifts from the spec. What comes first?