AI Agent Harness 如何运行并影响成本
OpenRouter 将 Agent Harness 解释为围绕 AI 模型的执行层,负责运行对话循环、检查操作请求、执行获准工具、管理上下文,并实施权限和限制。其小规模测试显示,加入40个未使用的工具后,Claude Haiku 5.5 的未缓存中位会话成本从0.00082美元升至0.00277美元;启用缓存后,44工具配置的中位成本为0.00071美元。OpenRouter还指出,即使使用同一模型,不同 Harness 提供的工具、上下文、对话历史和停止条件不同,也会产生不同行为。
这份报告表明,Harness 的工具与上下文设计不仅会改变智能体可执行的任务,也可能直接影响会话成本。
What Is an Agent Harness? How It Works, Explained
OpenRouter ·12/1/2026


An agent harness is the software around an AI model that runs the conversation loop, executes tools, manages context, and enforces permissions and limits. When you ask a coding agent to fix a bug, the harness supplies the files and test results the model needs, then executes the actions it requests.
The tools and context a harness gives the model affect what the agent can do and how much a session costs. A harness that sends dozens of tool definitions on every call can use more input tokens than one that loads tools only when needed, even when both use the same model.
#OpenRouter#Claude Haiku 5.5#Claude Opus 5.5#Claude Sonnet 5.5#GPT-6.1 Sol#Claude Code#Codex#Hermes Agent#Kilo Code#OpenRouter Agent SDK#Ori Harness