defineHarnessHook
Purpose and behavior
Section titled “Purpose and behavior”Declare a callback or sandbox command for one of the 13 Outpost loop phases. Hooks run in declaration order; invalid decisions and callback failures fail the turn. Model transformations preserve original usage, refusal and output limits. Rewritten tool calls still pass schema and permission checks.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”The fields below cover all variants; the signature specifies their allowed combinations.
optionsRequiredHarnessHookOptions<Phase>Loop phase, optional name and control function of the hook.options.onRequiredPhaseLoop point where the hook runs.options.nameOptionalstring | undefinedName for diagnostics, default the phase name.options.timeoutMsOptionalnumber | undefinedPositive callback or command deadline in milliseconds; defaults to 30000. Callbacks must honor signal for host work.options.commandVariant-dependentHookCommand | undefinedSandbox program receiving the serializable hook context as JSON on stdin. Return a phase-specific JSON decision or empty stdout. Nonzero exit, invalid output or stdout over 1 MiB fails the turn. Mutually exclusive with run.options.runVariant-dependentundefined | (input: HarnessHookInput<Phase>) => HarnessHookResult<Phase> | Promise<HarnessHookResult<Phase>>Control function for this phase. Hooks of a phase run in declaration order; an exception fails the turn, and an invalid decision fails it with code configuration.

