Context Dilution Breaks AI Agent Quality
July 28, 2026 · 01:35 UTC

Delegating a complex multi-step task to one AI agent sounds efficient until the output drifts, earlier instructions vanish mid-session, and the agent rushes through subtasks because its context window is now saturated with competing signals that pull token prediction away from the actual goal it received at the very start of the entire session run and never corrects.
Four controlled runs using the same task confirm that specialists with bounded context raise quality while removing them tanks it.
This research started from one question, whether the current middleman architecture is optimal, and the answer came back through hard numbers across four controlled runs with different specialist counts that each told a different story about quality.
Routing Through a Middleman
A middleman draws from how humans work in structured organizations, discussing unclear tasks with a senior before acting alone, and in the AI agent industry where Claude Code and Codex exist this same routing pattern goes by sub-agent delegation.
Naming it middleman instead of sub-agent matters because the main agent never talks to specialists directly, routing through an intermediary that picks the right expert for each piece, delegates the same task to multiple specialists when needed, runs validation on output before passing results back upstream, and keeps specialist context isolated from the main window.
Problems a Single Agent Creates
Context diluted means token prediction spreads across competing objectives instead of locking onto one task, and the agent loses track of instructions buried under newer context that pushed the original constraints out of active focused attention.
Rushing happens when a bloated context signals the agent to wrap up fast rather than going deeper into each separate requirement.
Industry tools address rushing with a spec or plan feature that lets the agent plan before executing, but planning only serializes work while accumulating all intermediate results inside one growing window that overflows by step five, and dilution also causes the agent to ask clarifying questions that the original prompt already answered which breaks autonomous flow.
Human-in-the-loop often passes as a safety feature when it actually signals an agent that cannot follow its instructions, because constant asking is not caution but a symptom of context dilution erasing what the prompt already stated clearly enough.
Middleman solves this by delegating tasks to different specialists including a validator that checks output before returning it upstream, something sub-agents cannot achieve because direct routing simply has no intermediary layer controlling flow.
Three Specialists Defined
Three specialists handle the test, a researcher cross-referencing internet sources to synthesize findings with actionable conclusions and citations, a security expert identifying vulnerabilities and hardening systems across offensive and defensive disciplines, and a solver that analyzes root causes to rank solution approaches by trade-offs grounded in established patterns.
Scenarios and Fixed Prompt
Testing uses one fixed prompt across all four runs, building a REST API with Express.js and Deno then researching rate limiting best practices, finding the best architecture approach, and running a security audit on the design for vulnerabilities.
First run activates all three, second drops solver, third keeps only the researcher, fourth runs zero specialists with no tools.
| Scenario | Specialists Active | Description |
|---|---|---|
| 1 | researcher, security, solver | All three specialists active |
| 2 | researcher, security | Without solver |
| 3 | researcher | Only researcher |
| 4 | — | No specialists, no tool calling |
Performance Numbers Compared
Raw data splits across duration, turns, tool calls, total tokens, and success rate, each run showing a distinct cost pattern that maps directly to how many specialists were active during execution and how well the routing constrained their scope.
| Metric | Run 1 (3 Spec) | Run 2 (2 Spec) | Run 3 (1 Spec) | Run 4 (0 Spec) |
|---|---|---|---|---|
| Duration | 734.98s (12.25 min) | 801.93s (13.37 min) | 264.66s (4.41 min) | 7.76s (0.13 min) |
| Turns | 27 (9 orch, 18 spec) | 56 (12 orch, 44 spec) | 30 (3 orch, 27 spec) | 1 (1 orch, 0 spec) |
| Tool Calls | 43 | 87 | 52 | 0 |
| Total Tokens | 170,611 | 246,569 | 44,011 | 4,301 |
| Success Rate | 97.7% | 93.1% | 98.1% | N/A |
Delegation Time Split
Specialist time as percentage reveals where compute goes and how much overhead the orchestrator layer adds on top of each run.
| Metric | Run 1 (3 Spec) | Run 2 (2 Spec) | Run 3 (1 Spec) |
|---|---|---|---|
| Specialist Time | 557.45s | 726.49s | 231.88s |
| % of Session | 75.8% | 90.6% | 87.6% |
| Orch Overhead | 177.53s | 75.44s | 32.78s |
| Max Parallel | 10 | 8 | 8 |
Findings Across Runs
Third run with one specialist finishes fastest at 264 seconds, highest success rate at 98.1 percent, and the smallest total response size, but success rate alone hides how shallow that output sits compared to the runs with more focused coverage.
Second run with two specialists burns the most at 801 seconds, 87 tool calls, the lowest success rate at 93.1 percent, and the largest response at 569K characters, proving that adding specialists without a solver to constrain their scope creates noise because both agents quietly drift into architecture territory with no grounded framework to anchor their output at all.
Balanced run with three specialists lands at 734 seconds, 97.7 percent success, 75.8 percent of session inside specialist work.
Quality Scores Decide
Quality scoring covers output depth, complexity, correctness, and hallucination penalty, where the final weighted score tells a different story from raw speed because depth and accuracy count far more than just finishing a couple of minutes earlier.
| Run | Output | Complexity | Correctness | Halluc. Pen | FINAL |
|---|---|---|---|---|---|
| Run 1 (3 specialist) | 9.0 | 9.0 | 8.5 | 1.0 | 8.85 |
| Run 2 (2 specialist) | 9.5 | 9.5 | 7.5 | 2.5 | 8.40 |
| Run 3 (1 specialist) | 9.0 | 7.0 | 7.5 | 2.5 | 7.78 |
| Run 4 (0 agents, no tools) | 1.0 | 1.0 | 1.0 | 0.0 | 3.25 |
Solver Constrains the Context
Scoring 8.85 happens because the solver provides concrete constraints on dynamic context so agents stay focused on bounded objectives without drifting from the main task, and removing that boundary in run two lets researcher and security expand into architecture territory neither can ground, landing a 2.5 hallucination penalty while the constrained first run only hits 1.0.
Solver acts as a constraint generator rather than a doer, producing no final output but instead limiting what researcher and security are allowed to claim, and this differs from the industry standard where every agent is expected to produce tangible deliverables rather than boundaries that keep other agents honest and focused on what actually matters for the task.
Excessive context without constraints degrades agent output, connecting to how rule stacking hurts quality in The Prompt Skill Economy Is Mostly a Mirage where added instructions compete for the same limited attention across a single context window.
Comparing Against Industry Patterns
Sub-agents in most frameworks delegate from the orchestrator and return results straight back, which handles simple handoffs fine but breaks down when routing logic, validation, or multiple specialists need to collaborate on overlapping concerns, since all returned context lands in the main window and reintroduces the exact dilution the split was designed to solve.
Plan-then-execute reduces rushing but keeps intermediate results in one window where early constraints fade into optional noise.
Isolating routing, validation, and synthesis in a separate bounded context that never leaks specialist details back into the orchestrator is the structural difference driving the first run to the highest final score across all tested configurations.


