Skip to content

Built-In Harnesses ​

Built-in harnesses are ready-made tool groups for common agent capabilities.

HarnessUse it forStatus
CodingWorkspace-aware read, search, edit, and command workflowsUse with permissions and sandboxing
FileSystemLegacy explicit filesystem operationsDeprecated in 0.9.7; migrate to Coding or an application-owned harness
Coding TUITUI renderers and controls for coding harness eventsCompose into the TUI registry
WebSearchPublic web search through TavilyUse with the Tavily:ApiKey secret, or a secret named with WithApiKeySecret(...)

Use built-in harnesses the same way you use your own harnesses: add them to an agent's AgentConfig, then configure on AgentRuntimeBuilder the shared parts they require, such as permissions and sandboxing.

Built-in harnesses follow the common native harness contract:

  • exactly one public constructor;
  • typed IConfig<T> settings where the harness requires configuration;
  • ordinary dependency injection for executable services;
  • optional per-run settings for fields the library marks run-overridable.
csharp
var coder = new AgentConfig()
    .WithToolHarness<CodingToolHarness>(options => options
        .Configure(new CodingHarnessConfig
        {
            Commands = new ExecuteCommandOptions
            {
                MaxActiveBackgroundCommands = 4
            }
        }));

See Configure A Tool Harness, Inject Harness Dependencies, and Configure A Harness Per Run.

Safety Defaults ​

Filesystem and coding tools can mutate files or run processes. Start with:

  • an explicit workspace root
  • AgentRuntimeBuilder.WithPermissions()
  • AgentRuntimeBuilder.WithSandbox(...) when command execution is available
  • shell disabled unless the workflow truly needs it

Do not use the legacy HPD-Agent.ToolHarness.FileSystem package as a sandbox. Its FileSystemTools and FileSystemContext types are obsolete in 0.9.7 and do not provide reliable physical path containment, symlink protection, or safe shell isolation.

csharp
var coder = new AgentConfig()
    .WithInstructions("Stay inside the configured workspace.")
    .WithToolHarness<CodingToolHarness>();

await using var runtime = await new AgentRuntimeBuilder()
    .WithPermissions()
    .WithSandbox(new HostProcessProviderModule(), HostProcessSandbox.ForDirectory(workspacePath))
    .AddAgent("coder", coder)
    .BuildAsync();

Permissions and sandbox provisioning are shared by every agent the runtime runs.

Built for production .NET agent applications.