IBM’s Tejas Kumar builds a coding-agent harness, the software that runs the model’s tools and sets its limits, in a live AI Engineer workshop.
Start with the two loops
- The outer loop takes input and keeps the conversation. The first version forgets Kumar’s name as soon as he restarts the program.
- The inner loop asks the model what to do next. If the model requests a tool, the program runs it and returns the result before asking again.
- A file reader lets the agent answer from the actual
package.json. A registry of tool descriptions, input rules, and handlers gives it more ways to act.
Decide what the agent is allowed to do
- Once shell access can change the demo repo, the harness adds approval gates for writes, edits, and commands. On the next deletion request, Kumar says no and the executor stops.
- The demo also sets a budget of 25 model calls and 300,000 input and output tokens per task. The permission refusal is clear on stage; the exact budget cutoff is less clearly demonstrated.
- A terminal confirmation is a start. The tool runner still needs to check the target and arguments, and tests should prove that a refused action never runs.
Keep the next request small enough to afford
- Cap large tool results and tell the model how to request a smaller slice. Reuse the unchanged prompt prefix across calls. Summarize older history before it crowds out the current task.
- Kumar sets compaction at 90,000 input tokens because Haiku 5.5’s API rates rise fivefold above 100,000. That setting is specific to the example.
- The demo’s logger shows $0.0247 without caching and $0.0089 with it. The model takes different tool paths, so the two runs do not measure savings on identical work.
Give each phase its own brief
- A lead agent can hand off one task to a fresh worker, read its short result, and decide what happens next. Kumar demonstrates this with two file line counts.
- The reported 29% versus 85% long-job success figures are a Daiku forecast, with a retry in the phased design. The live demo shows that the handoff works, not that it achieves those success rates.
Swap the model or the tools without rewriting the loop
- Offline, IBM Granite 4 through Ollama reads and writes local files. The smaller model needs a more explicit request to read the right file, and the local adapter leaves out cloud-only options.
- The browser version reuses the loop and context controls. Browser navigation and extraction replace the coding tools, and permissions must follow the actions the new tools can take.
- Kumar would keep the domain’s tools, gates, phases, and budgets in his own code. He would consider buying session persistence and recovery. Test both the finished task and the permission boundary before trusting either setup.
“A harness is usually a loop that contains the agent loop.”