Skip to content
Français

Give the harness instructions and skills

Load project guidance and offer task-specific skills to the model.

Use instructions for guidance that applies to every turn, and skills for guidance the model can load for a particular task. Start with a working harness. These declarations guide the model; enforced restrictions belong in tool permissions.

API reference: HarnessInstructionsOption and HarnessSkillOptions.

Load the project’s AGENTS.md from the borrowed sandbox to build the system instructions. The example uses its content when the file can be read, and returns an empty string otherwise.

import { defineHarnessInstructions } from "@elie-laloum/outpost/harness";

export const projectGuidance = defineHarnessInstructions(
  async ({ sandbox, signal }) => {
    const result = await sandbox.invoke({
      executable: "cat",
      arguments: ["AGENTS.md"],
      signal,
    });
    return result.status === 0 ? result.stdout : "";
  },
);

Pass instructions: ["Answer with evidence.", projectGuidance]. The resolver receives the borrowed sandbox, the signal, the model and, when the harness declares MCP servers, an mcp accessor for their prompts.

A skill is guidance and tools the model loads only when it needs them. Its name and description appear in the system prompt; its instructions arrive as a tool result when loaded.

import {
  createHarnessGitTools,
  defineHarnessSkill,
} from "@elie-laloum/outpost/harness";

export const review = defineHarnessSkill({
  name: "review",
  description: "Inspect a patch and report concrete regressions.",
  instructions:
    "Read the diff. Check changed behavior against callers and tests. Cite file paths.",
  tools: [createHarnessGitTools()],
});
console.log(
  review.name,
  review.tools.map((tool) => tool.name),
);
// Example output: review [ 'git' ]

The script prints review [ 'git' ]: the skill name and the tools it unlocks. Pass it with createHarness({ skills: [review] }).

  1. The model sees the available skill names and descriptions.
  2. It calls load_skill to read one skill’s instructions and unlock its tools.
  3. It follows those instructions and can use the tools for the rest of the conversation.

Calling a skill tool before loading its skill returns an error.

The API lists the fixed skill catalog and loader texts. Names, descriptions and skill instructions are yours; the surrounding wording has no override option.

API reference: HarnessInstructionsOption and HarnessSkillOptions.

  • A compaction that removes the load_skill call locks that skill’s tools again until the model reloads it.
  • Skill tool definitions are sent with every request, loaded or not; skills save instruction text, not tool schemas.

History management explains compaction.