Phase 0: Agent Harness · ~90 minutes · Python (stdlib)
Capstone Lesson 25: Verification Gates and the Observation Budget
An agent harness without a verification layer is a wish in a trenchcoat.
Hiring signal: Can build capstone lesson 25: verification gates and the observation budget end to end
What you will learn
- Build a `VerificationGate` protocol with a deterministic `evaluate(call)` method.
- Compose budget, recency, whitelist, and regex gates into a chain with short-circuit semantics.
- Track every observation through an `ObservationLedger` keyed by tool and turn.
- Refuse a tool call when the cumulative observation budget would be exceeded.
- Surface a structured `GateDecision` record that downstream observability can ingest.
Introduction
This lesson builds the deterministic gate chain that decides whether a tool call is allowed to fire, how much of its output the agent is allowed to see, and when the loop has to stop because the agent has read too much. The chain is a function of small, named gates plus an observation ledger that tracks every token the model has been shown.
Type: Build Languages: Python (stdlib) Prerequisites: Phase 19 · 20-24 (Track A1: agent loop, tool registry, message store, prompt builder, model router), Phase 14 · 33 (instructions as constraints), Phase 14 · 36 (scope contracts), Phase 14 · 38 (verification gates) Time: ~90 minutes
Objective
Learning objectives
- Build a
VerificationGate protocol with a deterministic evaluate(call) method. - Compose budget, recency, whitelist, and regex gates into a chain with short-circuit semantics.
- Track every observation through an
ObservationLedger keyed by tool and turn. - Refuse a tool call when the cumulative observation budget would be exceeded.
- Surface a structured
GateDecision record that downstream observability can ingest.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers The Problem, The Concept, Build, Check Yourself, Key Terms & Next — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy