The Agentic Harness is an alternative execution engine for Station agents that provides advanced capabilities beyond the standard Genkit-based execution.Documentation Index
Fetch the complete documentation index at: https://docs.cloudshipai.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Use Case | Harness |
|---|---|
| Simple queries, quick responses | Default (Genkit) |
| Long-running coding tasks | agentic |
| Multi-step file operations | agentic |
| Tasks requiring git branches | agentic |
| Complex debugging/investigation | agentic |
Agent Configuration
Enable the harness in your agent’s dotprompt frontmatter:Agent-Level Options
| Option | Default | Description |
|---|---|---|
max_steps | 50 | Maximum tool call iterations |
doom_loop_threshold | 3 | Consecutive identical calls to trigger loop detection |
timeout | 10m | Maximum execution time |
sandbox | null | Isolated execution environment (see below) |
Sandbox Configuration
Thesandbox option under harness_config controls WHERE tools execute:
| Mode | Description | File Persistence |
|---|---|---|
host | Tools execute directly on host machine | Yes |
docker | Tools execute in Docker containers | Yes (volume mounted) |
e2b | Tools execute in cloud VMs | No (experimental) |
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 | Description | Example |
|---|---|---|
read | Read file contents | read(path: "src/main.go") |
write | Write file contents | write(path: "out.txt", content: "...") |
edit | String replacement editing | edit(path: "file.go", old: "foo", new: "bar") |
bash | Execute shell commands | bash(command: "ls -la") |
glob | Find files by pattern | glob(pattern: "**/*.go") |
grep | Search file contents | grep(pattern: "TODO", path: "src/") |
git_status | Get git status | git_status() |
git_diff | Get git diff | git_diff() |
git_log | Get recent commits | git_log(count: 10) |
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

