LLM Reliability: Control Flow Over Prompting

Ornella Bahidika and Joel Allou from Microsoft discuss 'harness engineering' for AI agents, advocating for code-driven control flow over LLM-driven decision-making to ensure reliability.

8 min read
Title slide for 'Don't Let the LLM Drive' presentation by Ornella Bahidika & Joel Allou, Microsoft.
AI Engineer

Visual TL;DR. LLM Agent Reliability leads to Prompting Harder. LLM Agent Reliability due to LLM State Management. Prompting Harder insufficient, needs Harness Engineering. LLM State Management solved by Harness Engineering. Harness Engineering means Code-Driven Control. Code-Driven Control enables Reliable AI Agents. Harness Engineering example Ace Voice Tutor.

  1. LLM Agent Reliability: multi-step AI agents often fail midway, skip steps, or enter loops
  2. Prompting Harder: common approach of trying to improve LLM performance with more detailed prompts
  3. LLM State Management: LLMs struggle to track progress through tasks, lacking internal state awareness
  4. Harness Engineering: architectural shift where code manages agent control flow, directing the LLM
  5. Code-Driven Control: explicit code dictates agent steps and decisions, acting as a director
  6. Reliable AI Agents: achieving consistent and dependable performance for complex multi-step tasks
  7. Ace Voice Tutor: live AI voice tutor project demonstrating harness engineering principles in practice
Visual TL;DR
Visual TL;DR, startuphub.ai LLM Agent Reliability due to LLM State Management. LLM State Management solved by Harness Engineering due to solved by LLM Agent Reliability LLM State Management Harness Engineering Reliable AI Agents From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai LLM Agent Reliability due to LLM State Management. LLM State Management solved by Harness Engineering due to solved by LLM AgentReliability LLM StateManagement HarnessEngineering Reliable AIAgents From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai LLM Agent Reliability due to LLM State Management. LLM State Management solved by Harness Engineering due to solved by LLM Agent Reliability multi-step AI agents often fail midway,skip steps, or enter loops LLM State Management LLMs struggle to track progress throughtasks, lacking internal state awareness Harness Engineering architectural shift where code managesagent control flow, directing the LLM Reliable AI Agents achieving consistent and dependableperformance for complex multi-step tasks From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai LLM Agent Reliability due to LLM State Management. LLM State Management solved by Harness Engineering due to solved by LLM AgentReliability multi-step AIagents often failmidway, skip steps,… LLM StateManagement LLMs struggle totrack progressthrough tasks,… HarnessEngineering architectural shiftwhere code managesagent control flow,… Reliable AIAgents achievingconsistent anddependable… From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai LLM Agent Reliability leads to Prompting Harder. LLM Agent Reliability due to LLM State Management. Prompting Harder insufficient, needs Harness Engineering. LLM State Management solved by Harness Engineering. Harness Engineering means Code-Driven Control. Code-Driven Control enables Reliable AI Agents. Harness Engineering example Ace Voice Tutor leads to due to insufficient, needs solved by means enables example LLM Agent Reliability multi-step AI agents often fail midway,skip steps, or enter loops Prompting Harder common approach of trying to improve LLMperformance with more detailed prompts LLM State Management LLMs struggle to track progress throughtasks, lacking internal state awareness Harness Engineering architectural shift where code managesagent control flow, directing the LLM Code-Driven Control explicit code dictates agent steps anddecisions, acting as a director Reliable AI Agents achieving consistent and dependableperformance for complex multi-step tasks Ace Voice Tutor live AI voice tutor project demonstratingharness engineering principles in practice From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai LLM Agent Reliability leads to Prompting Harder. LLM Agent Reliability due to LLM State Management. Prompting Harder insufficient, needs Harness Engineering. LLM State Management solved by Harness Engineering. Harness Engineering means Code-Driven Control. Code-Driven Control enables Reliable AI Agents. Harness Engineering example Ace Voice Tutor leads to due to insufficient, needs solved by means enables example LLM AgentReliability multi-step AIagents often failmidway, skip steps,… Prompting Harder common approach oftrying to improveLLM performance… LLM StateManagement LLMs struggle totrack progressthrough tasks,… HarnessEngineering architectural shiftwhere code managesagent control flow,… Code-DrivenControl explicit codedictates agentsteps and… Reliable AIAgents achievingconsistent anddependable… Ace Voice Tutor live AI voice tutorprojectdemonstrating… From startuphub.ai · The publishers behind this format

