大脑与双手:如何在生产环境中安全运行 AI 代理 — Viren Baraiya
Original · Brains vs Hands: How to Run AI Agents Safely in Production — Viren Baraiya
Key Takeaway
在生产环境中安全运行 AI 智能体的核心在于职责分离:将大语言模型限定为提议与规划的“大脑”,而让基于确定性工作流引擎(如 Conductor)的执行框架充当具备幂等性与持久性的“双手”来执行具体操作。
Highlights
在生产环境中运行 AI 智能体时,执行框架(Harnesses)充当确定性的“双手”,负责严格执行命令,而大语言模型则作为非确定性的“大脑”专注于规划
智能体系统不局限于聊天机器人,还包括按计划运行的后台应用、响应警报事件的驱动系统以及跨多智能体协作的复杂架构
基于 Conductor 开源平台构建的执行框架通过将 LLM 生成的规划动态编译为确定性工作流,实现了具备持久性与可恢复性的自动化处理 pipeline
Timeline
生产环境智能体架构的范式转变
传统对智能体的理解往往局限于简单的问答对话框,但生产环境下的应用场景要求智能体能处理更加多样化和长期运行的任务。这包括每小时定期检查日程的后台工作者、监听 OpenTelemetry 日志并响应警报的事件驱动系统,以及监控其他智能体状态的长期协调器。类似于遵循单一职责原则的微服务架构,单个智能体无法独立完成庞大的系统功能,必须依靠执行框架将数据库、内部系统、MCP 工具以及人工审批机制(Human-in-the-loop)整合在一起,形成完整的应用体系。
- 生产环境中的智能体不再仅仅局限于聊天机器人,而是演变为类似微服务架构的综合应用程序
- 执行框架通过协调后台任务、事件驱动响应及多智能体协作来实现复杂的业务目标
确定性执行与非确定性推理的边界划分
在真实生产环境中构建系统时,最大的挑战在于平衡确定性与非确定性逻辑。推理和大语言模型的思考过程天然具备非确定性,但涉及重大影响的实际操作——如根据日志异常重启 Kubernetes 集群或执行支付业务——要求具备极高的确定性、幂等性与可记录性。大语言模型只应当输出步骤规划,而执行框架则根据当前世界状态(State of the world)精准实施具体动作,并在关键节点插入人工确认环节(如发送 Slack 审核消息),从而隔离 LLM 幻觉可能带来的系统风险。
- 大语言模型作为“大脑”负责非确定性的推理与规划,而执行框架作为“双手”负责确定性的任务执行
- 关键生产操作(如集群重启或支付处理)必须由确定性代码把控,绝不能依赖 LLM 的潜在幻觉
后期绑定工作流与生产架构实践
相比于传统在编译期预先定义所有分支的确定性工作流,智能体执行框架实现了“后期绑定”:智能体在运行时根据当前上下文,在有限且明确的工具集范围内动态拼装执行步骤。在具体演示中,针对 SRE 自动修复场景,智能体在单次循环中不仅提出“收集证据、分析日志、数据回滚、校验恢复”等一系列步骤,还通过 Conductor 开源工作流平台将该规划编译为标准且具有状态持久性的流水线。通过不断观察系统状态、规划、编译并执行,实现了生产级高可用与可复现的智能化运维循环。
- 智能体执行框架本质上是后期绑定(Late-bound)的 Saga 模式工作流,可在运行时根据 n 个工具生成任意组合的执行路径
- 通过 Conductor 引擎可将 LLM 生成的多步骤计划动态编译为可直接运行的确定性工作流
Description
Let the model decide what should happen next. Never let it improvise how a production cluster gets restarted. Viren Baraiya, co-founder and CTO of Orkes and the original creator of Netflix Conductor, explains how to run agents in production. Real agents aren't just chatbots: they run on schedules, react to events, coordinate other agents and can run for months, so the harness around them starts to look like an application, much like a set of microservices. His key idea is a clean split between the brain and the hands. The LLM plans what should happen next; a deterministic, durable harness does the actual work, with approval gates, idempotent steps and recorded side effects. He frames agent harnesses as late-bound sagas, workflows the agent assembles at runtime, and demos an SRE agent whose plan is compiled into a Conductor workflow, executed, checked and re-planned over two loops. In this talk: • Background, scheduled, event-driven and long-running agents • Why the harness is the application, mixing deterministic and non-deterministic parts • The brain and the hands: the LLM plans, the harness executes • Demo: an SRE agent's plan compiled into a durable workflow SPEAKER Viren Baraiya, Co-founder & CTO, Orkes X: https://x.com/virenbaraiya LINKS Orkes: https://orkes.io Orkes on X: https://x.com/orkesio CHAPTERS 0:00 Intro 0:47 Who runs agents in production? 1:12 Beyond the hello-world agent 1:52 Background, scheduled and event-driven agents 2:27 Coordinators and multi-agent systems 3:02 Agents are applications, not components 3:12 Lessons from microservices 4:22 The harness is the application 5:02 Deterministic and non-deterministic parts 6:02 Harnesses run for seconds or months 6:41 Durability is table stakes 7:26 How the loop works 8:21 The agent plans, the harness executes 9:21 Human approval gates 9:41 Idempotency and side effects 9:56 The brain and the hands 10:21 Agent harnesses as late-bound sagas 11:21 Every possible branch 11:51 Demo: an SRE agent 13:31 Compiling the plan into a workflow 14:16 Demo: the second loop 15:56 Conductor, open source Recorded at the AI Engineer World's Fair 2026 in San Francisco. Subscribe for more talks from the engineers building with AI. AI Engineer: https://ai.engineer YouTube: https://www.youtube.com/@aiDotEngineer X: https://x.com/aiDotEngineer LinkedIn: https://www.linkedin.com/company/aidotengineer/ #AIAgents #WorkflowOrchestration #AIEngineer
