createHarness
Purpose and behavior
Section titled “Purpose and behavior”Compose the built-in harness: Outpost runs the model loop itself, calling the model provider once per step and running tools through the borrowed sandbox. Options are validated immediately and unknown keys are rejected; nothing runs until an agent from createAgent({ harness, model }) is dispatched.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredHarnessOptionsSettings of the built-in harness: model provider, instructions, tools, limits, tool execution, hooks, permissions, context strategy, skills, conversations, caching and MCP servers.options.routingOptionalHarnessModelRouting | undefinedOptional per-step routing declared with defineHarnessModelRouting; all candidates use this harness model provider.options.modelProviderRequiredModelProviderModel provider called for every step and summary request, such as createOpenAIModelProvider() or createAnthropicModelProvider(). Its validate() checks the agent model when createAgent() composes the agent.options.instructionsOptionalHarnessInstructionsOption | undefinedSystem instructions as text, a defineHarnessInstructions() or defineMcpPrompt() result, or a list of these. Resolved at each turn and joined with blank lines; empty results are skipped.options.toolsOptionalreadonly (HarnessTool<unknown> | HarnessToolset)[] | undefinedTools and toolsets the model may call. Nested toolsets are flattened; names must be unique across the harness, including skill and MCP tools.options.limitsOptionalHarnessLimits | undefinedBounds per turn on steps, tool calls, delegation depth and token usage. Exceeding a bound fails with code limit.options.toolExecutionOptionalHarnessToolExecution | undefinedTool concurrency, per-call deadline and error policy.options.hooksOptionalreadonly HarnessHook<HarnessHookPhase>[] | undefinedHooks from defineHarnessHook, run in declaration order within each phase.options.permissionsOptionalHarnessPermissions | undefinedRules from defineHarnessPermissions(), evaluated before before-tool hooks. They also apply to every subagent’s tool calls.options.contextOptionalHarnessContextStrategy | undefinedStrategy that can rewrite the history before each model request, such as truncateToolResults() or summarizeHistory().options.conversationsOptionalfalse | ConversationStore | undefinedStore for turn transcripts, default createHarnessConversations() under .outpost/conversations/harness in the repository. Wrap it with createTransportConversations() for remote storage; false disables capture, continuation and response repairs.options.skillsOptionalreadonly HarnessSkill[] | undefinedSkills listed in the system instructions and loaded on demand through the load_skill tool; duplicate skill names are rejected.options.cacheOptionalboolean | undefinedAsks the model provider to cache the conversation prefix on each request, default true. The Anthropic provider marks the prefix for caching; OpenAI caches stable prefixes on its own.options.mcpServersOptionalMcpServers | undefinedMCP servers keyed by name, started inside the borrowed sandbox for each turn; their tools appear as mcp__<server>__<tool>, plus resource and prompt tools when servers offer them. The lease must support liveInput, and oauth: “login” servers are rejected.