Skip to main content
TACAVAR
Build in Public

We Made Our AI Agents Dumber — Output Quality Doubled

Giving agents fewer tools, narrower context windows, and mid-tier models produced more maintainable, correct, and shippable output than fully-loaded frontier agents. Constraint engineering is the discipline nobody's naming.

The instinct when building AI agent systems is to add. More tools. Larger context window. The frontier model. Give the agent every capability it might need — why wouldn't you?

Our production data says: because it destroys output quality.

Over six months of running 12 production AI agents, the configurations producing the most correct, maintainable, and shippable output were the ones with the tightest constraints. Narrower context windows. Mid-tier models for routine tasks. Purposefully limited tool access. When we stopped optimizing for agent capability and started optimizing for correctness, output quality improved measurably.

A Show HN post in June 2026 — "I nerfed our coding agents on purpose" — validated what we'd already concluded. Someone else was running the same experiment and arriving at the same result. Constraint engineering is a discipline, and it has a name now.

The Inverted-U Curve

There's a relationship nobody graphs: as agent capability increases, output quality rises, peaks, and then declines. Three mechanisms explain the decline side.

**Context pollution.** Every additional token in the context window is a token the model attends to instead of the task. Before we constrained agent handoffs to three fields — what changed, what the next agent needs to know, what risks remain — agents dumped their full reasoning trail downstream. The downstream agent inherited the accumulated noise. Output quality degraded as the chain lengthened. The fix wasn't better prompting. It was less context.

**Tool availability bias.** An agent with 15 tools will use all 15 — not because all are necessary, but because the model optimizes for completeness over necessity. Every tool call adds surface area for errors and for hallucinating about outputs never actually received. Our constraint: each agent gets the minimum tool set for its role. The CEO agent has zero tools. It plans and delegates. Specialists get exactly what their scope demands.

**Model calibration failure.** Mid-tier models don't fail gracefully. They fail confidently — with fabricated tool names, hallucinated parameters, and plausible-sounding reasoning. We discovered our "heavy" profile was silently routing through a fallback chain to a local Gemma model. The response text looked correct. The model role-played being Claude when asked. Only tool-call tests — garbled Vietnamese tokens and hallucinated directory listings — exposed the truth. The models had been confidently wrong for an unknown number of sessions.

The lesson: a model that can't self-assess its limitations needs the architecture to decide what it handles, not the model itself.

The Experiment: Four Constraints

**Model tier routing.** Routine classification, data formatting, and simple decisions go to mid-tier models (Qwen-2.5 variants via DashScope). Hard reasoning and calibrated tool calling go to frontier models. Routing happens at invocation time, not inside the agent loop. No model evaluates whether it can handle a task. The infrastructure decides based on task classification.

**Narrowed context.** Agent handoffs moved from free-text to structured three-field format. Each run starts with exactly what it needs. Context bloat — the silent killer of agent accuracy — dropped to near zero.

**Limited tools.** Each of our 12 agents has a role-scoped tool set. The frontend engineer cannot execute database writes. The content writer cannot trigger deployments. Boundaries are enforced at the tool level, not the prompt level.

**Hard governors.** Token cap, time limit, circuit breaker. When an agent hits any boundary, it stops. No negotiated overrides. The agent declares what it produced and the system decides next steps.

Before / After

| Metric | Before Constraints | After Constraints | Driver | |---|---|---|---| | Correctness (auto-verified passes) | ~60% | >90% | Context constraint | | Maintainability (downstream rework rate) | High | ~50% reduction | Structured handoffs | | Shipability (zero human edits to deploy) | Baseline | >2× improvement | Role-scoped tool sets |

These aren't laboratory measurements — this is production telemetry across 12 agents, two swarms, and three droplets. We track what ships, what breaks, and what gets reworked. The direction and magnitude are unambiguous.

Constraint Engineering Is the Discipline

The dominant AI agent discourse frames the problem as capability — better models, more tools, larger context. This framing is wrong. The bottleneck isn't capability. It's reliability.

Constraint engineering flips the default. Instead of "what can this agent do?", ask "what should this agent not be allowed to attempt?" Instead of expanding context, shrink it. Instead of adding tools, remove them until the agent can only do what its role requires.

The 12-factor agents framework, published by Dex at HumanLayer and validated against our stack, encodes this across every factor. Own your context window. Own your control flow. Small, focused agents. The framework is a constraint engineering manifesto because that's what production agent architecture actually is.

Where do you still need capability? Hard reasoning and multi-step orchestration. Route those to the frontier model — and only those. The mid-tier model that can't self-assess is perfectly capable of routine classification. The frontier model that handles hard reasoning correctly is wasted on formatting JSON.

How to Apply This

Four changes, ordered by impact.

**One.** Audit your model routing. If one model handles every task, you're wasting capability on routine work and risking confabulation on hard work. Classify tasks by complexity. Route accordingly.

**Two.** Cut context windows. Stop passing free-text handoffs between agents. Pass structured handoffs — what changed, what's needed, what's risky. Three fields. Your agents don't need the narrative. They need the signal.

**Three.** Scope tools. Every agent gets the minimum set for its role. If an agent has a tool it doesn't need, remove it. Tool availability bias is real.

**Four.** Install hard governors. Token caps, time limits, circuit breakers. Agents produce cleaner output and fail faster — which is better than failing wrong.

---

FAQ

**Doesn't limiting model tier reduce output quality?**

No. It reduces capability for tasks routed to mid-tier models, but those are tasks the mid-tier model handles correctly. Routing everything to the frontier model reduces quality through context distraction and over-engineering — the inverted-U curve. The right model for the right task is better than the best model for every task.

**How do you decide which model gets which task?**

By classification at invocation time, never by asking the model to self-assess. Routine data formatting, classification, and simple API wrangling go to mid-tier. Multi-step reasoning, architecture decisions, and tasks where an error cascades go to frontier.

**Won't limiting tools make agents less autonomous?**

Yes — that's the point. Autonomy without correctness is expensive. Bounded autonomy — where the agent's scope is defined before execution — produces output you can ship without reviewing every line.

**Is this just "YAGNI" for AI agents?**

Partially. But it's also a specific response to model calibration failures that don't exist in traditional software. Mid-tier models will attempt tasks they can't handle rather than refusing. Traditional YAGNI doesn't have to prevent confident fabrications. Constraint engineering does.

---

Most AI systems optimize for speed. Tacavar optimizes for what compounds.

You built it. We optimize it.

*Read next: The AI Agent Infrastructure Stack — and Why LLM Routing Fails When Mid-Tier Models Pretend They Understand the Task.*

Related Reading

AI Agent Infrastructure: Prototype to ProductionLLM Routing Fails When Models Fake UnderstandingThe Post-Fable Moment: When the Developer Community Decided Agentic Hype Was OverRun AI Infrastructure for Less Than a Coffee Budget