agent harness cost economics
Thoughtworks: optimize AI agents on cost per successful task, not cost per token ThoughtworksTL;DW
- Cost per outcome = (tokens per attempt × price per token) ÷ success rate; harness optimizes both tokens per attempt and success rate, not just token cost alone.
- Cheaper models often fail due to lower success rates; hallucinations compound across tasks (75% accuracy over three tasks = 42% average), making cheaper models economically unviable.
- Identical tokenizers between models produce vastly different costs; GPT-4o cost 5.5× more than Opus 3.5 all-in despite similar list prices due to tokenizer design and reasoning token billing.
- Prompt engineering is obsolete; models now absorb complexity automatically. Focus shifted entirely to harness—tooling, context handling, tools design, and memory—where Anthropic spent more optimization effort than on prompts.
- Context compaction (summarization, semantic signaling, offloading to markdown, sub-agents, context editing) reduces tokens without degrading answer quality; Anthropic found 29% improvement with context editing alone.
- Poka-yoke your tools: harden tooling contracts between deterministic systems and non-deterministic agents rather than relying on model prompts; tools are more impactful than system prompts.
- Memory dramatically improves agent quality; cross-session context access boosted quality 10% beyond context editing alone (29% → 39%), essential because models forget by design after ~5 minutes.
- Model routing and cascading architectures move rule-mining to cheaper ML models once traces are captured; unloading expensive model sessions often costs more than continuing on expensive model.
- Business value must justify token spend; a developer requesting 150,000 tokens must explain business value generated, not just token volume; this reframes procurement from cost minimization to outcome maximization.
- Governance and cost controls belong in platform layers behind harnesses, not in token quotas; "radical extensibility" means every employee builds custom UIs/apps, so core platform governance becomes critical.
TL;DW
- Cost per outcome = (tokens per attempt × price per token) ÷ success rate; harness optimizes both tokens per attempt and success rate, not just token cost alone.
- Cheaper models often fail due to lower success rates; hallucinations compound across tasks (75% accuracy over three tasks = 42% average), making cheaper models economically unviable.
- Identical tokenizers between models produce vastly different costs; GPT-4o cost 5.5× more than Opus 3.5 all-in despite similar list prices due to tokenizer design and reasoning token billing.
- Prompt engineering is obsolete; models now absorb complexity automatically. Focus shifted entirely to harness—tooling, context handling, tools design, and memory—where Anthropic spent more optimization effort than on prompts.
- Context compaction (summarization, semantic signaling, offloading to markdown, sub-agents, context editing) reduces tokens without degrading answer quality; Anthropic found 29% improvement with context editing alone.
- Poka-yoke your tools: harden tooling contracts between deterministic systems and non-deterministic agents rather than relying on model prompts; tools are more impactful than system prompts.
- Memory dramatically improves agent quality; cross-session context access boosted quality 10% beyond context editing alone (29% → 39%), essential because models forget by design after ~5 minutes.
- Model routing and cascading architectures move rule-mining to cheaper ML models once traces are captured; unloading expensive model sessions often costs more than continuing on expensive model.
- Business value must justify token spend; a developer requesting 150,000 tokens must explain business value generated, not just token volume; this reframes procurement from cost minimization to outcome maximization.
- Governance and cost controls belong in platform layers behind harnesses, not in token quotas; "radical extensibility" means every employee builds custom UIs/apps, so core platform governance becomes critical.
Nate Shuta and Chris Kramer present the formula: cost per outcome = (tokens per attempt × price per token) ÷ success rate. Harness design—context compaction, tool hardening, memory persistence, sub-agents—drives reliability more than model selection; cheaper models often raise hallucination rates and negate token savings.
