Skip to content
Français

HarnessOptions

import type { HarnessOptions } from "@elie-laloum/outpost";
  • routingOptional
    HarnessModelRouting | undefined
    Optional per-step routing declared with defineHarnessModelRouting; all candidates use this harness model provider.
  • modelProviderRequired
    ModelProvider
    Model provider called for every step and summary request, such as createOpenAIModelProvider() or createAnthropicModelProvider(). Its validate() checks the agent model when createAgent() composes the agent.
  • instructionsOptional
    HarnessInstructionsOption | undefined
    System 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.
  • toolsOptional
    readonly (HarnessTool<unknown> | HarnessToolset)[] | undefined
    Tools and toolsets the model may call. Nested toolsets are flattened; names must be unique across the harness, including skill and MCP tools.
  • limitsOptional
    HarnessLimits | undefined
    Bounds per turn on steps, tool calls, delegation depth and token usage. Exceeding a bound fails with code limit.
  • toolExecutionOptional
    HarnessToolExecution | undefined
    Tool concurrency, per-call deadline and error policy.
  • hooksOptional
    readonly HarnessHook<HarnessHookPhase>[] | undefined
    Hooks from defineHarnessHook, run in declaration order within each phase.
  • permissionsOptional
    HarnessPermissions | undefined
    Rules from defineHarnessPermissions(), evaluated before before-tool hooks. They also apply to every subagent’s tool calls.
  • contextOptional
    HarnessContextStrategy | undefined
    Strategy that can rewrite the history before each model request, such as truncateToolResults() or summarizeHistory().
  • conversationsOptional
    false | ConversationStore | undefined
    Store 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.
  • skillsOptional
    readonly HarnessSkill[] | undefined
    Skills listed in the system instructions and loaded on demand through the load_skill tool; duplicate skill names are rejected.
  • cacheOptional
    boolean | undefined
    Asks 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.
  • mcpServersOptional
    McpServers | undefined
    MCP 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.
export interface HarnessOptions {
  readonly routing?: HarnessModelRouting;
  readonly modelProvider: ModelProvider;
  readonly instructions?: HarnessInstructionsOption;
  readonly tools?: readonly (HarnessTool | HarnessToolset)[];
  readonly limits?: HarnessLimits;
  readonly toolExecution?: HarnessToolExecution;
  readonly hooks?: readonly HarnessHook[];
  readonly permissions?: HarnessPermissions;
  readonly context?: HarnessContextStrategy;
  readonly conversations?: ConversationStore | false;
  readonly skills?: readonly HarnessSkill[];
  readonly cache?: boolean;
  readonly mcpServers?: McpServers;
}