agent-harness-rs
Agent loop harness for building LLM-powered coding agents. Provides a complete runtime with tool execution, context management, MCP support, and e2b sandbox integration.
Features
- Agent loop — OpenAI-compatible streaming model client with retry, reconnect, and compaction
- Local tools —
bash,read,write,edit,glob,grepwith approval gate (feature = "local-tools", default) - Sandbox tools — Generic
SandboxExecutortrait for any remote sandbox - E2b integration —
E2bToolRuntimevia Connect Protocol to envd (feature = "e2b") - Context persistence — JSONL-based context store with incremental append and compaction rewrite
- MCP support — HTTP and stdio MCP server integration via
CompositeToolRuntime
Quick start
[]
= "0.1"
# For e2b sandbox support:
= { = "0.1", = ["e2b"] }
use ;
use Arc;
use PathBuf;
// Local tool runtime (runs bash/read/write on your machine)
let tools = new;
let model = new;
let harness = new;
let mut rx = harness.run_turn.await?;
while let Some = rx.recv.await
E2b sandbox
use ;
let tools = connect.await?;
let harness = new;
Approval modes
use ;
// Allow everything
new
// Read-only (hide bash/write/edit from model)
new
// Custom gate (e.g. ask user via UI)
;
License
MIT