Build a Coding Agent Harness From an Empty Loop — Tejas Kumar, IBM

Tejas Kumar from IBM demonstrates how to build a coding agent harness from a simple loop by progressively adding tools, guard rails, and efficient context management to enhance functionality, safety, and cost-effectiveness. He highlights the harness’s adaptability across domains and envisions future super harnesses orchestrating multiple specialized agents to advance AI capabilities.

In this workshop, Tejas Kumar from IBM guides participants through building a coding agent harness from scratch, starting with a simple loop and progressively adding complexity. He explains that a harness is essential for managing interactions with language models, extending their capabilities beyond just generating text. The core components of a harness include tools, context primitives for managing conversation history efficiently, and guard rails to prevent harmful or costly actions. Tejas emphasizes that all AI applications use harnesses tailored to their specific domains, such as coding, computer use, or fintech, each with unique tools and rules.

The session begins with a basic harness implemented as a loop that interacts with a language model, demonstrating its limitations such as lack of memory and inability to perform meaningful tasks like reading files. To improve this, Tejas introduces tools—functions that the model can invoke to perform actions like reading or writing files. He then evolves the harness to support a toolset, allowing multiple tools to be managed and called dynamically based on the model’s reasoning. This enhancement enables the agent to perform more complex coding tasks, such as creating and editing files, showcasing the harness’s growing utility.

Next, the workshop addresses the critical need for guard rails to prevent the agent from executing dangerous or costly operations without user consent. Tejas implements usage limits and permission gates, ensuring the agent cannot exceed predefined token budgets or perform destructive actions like deleting important files without explicit approval. This safety layer is vital for practical deployment, protecting users and resources from unintended consequences. The guard rails also improve the agent’s reliability and trustworthiness, essential qualities for real-world applications.

Context management is the next major focus, highlighting the importance of efficient handling of conversation history to reduce costs and maintain performance. Tejas demonstrates how caching and automatic compaction of context can drastically lower token usage and expenses, especially when dealing with large or long-running conversations. He explains that without such mechanisms, the cost of interacting with language models can become prohibitive. The workshop also explores breaking down complex tasks into phases or sub-agents, which improves success rates by managing context more effectively and isolating subtasks.

Finally, Tejas discusses the flexibility of the harness architecture, showing how it can be adapted to different domains by swapping out tools and guard rails while retaining core context management and loop logic. He contrasts building a custom harness with buying managed harness services, weighing the trade-offs between control, customization, and reliability. Looking ahead, he envisions the development of super harnesses capable of orchestrating multiple specialized harnesses, potentially paving the way toward more general artificial intelligence. The workshop concludes with encouragement for participants to build their own harnesses, emphasizing that with the right design, even smaller models can achieve powerful results.