Brave New IA World
Post #003 — The AIRUP Series

The AI Governor Pattern

Multi-agent systems are powerful. They're also expensive. Meet the role that keeps them from burning through your budget while debating variable names.

Ricardo Costa ~12 min read

In the first post, I introduced the AI Governor as "a central agent responsible for controlling cost, preventing decision loops, and ensuring alignment with business value." In the second post, I hinted that SDD specs generate a lot of tokens. Now it's time to be honest about the elephant in the room: multi-agent AI pipelines are token-hungry by design, and someone needs to be in charge of the bill.

That someone is the AI Governor. This post explains what it does, why it matters, and why the economics of tokens are more interesting — and less terrifying — than they appear.

The Cost Problem Nobody Wants to Talk About

Let's start with some uncomfortable math. A typical AIRUP pipeline for a medium-complexity feature might involve:

That's roughly 125,000 tokens of output for a single feature. But output is only half the story. Each agent needs context — it needs to read the specs, the code, the test results, the review feedback. Context windows in multi-agent systems aren't shared; each agent loads its own. If you have six agents, each reading ~30,000 tokens of context per invocation, and each invoked 3-4 times across the pipeline, you're looking at 500,000-700,000 input tokens per feature.

Add a couple of iteration loops (draft → validate → feedback → re-draft) and you can easily hit one million tokens per feature.

"A million tokens sounds terrifying until you realize it costs less than a mediocre lunch. The real question isn't whether you can afford the tokens — it's whether you're spending them on the right things."

The Most Important Chart You'll See Today

Before we talk about how the Governor controls costs, let's establish a crucial piece of context: the price of intelligence is collapsing.

Date Model Class Cost per 1M Input Tokens Cumulative Reduction
Mar 2023 GPT-4 $30.00
Nov 2023 GPT-4 Turbo $10.00 -67%
May 2024 GPT-4o $5.00 -83%
Jan 2025 DeepSeek V3 $0.27 -99.1%
Jul 2025 Gemini 2.5 Flash $0.15 -99.5%

Read that last column again. In roughly two years, the cost of frontier-class intelligence dropped by 99.5%. That million-token feature pipeline? At March 2023 prices, it would cost ~$30. At today's prices, it costs less than $0.50. By 2027, it might cost pennies.

This isn't wishful extrapolation. It's driven by structural forces: open-weight models (DeepSeek, Llama, Mistral) commoditizing intelligence, hardware competition (NVIDIA vs. AMD vs. custom silicon), and fierce commercial competition among OpenAI, Google, Anthropic, and a dozen others. The deflationary pressure is accelerating, not slowing down.

The Storage Analogy

In 2005, storing 1 TB of data cost thousands of dollars. Companies built elaborate data retention policies, archival strategies, and cleanup scripts to manage storage costs. Today, 1 TB costs a few dollars per month — and nobody writes cleanup scripts for cost reasons anymore.

Token costs are on the same trajectory. The governance strategies we build today around cost will shift to latency and quality optimization tomorrow — but the architecture of having a Governor remains valuable regardless of what it's optimizing for.

So if token costs are plummeting, why does the AI Governor even care about cost? Because "cheap" and "zero" are different things. Even at $0.15 per million tokens, an ungoverned pipeline can burn through 50 million tokens debugging a circular logic problem that a human could resolve in five minutes. Cheap multiplied by waste is still waste. The Governor's job isn't to prevent spending — it's to prevent spending without progress.

Five Strategies the Governor Uses

The AI Governor isn't a single algorithm. It's a set of governance strategies that operate at different levels of the pipeline. Here are the five core patterns:

1. Tiered Model Routing

Not every task in a software development pipeline requires the same level of intelligence. Parsing a YAML file doesn't need GPT-4o. Deciding whether to use event sourcing vs. CRUD does.

The Governor maintains a task-to-model mapping that routes each sub-task to the cheapest model capable of handling it:

Task Type Model Tier Relative Cost
Spec parsing, field extraction, format validation Flash / Haiku $0.01
Boilerplate code generation, test scaffolding Sonnet / GPT-4o-mini $0.05
Complex architecture decisions, nuanced review Opus / GPT-4o / o3 $0.50
Format checking, ID uniqueness, traceability Zero LLM (deterministic) $0.00

In practice, 80% of pipeline tasks can run on models that cost 10-50x less than the frontier tier. The Governor's routing logic is simple: start with the cheapest capable model, escalate only if confidence is below a threshold or the task fails validation. This single strategy can reduce total pipeline cost by 60-70%.

2. Contextual Pruning

