Phase 2: Control & Containment · ~60 minutes · Python (stdlib · layered cost-governor simulator)
Action Budgets, Iteration Caps, and Cost Governors
A mid-sized e-commerce agent's monthly LLM cost jumped from $1,200 to $4,800 after its team enabled the "order-tracking" skill.
Hiring signal: Can operate action budgets, iteration caps, and cost governors in production
Introduction
That is not a pricing bug. That is an agent that found a new loop and kept spending inside it. Microsoft's Agent Governance Toolkit (April 2, 2026) codifies the defense against this class: per-request max_tokens, per-task token and dollar budgets, per-day/month caps, iteration caps, tiered model routing, prompt caching, context windowing, HITL checkpoints on expensive actions, kill switches on budget breach. Anthropic's Claude Code Agent SDK ships the same primitives under different names. Financial velocity limits — e.g. cut access on >$50 in 10 minutes — catch loops faster than monthly caps.
Type: Learn Languages: Python (stdlib, layered cost-governor simulator) Prerequisites: Phase 15 · 10 (Permission modes), Phase 15 · 12 (Durable execution) Time: ~60 minutes
Objective
Learning objectives
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