Overview
Addharness: agentic to any agent’s dotprompt file to enable:
- Manual agentic loop - Step-by-step control over agent execution
- Doom loop detection - Prevents agents from getting stuck in repetitive patterns
- Context compaction - Automatically summarizes history when approaching context limits
- Git integration - Auto-branch creation and commit management
- Workspace isolation - Sandboxed file system access
- Built-in tools - File and bash tools that work independently of MCP
When to Use
Agent Configuration
Enable the harness in your agent’s dotprompt frontmatter:Agent-Level Options
Sandbox Configuration
Thesandbox option under harness_config controls WHERE tools execute:
Docker mode is recommended for production. Files persist across container restarts via volume mounting.
E2B mode is experimental - data doesn’t persist between sandbox destroys.
Global Configuration
Configure harness defaults inconfig.yaml. Running stn init sets sensible defaults:
Key Features
Doom Loop Detection
Detects when an agent is stuck repeating the same action:Context Compaction
Automatically summarizes conversation history when approaching context limits:Git Integration
Automatic branch creation for agent work:- Creates a new branch when execution starts
- Tracks all file changes
- Can commit changes with generated messages
- Supports push with approval workflow
Workspace Isolation
Control where agents can read/write files:Built-in Tools
The harness provides built-in tools that work independently of MCP servers:Tool Permissions
Fine-grained control over tool capabilities:Workflow Integration
Harness agents work seamlessly with Station workflows:Shared Git Branches in Workflows
When multiple agents collaborate on the same codebase:Example: Code Review Agent
Example: Refactoring Agent
Observability
Harness executions are fully traced with OpenTelemetry:- Each agentic loop iteration
- Tool calls with inputs/outputs
- Doom loop detection events
- Compaction events
- Git operations
Testing
Run harness tests:Next Steps
Workflows
Chain harness agents into multi-step workflows
Git Integration
Version control your agents and configurations
Sandbox
Isolated container execution for untrusted code
Observability
Monitor agent performance with Jaeger tracing

