Building Agent Harnesses Part 2: Guardrails, maxAttempts and fixing agents that lie about task completion
TejasKumar_ · x · 2026-09-20
Part 2 of the 'How to Solve Problems with Harness?' series by Tejas Kumar and Vinen walks through building a harness step by step to fix agents that claim tasks are done when they aren't.
Key points:
- Methodology: define the task clearly, ensure the agent can discover and verify problems itself, then set minimal boundaries so it stops instead of looping forever.
- Guardrails: cap agent rounds and manage context window limits, with full code; the post discusses whether guardrails help with hallucinations.
- Fixing the lying problem: using maxAttempts plus explicit verification (e.g. checking whether an upvote actually succeeded) so the agent can confirm real completion.
- Fixing login: implementing a createLoginHandler, deciding where it belongs, plus full debugging, bug fixing, and re-run logs.
- Includes concrete index.ts and Harness.ts implementations and the Compact strategy.
A hands-on, code-heavy agent engineering walkthrough; the authors even give a shout-out to DeepSeek.
More from coding & agent
- WindTunnel benchmark: WebMCP makes browser agents 2.5-7.5x faster, 3-47x cheaper — FinanceYF5 · 2026-09-20
- Jev picks tools but can't generate text—Mercury 2.5 fills parameters at 1000+ tokens/sec — FinanceYF5 · 2026-09-20
- underclass pools multiple ChatGPT/Copilot subs behind one OpenAI-compatible local endpoint — airesearch12 · 2026-09-20
- Engineer's rant: at big company, everyone just feeds prompts to Claude Code all day — anshulkundaje · 2026-09-20
- The age of orchestration: pi-subagents (3.7k stars) for one-agent-many-subagents workflows — solyarisoftware · 2026-09-20
- Single HTML file adds weighted prompt randomization and consistency locks for ComfyUI — klartreumer · 2026-09-20