When the @tester agent needs to generate unit tests, does it need to read the full design document? The stakeholder analysis? The deployment topology? No. It needs the interface contracts, the validation rules, and the error codes. Everything else is noise.

The Governor performs role-aware context selection: for each agent invocation, it assembles a minimal context window containing only the artifacts relevant to that agent's task. This is essentially RAG applied to the process itself — not to external knowledge, but to the pipeline's own specification artifacts.

A secondary technique is progressive summarization. As each phase completes, the Governor generates a compact summary (500-1,000 tokens) that captures the key decisions and outcomes. Downstream agents receive the summary instead of the full document, unless they explicitly need details. A 20,000-token design document becomes a 800-token decision log — a 96% reduction in context cost.

3. Decision Caching

Once the architect decides "use PostgreSQL with event sourcing," that decision should never be re-derived. It becomes a fact in the pipeline's shared state — a few tokens of declaration instead of hundreds of tokens of analysis.

The Governor maintains a decision log: a growing list of resolved decisions, each with an ID, a timestamp, the deciding agent, and the one-line conclusion. When any agent's context is assembled, the relevant decisions are injected as facts, not questions. This prevents the most insidious form of token waste: agents re-deriving conclusions that were already reached three phases ago.

4. Deterministic Validation Gates

A significant portion of what today passes through LLMs can be validated with plain code. Consider these checks:

Each of these checks, done deterministically, costs zero tokens. Every validation that doesn't require an LLM is a validation that saves money, runs faster, and produces deterministic (reproducible) results. The Governor enforces a policy: deterministic first, LLM only when judgment is required.

In my experiments, roughly 40% of validation steps that initially used an LLM could be replaced with deterministic checks. That's 40% fewer LLM calls in the validation pipeline — for free.

5. Circuit Breaker & Early Termination

This is the Governor's most critical safety mechanism. Multi-agent systems have a well-known failure mode: the infinite refinement loop. Agent A produces output. Agent B reviews it and requests changes. Agent A revises. Agent B finds new issues. Repeat until heat death of the universe — or until you've burned through $50 debating whether a function parameter should be called maxRetries or retryLimit.

The Governor implements a circuit breaker pattern borrowed from distributed systems:

"The most expensive token is the one spent on a problem that needs a five-second human decision, not a five-thousand-token agent debate."

The circuit breaker embodies a deeper philosophical point: the Governor is not trying to eliminate human involvement. It's trying to invoke humans at the moments where human judgment has the highest leverage — and keep machines working on everything else.


Should We Invent a Language Only AI Understands?

A question I keep encountering when discussing token economics: "If tokens are the cost driver, why not compress the specs into a compact format that only AI agents read? A binary DSL. A symbolic notation. Something 10x denser than markdown."

It's a logical question with a seductive answer. And I think it's the wrong direction. Here's why.

SDD's core value proposition is human-readability. The entire point of specifications — as I argued in the SDD post — is that they create a contract between humans and machines. Specs live in the repository, get reviewed in pull requests, and serve as the authoritative description of what the system should do. If only machines can read them, you've lost the contract. You've created a black box that happens to be made of text instead of weights.

It solves the wrong problem. Token costs are dropping at 90%+ per year. A DSL that takes two years to design, standardize, and gain adoption would launch into a world where the problem it solves no longer exists. You'd be building an archival strategy for storage in 2026 — solving yesterday's constraint with yesterday's thinking.

We tried this before. It was called UML. The Unified Modeling Language was, in many ways, an attempt to create a formal, compact, machine-processable specification language. It had CASE tools, round-trip engineering, code generation. And it collapsed under its own complexity because humans found it too hard to maintain alongside code. An AI-only DSL would suffer the same fate — not because AI can't handle complexity, but because humans need to validate what AI produces, and they can't validate what they can't read.

The Hybrid Middle Ground

There is a pragmatic compromise: markdown with structured frontmatter. The body of the spec stays in natural language — human-readable, reviewable, living in git. But the header contains structured metadata (IDs, types, references, status) that agents parse deterministically, without spending tokens on interpretation.

This is roughly what the TOON format and Kiro's spec structure already do. It's not sexy, but it works: you get the readability of prose with the parsability of data.

The correct response to "specs use too many tokens" isn't to change the language — it's to change the process. Which is exactly what the Governor does: not fewer words, but fewer unnecessary readings of those words.

The Governor of Tomorrow

Here's my thesis about the future, and I'll state it plainly:

"In 18-24 months, the cost of tokens will be as irrelevant as the cost of disk storage is today. The Governor's role will shift from cost optimization to latency optimization and quality maximization. But the architecture — the governance layer, the routing logic, the circuit breakers — will remain identical."

