Skip to main content
The Agentic Harness is an alternative execution engine for Station agents that provides advanced capabilities beyond the standard Genkit-based execution.

Overview

Add harness: 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

The sandbox option under harness_config controls WHERE tools execute:
Sandbox Modes:
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 in config.yaml. Running stn init sets sensible defaults:

Key Features

Doom Loop Detection

Detects when an agent is stuck repeating the same action:
When detected, the harness interrupts the loop and prompts the agent to try a different approach.

Context Compaction

Automatically summarizes conversation history when approaching context limits:
The compactor uses the same model to create a summary, preserving important context while freeing up space for new interactions.

Git Integration

Automatic branch creation for agent work:
When enabled, the harness:
  1. Creates a new branch when execution starts
  2. Tracks all file changes
  3. Can commit changes with generated messages
  4. 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:
Traces include:
  • 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