Skip to content
Français

Give the model tools

Choose sandbox tools or define your own tools for the built-in harness.

Start from a working harness. Give it the smallest useful toolset, then add a custom tool only when the model needs another operation. All file and command effects should use the sandbox supplied to the tool.

For a copied directory, mount or ephemeral workspace, compose the read and search toolsets with explicit filesystem selection. Pass inspectionTools to createHarness({ tools: inspectionTools, modelProvider }). This composition adds neither shell execution, editing nor Git tools. Add each capability explicitly when the task needs it; tool selection does not replace sandbox isolation.

import {
  createHarnessFileTools,
  createHarnessSearchTools,
} from "@elie-laloum/outpost/harness";

const inspectionTools = [
  createHarnessFileTools({ selection: "filesystem" }),
  createHarnessSearchTools({ selection: "filesystem" }),
];

Pass the tools or toolsets the model needs to createHarness({ tools }). The model can call only this declared set, so start with the tools required by the task.

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

export const modelProvider = createAnthropicModelProvider({
  apiKey: process.env.ANTHROPIC_API_KEY ?? "",
});
import {
  createHarnessFileTools,
  createHarnessSearchTools,
  createHarnessGitTools,
} from "@elie-laloum/outpost/harness";

export const tools = [
  createHarnessFileTools(),
  createHarnessSearchTools(),
  createHarnessGitTools(),
];
import { createAgent } from "@elie-laloum/outpost/core";
import { createHarness } from "@elie-laloum/outpost/harness";
import { modelProvider } from "./read-model.ts";
import { tools } from "./read-tools.ts";

export const reviewer = createAgent({
  model: { name: "claude-sonnet-5-5", maxOutputTokens: 16_000 },
  harness: createHarness({ modelProvider, tools }),
});
import { dispatch } from "@elie-laloum/outpost/core";
import { repository, sandboxProvider } from "./outpost.config.ts";
import { reviewer } from "./reviewer.ts";

export const result = await dispatch({
  repository,
  sandboxProvider,
  agent: reviewer,
  brief: { text: "Review the last commit and report risky changes." },
});
console.log(result.text);
// Example output: The last commit accepts unchecked input in src/parser.ts.

This reviewer reads, searches and inspects history, but cannot change a file. Every call runs in the dispatch’s sandbox, against the repository root.

ToolsetToolsRead-onlyWhat the model can do
createHarnessFileTools()read_file, list_filesYesRead UTF-8 files and list files tracked or not ignored by Git.
createHarnessSearchTools()searchYesSearch files with an extended regular expression (git grep), by path, glob and case.
createHarnessGitTools()gitYesRun git status, diff, log or show with extra arguments.
createHarnessEditTools()write_file, edit_fileNoCreate files and replace text within existing files.
createHarnessShellTools()shellNoRun a sh -c command without input and read its exit status and output.

Paths must stay inside the repository. To configure command limits, see createHarnessShellTools.

The Git tool refuses --no-index, abbreviations of blocked options, absolute or drive-qualified path arguments and parent-directory traversal. These checks prevent file comparisons outside the workspace; they do not make the local provider an isolated execution environment.

For this step, follow Create a tool for your agent.

To expose an existing server’s tools, declare it with createHarness({ mcpServers }). MCP servers covers the configuration; its tool names share the same namespace.

Listing and search default to Git selection for existing calls. Select filesystem explicitly for file workspaces; these operations run inside the borrowed sandbox, keep permission declarations and bounds, and do not follow links or apply .gitignore. See file workspaces.

  • execute runs in the Outpost process on the host. Use context.sandbox for files and commands; host APIs such as node:fs would bypass the sandbox.
  • readOnly is a scheduling hint, not enforcement. A tool marked read-only can still write if its code does.
  • A result longer than 100,000 characters is truncated before it reaches the model.

API: defineHarnessTool · defineHarnessToolset · HarnessToolContext · ToolOutput · ToolResources · createHarnessFileTools · createHarnessSearchTools · createHarnessGitTools · createHarnessEditTools · createHarnessShellTools.

A built-in harness stdio MCP server receives only its declared variables (including explicit environment entries) and the basic process environment (PATH, HOME, user, temporary-directory and locale variables). Other provider secrets are not inherited by its child process. This filtering is not a security boundary against code running in the same sandbox.