AI Engineer World's Fair 2026
Brains vs Hands: How to Run AI Agents Safely in Production — Viren Baraiya
Loading slides…
Read the talk
Brains vs Hands: How to Run AI Agents Safely in Production
Viren Baraiya explains how an LLM can assemble a plan at runtime while a deterministic harness controls execution, approvals and side effects. A two-loop SRE example shows why the next plan must account for what has already happened.
From a talk by Viren Baraiya
At a glance
Ideas worth remembering
Treat the harness as the application that coordinates agents, systems, humans and tools around a goal.
Let the LLM choose what should happen next; put execution procedures, required approvals and side-effect handling in the harness.
A late-bound saga assembles a finite set of defined tasks at runtime, allowing the plan to change while task behavior remains controlled.
Execution history must feed the next plan. In the SRE demo, the second iteration skips the rollback already performed in the first and moves to downstream checks.
Production agents need more than a tool-call loop
The hello-world agent makes a tool call, uses some context or memory, and plans its next move. That example leaves out much of the work involved in running an agent in production. Viren Baraiya opens with the larger picture: agents may work without a chat session, wake up on a schedule, respond to infrastructure events or coordinate other agents over a long period.
These operating modes create different responsibilities for the software around the model:
- Scheduled work. An agent might run every hour to check a calendar and identify something new that needs attention. Its trigger comes from time rather than a user message.
- Event-driven work. A production agent might listen for alerts and incoming logs, then investigate what is happening in the system.
- Long-running coordination. One agent might monitor another, decide whether it needs a nudge and suggest a different action.
- Multi-agent work. Specialized agents communicate with one another instead of assigning every responsibility to one agent. Baraiya connects that narrower scope to reducing the risk of hallucinations.
Once these responsibilities accumulate, the agent starts to look like an application. The question becomes how to coordinate reasoning, tools, events and ongoing work so that the whole system achieves a goal.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The harness is the application
Microservices offer a useful precedent. A production application typically combines several services, each with a focused responsibility, and connects them through choreography or orchestration. An SRE harness has a similar shape: it can coordinate agents that examine logs, interact with a Kubernetes cluster, query metrics or inspect customer-service dashboards. The business goal belongs to the assembled system.
“Your harness is the application” is Baraiya’s framing for this assembly. The harness controls agent execution while connecting databases, internal systems, humans and tools exposed through APIs or MCP. Its job extends beyond repeatedly calling a model: it must make all those participants work together.
That application combines two kinds of behavior. LLM reasoning supplies a non-deterministic way to interpret a situation and decide what should happen. Operations such as payments or restarting a production cluster need a defined execution procedure. For a cluster restart, the harness should know the sequence of steps and run that procedure consistently whenever the operation is selected.
The useful design decision is where to put flexibility. Interpreting an unhealthy deployment can benefit from model reasoning. The procedure that carries out a restart should live in code whose behavior the application controls. Deterministic execution makes the procedure predictable; it does not make the model’s diagnosis correct.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Waiting and recovering are part of the work
A harness can run for a few seconds, days or months. Much of that lifetime may involve waiting: an order-management process waits for a third-party shipment, an approval step waits for a human, and an event-driven agent waits for its next trigger. The application must continue to make sense across those pauses.
Long lifetimes make infrastructure failures unavoidable design inputs. The machine or sandbox running the harness can disappear; networks can fail or partition. Durability means the harness can recover its work when those failures occur. Baraiya calls it the “cost of admission”: a production harness needs recovery before its more interesting agent behavior can be useful.
Recovery also needs a meaningful record of the world. The harness tracks completed work, successes, failures and side effects. A cluster restart or a sent email must become part of that record. The next model call then reasons from the current state and the goal, including what execution has already changed.
This gives state two jobs. It lets the application retain knowledge of completed work, and it gives the planner the context needed to choose the next action. The second job matters even when nothing crashes: a remediation loop that forgets its previous actions can propose work that has already been done.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The brain proposes; the hands enforce the procedure
The central split is between deciding what should happen next and executing that decision. The LLM writes a plan. The harness performs the work. If the planner concludes that an unhealthy cluster should restart, the harness supplies the restart procedure, including the steps required to carry it out.
Three execution responsibilities make that separation consequential:
- A defined procedure. The harness controls how a restart happens, so the operation follows the same prescribed process each time.
- Required approval. A production restart might require sending someone a Slack message and waiting for approval. If that gate is required, the workflow must enforce it. The model should not be able to omit it because it decides approval is unnecessary.
- Side-effect handling. Ideally, an operation is idempotent: repeating it does not introduce an additional effect. Where it is not, the harness records what happened so the application can handle those effects separately.
Recording a non-idempotent action does not itself make repeating the action safe. It preserves information needed to deal with the consequences. That is why execution policy and execution history both belong in the harness: the policy controls required steps, while the history tells later work what has already occurred.
“Harness is the hands. The brain is the LLM.” The metaphor names a concrete division of labor. The model can adapt the plan to a changing situation, while application code retains responsibility for the procedures and gates attached to the chosen actions.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Assemble known tasks at runtime
Baraiya calls this arrangement a “late bound saga.” The comparison starts with workflows whose steps developers define ahead of time. An agentic harness still has a finite set of tools and deterministic tasks, but the agent proposes how to put those tasks together at runtime.
The late binding happens in the composition. A tool’s prescribed behavior remains defined; its place in the plan can change with the situation. The resulting workflow gives the application visibility into what is happening and a way to control execution. The planner can propose one step or several steps before the harness runs them and obtains fresh information.
This addresses the difficulty of authoring every possible branch in advance. A hand-written workflow would need to anticipate many combinations of tools and circumstances. Runtime planning chooses a relevant combination from the available tasks. The tradeoff is that the application now needs a way to turn the proposed composition into executable work while preserving the procedures that make those tasks predictable.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Two SRE loops, one rollback
The SRE example makes the composition visible through a completed remediation run with two iterations. Baraiya explicitly describes it as a pre-planned, canned demo. It illustrates the planning and execution structure rather than establishing how reliably the system diagnoses unfamiliar production incidents.
The first LLM call proposes a sequence: gather evidence, analyze logs, roll back a deployment if the evidence calls for it, and verify recovery. A specialized tool named Plan and Compile receives that plan and compiles it into a runnable workflow for Conductor, the workflow execution engine used in the example.
The first workflow analyzes logs, queries metrics, performs a rollback and verifies recovery. Those results then become the starting point for another planning loop. The second iteration recognizes that the earlier work has happened, checks downstream systems and calls for recovery verification if needed before completing the task.
What changes between the two plans, and where does that change enter the system? The diagram follows the rollback through execution and back into planning. The second plan omits another rollback because the first iteration already performed it; the loop continues with checks appropriate to the updated state.
The observable change is in the work selected for the second iteration. The system goes from diagnosing and rolling back to checking what remains downstream. Its causal sequence is straightforward: execute the first plan, observe the output, reason from the resulting state, then compile and execute the next plan. Completion history changes the plan rather than merely documenting it afterward.
Each iteration can plan several steps at once, execute them and verify the result before the next iteration. The same arrangement can respond to events, run on a schedule or continue over a longer period. The two-loop demonstration is a short instance of that operating model.
The ending identifies Conductor as an open-source workflow orchestration platform that supports agentic loops and systems, with an Enterprise Edition provided by Orkes. Baraiya also describes support for running LangChain and OpenAI agents. In this architecture, the workflow engine supplies the execution layer around agent reasoning: the agent framework can produce plans, while the harness manages the work those plans select.
Execution changes the next SRE plan
Read the diagram as text
- First LLM plan. Iteration 1 — Gather evidence, analyze logs, conditionally roll back, verify recovery.
- Plan and Compile. Iteration 1 — Turn the proposed sequence into a runnable Conductor workflow.
- Execute first workflow. Iteration 1 — Analyze logs, query metrics, roll back and verify recovery.
- Updated state. The first iteration has completed; the rollback has already happened.
- Second LLM plan. Iteration 2 — Check downstream systems and verify recovery if needed. Omit another rollback.
- Execute and complete. Iteration 2 — Run the next iteration's work and finish the task.
- First LLM plan → Plan and Compile: Proposed sequence.
- Plan and Compile → Execute first workflow: Runnable workflow.
- Execute first workflow → Updated state: Completed work and observed results.
- Updated state → Second LLM plan: Plan from what has already happened.
- Second LLM plan → Execute and complete: Run the remaining checks.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
Related talks
- Beating RL With Reflection: GEPA and Optimize Anything
Explores how execution traces can improve prompts and agent programs, complementing this talk’s use of execution results to decide the next plan.
Full transcript
Loading transcript…