Built-In Harnesses
Built-in harnesses are ready-made tool groups for common agent capabilities.
| Harness | Use it for | Status |
|---|---|---|
| Coding | Workspace-aware read, search, edit, and command workflows | Use with permissions and sandboxing |
| FileSystem | Legacy explicit filesystem operations | Deprecated in 0.9.7; migrate to Coding or an application-owned harness |
| Coding TUI | TUI renderers and controls for coding harness events | Compose into the TUI registry |
| WebSearch | Public web search through Tavily | Use 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.
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.
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.