In the rapidly evolving world of AI agents, achieving consistent and reliable performance is a significant challenge. Ornella Bahidika and Joel Allou, presenting a concept they call 'harness engineering,' argue that the common approach of 'prompting harder' is insufficient for building dependable multi-step agents. Instead, they advocate for a shift in architectural thinking, where the control flow of an agent is managed by code, effectively acting as a director to the LLM's talent.

LLM Reliability: Control Flow Over Prompting - AI Engineer
LLM Reliability: Control Flow Over Prompting — from AI Engineer

The core of their argument centers on a project called Ace, a live AI voice tutor. Bahidika and Allou highlight a common problem encountered when deploying complex agents: they fail midway through tasks, skip steps, or enter loops, issues often hidden in polished demos. They propose that the fundamental issue is not the LLM's inherent reasoning but its lack of state management capabilities. LLMs are excellent at generating responses for a given prompt, but they struggle to track their progress through a sequence of operations.

The 'Harness' as a Director

To address this, Bahidika and Allou describe a lesson as a 'small state machine.' This state machine defines the distinct steps of a lesson, such as introduction, teaching, checking comprehension, grading, advancing, and wrapping up. Each step sends the LLM a 'narrow contract', a specific instruction to perform a single task and return a result. The 'harness,' which is the surrounding code, then validates the LLM's output, advances the state machine, and determines the next action. This approach ensures that the LLM is never in control of the overall process, preventing the common failure modes of agents that rely solely on LLM-driven logic.

Allou elaborated on this by contrasting the use of large, powerful models like Anthropic's Opus with smaller, more efficient models. He explained that by implementing a 'harness,' they could utilize a model like Anthropic's Haiku, which is less computationally intensive and faster, while still achieving the desired reliability and performance for their AI tutor. This is because the harness handles the complex decision-making and state tracking, allowing the LLM to focus on its core strength: generating natural language responses.

Key Decisions Belong to Code

The presentation emphasized that critical decisions within an AI agent's workflow should not be left to the LLM. These include determining when a task is complete, assessing if a user has achieved a learning objective, and deciding what the next step should be. Bahidika and Allou assert that these are 'code' problems, not 'prompting' problems. By engineering these control flows outside the LLM, developers can build more predictable and reliable systems.

The video showcased logs demonstrating this 'harnessing' in action, illustrating how specific steps in the AI tutor's lesson were managed by the harness, including providing input for what to speak about, drawing on a whiteboard, clearing queues, and ending the lesson. This meticulous control ensures that even with novel scenarios, the agent can proceed reliably.

The 'Coin Flip' Rule

A key takeaway, summarized as 'When reliability is a coin flip, take control flow out of the model,' highlights the practical advice for developers. If an agent's performance is inconsistent, the solution is not to endlessly refine prompts but to externalize the control logic. The core message is to 'Let the model talk, but you keep the wheel.' This means the LLM can generate content and respond to inputs, but the surrounding code dictates the sequence, conditions, and overall execution path, thereby ensuring reliability and efficiency.

This approach is presented as broadly applicable, extending beyond voice tutors to coding agents, operational runbooks, and onboarding flows, anywhere that reliable, multi-step execution is required.

© 2026 StartupHub.ai. All rights reserved. Do not enter, scrape, copy, reproduce, or republish this article in whole or in part. Use as input to AI training, fine-tuning, retrieval-augmented generation, or any machine-learning system is prohibited without written license. Substantially-similar derivative works will be pursued to the fullest extent of applicable copyright, database, and computer-misuse laws. See our terms.