Think about what this means for AIRUP:

Today, the Governor asks: "Can I run this task on a cheaper model?" Tomorrow, it asks: "Can I run this task on a faster model?" The routing table doesn't change — only the optimization axis.

Today, the circuit breaker fires on cost ceilings. Tomorrow, it fires on latency budgets: "This feature needs to be specced, built, and tested in 30 minutes. We've spent 20 minutes on the design phase. Time to converge."

Today, contextual pruning saves money. Tomorrow, it saves time — shorter contexts mean faster inference, which means faster pipelines.

The Governor is not a cost-cutting tool. It's a resource optimization layer that happens to optimize for cost right now because that's today's binding constraint. When the constraint shifts — and it will — the Governor shifts with it.

Why RUP Needs a Governor (And Agile Doesn't)

You might wonder: doesn't every multi-agent system need governance? Why is this specifically an AIRUP thing?

Fair question. Every multi-agent system benefits from governance. But AIRUP needs it more because of the process's inherent structure:

RUP has more artifacts. Nine disciplines, each producing documents, models, and specifications. That's a lot of tokens. An agile pipeline with a single user story and a test file generates orders of magnitude less context than a full RUP iteration with requirements specs, architecture documents, and traceability matrices.

RUP has more roles. The original RUP defines over 30 roles. Even AIRUP's simplified mapping has 6-8 agents. More agents means more context duplication, more inter-agent communication, and more opportunities for the kind of circular debates that burn tokens without progress.

RUP has more phases. Four phases with multiple iterations each. The specification artifacts evolve across phases — getting more detailed from Inception through Construction. Without governance, agents will re-read and re-process earlier-phase artifacts at full fidelity even when summaries would suffice.

In short: the more structured the process, the more it benefits from governance. A two-person startup vibe-coding a prototype doesn't need a Governor. An enterprise building a regulated financial system with full traceability absolutely does.

This is also, incidentally, why AIRUP doesn't compete with agile for small projects. AIRUP is designed for contexts where the overhead of governance is dwarfed by the risk of not having it.


Architectural Sketch

For those who think in systems, here's a simplified view of how the Governor fits into the AIRUP pipeline:

AI Governor — Governance Layer
Human
Intent & Decisions
Governor
Route · Monitor · Break
Agents
Execute & Produce

The Governor sits between the human and the agents. It doesn't do the work — it orchestrates, monitors, and intervenes. Every agent request passes through the Governor, which:

  1. Selects the model tier for the task (routing)
  2. Assembles the minimal context for the agent (pruning)
  3. Injects cached decisions as facts (caching)
  4. Runs deterministic validations before and after the LLM call (gates)
  5. Evaluates the output against convergence criteria (circuit breaker)
  6. Escalates to the human when needed (early termination)

The Governor also maintains a cost ledger — a running tally of tokens consumed per phase, per agent, per feature. This ledger is visible to the human at all times, providing transparency into where the budget is going. In my experiments, just making the cost visible changed behavior: agents that "knew" their cost was being tracked produced more concise outputs. Whether that's anthropomorphism or prompt engineering is a question I'll leave to the philosophers.

The Governor Is Not Optional

Let me close with a strong claim: any multi-agent system that operates without a governance layer is operating on borrowed time. It might work for demos. It might work for simple tasks. But the moment you scale it to real-world complexity — the kind that involves requirements traceability, architectural decisions, and iterative refinement — the absence of governance will manifest as unpredictable costs, circular reasoning, and quality variance.

The AI Governor is AIRUP's answer to this problem. It's not a luxury — it's the structural element that makes a heavyweight process viable in an age of per-token billing.

And here's the beautiful irony: RUP was abandoned because its overhead was too expensive for humans. AIRUP makes that overhead cheap by letting machines do it. But even for machines, "cheap" doesn't mean "free." The Governor ensures that the process's structure is a feature, not a liability — that every token spent produces value, and every loop that doesn't converge gets cut.

"RUP failed because humans couldn't sustain the process. Ungoverned AI agents will fail because they'll over-sustain it. The Governor is the equilibrium."

Next up: SDD Meets RUP — how specification formats (TOON, EARS, Kiro-style) map to the classical RUP artifacts, and why twenty-year-old process engineering turns out to be surprisingly good scaffolding for AI agents.

AI Governor Multi-Agent Systems Token Economics Cost Control AIRUP Circuit Breaker SDD Software Engineering
RC

Ricardo Costa

Software engineer exploring the intersection of classical software processes and AI-driven development. Currently pursuing a master's degree researching AIRUP — an AI-first approach to the Rational Unified Process.