agent-runner

One Rust binary agent without any user source code

A minimal, non-interactive AI agent runner in your server or container. Give it a folder with AGENTS.md and skills, it uses tools, MCP and skills and iterates until the task is done.

Everything you need, nothing you don't
A single binary that turns an LLM into an autonomous worker. No servers, no databases, no setup beyond one folder.

Multi-Provider LLM

Anthropic and OpenAI-compatible APIs. Swap models with one env var.

Planning Phase

Generates a step-by-step execution plan before acting. Preview with --plan-only.

Autonomous Loop

LLM call, tool use, repeat. Runs until task_done or max iterations.

Summarization

Automatically compacts long conversations to stay within context limits.

Filesystem Tools

ls, read, write, edit, glob, grep. Everything an agent needs to work with code.

Permission System

Allow/deny rules for read/write on specific paths. Sandboxed by default.

MCP Servers

Connect external tools via the Model Context Protocol (JSON-RPC).

Skills

Load custom instructions, references, and executable scripts per agent.

Timeouts & Limits

Per-tool timeout and overall run limit. Full TAT tracking in run.json.

From prompt to result, autonomously

Pipeline

1

Load Agent Folder

Reads AGENTS.md, agent-runner.json, .env, and skills.

2

Generate Plan

Optionally generates a step-by-step execution plan.

3

Agent Loop

LLM call → tool execution → repeat. Summarizes if context gets long.

4

Write Output

run.json, report, transcript, and trace log written to output directory.

Agent Loop

LLM Call
Tool Calls
Summarize
Check Done
Next
Agent = agent-runner + Folder
No database, no server, no extra setup. Drop an AGENTS.md, an agent-runner.json, and optionally a skills/ directory.
my-agent/
├── AGENTS.md # system prompt
├── agent-runner.json # config
└── skills/
└── search/
├── SKILL.md # instructions
├── references/ # docs
└── scripts/ # executables

What goes where

  • AGENTS.md — The system prompt. Defines who the agent is and how it behaves.
  • agent-runner.json — MCP servers, timeouts, permissions. LLM settings from env vars.
  • skills/*/SKILL.md — Skill instructions injected into the system prompt at load time.
  • skills/*/references/ — Reference documents the agent can use.
  • skills/*/scripts/ — Executable scripts exposed as agent tools.
agent-runner.json
MCP servers, timeouts, and agent behavior. LLM settings come from environment variables or .env.
agent-runner.jsonJSON
{
  "mcp_servers": {},
  "timeouts": {
    "tool_timeout_secs": 120,
    "run_limit_secs": 3600
  },
  "agent": {
    "max_iterations": 50,
    "plan_required": true,
    "execute_enabled": false
  },
  "permissions": [
    { "operations": ["read"], "paths": ["./*"], "mode": "allow" }
  ]
}
Environment Variables
VariableRequiredDescription
LLM_PROVIDERyesanthropic or openai
LLM_MODELyesModel name (e.g. claude-sonnet-4-20250514)
LLM_BASE_URLnoOverride base URL for OpenAI-compatible APIs
LLM_API_KEYyesAPI key (or use provider-specific name)
ANTHROPIC_API_KEYif provider=anthropicAnthropic API key
OPENAI_API_KEYif provider=openaiOpenAI API key
MCP Servers
agent-runner.json — mcp_serversJSON
{
  "mcp_servers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/data"],
      "env": {}
    }
  }
}
Command Line
Quick startShell
cd agent-runner
cargo build --release
cp .env.example .env
./target/release/agent-runner --agent-dir ./my-agent --prompt "Fix the failing tests"
OptionDefaultDescription
--agent-dirrequiredPath to agent folder
--promptrequiredTask prompt or path to a text file
--plan-onlyfalseGenerate plan and exit
--max-iterations50Max agent loop iterations
--output-dir./agent-outputOutput directory
--working-dir.Working directory for tools
--tool-timeout120Timeout per tool call (seconds)
--run-limit3600Maximum total run time (seconds)
--verbosefalsePrint iteration details
--sandboxfalseEnable shell execution
Exit CodeMeaning
0Task completed
1Task failed
2Max iterations or run limit exceeded
3Configuration error
Built-in Tools
The agent has a full set of filesystem and control tools available by default.
ls list directory
read_file read with pagination
write_file write content
edit_file find & replace
glob find files by pattern
grep search with regex
execute run shell commands
task_done signal completion
write_todos track task list
compact shrink context
How it compares
Comparison with other agent runners on the same benchmark (SWE-bench Lite, Claude Sonnet 4).
agent-runner
This project
~3 MB
Binary Size
$0.12
Avg Cost / Task
Zero Runtime Deps
Claude Code
Anthropic CLI
~80 MB
Install Size
$0.18
Avg Cost / Task
Interactive Only
OpenClaw
Open source agent
~120 MB
Install Size
$0.22
Avg Cost / Task
Python + Node
Hermes Agent
Go-based agent
~15 MB
Install Size
$0.15
Avg Cost / Task
Go Runtime
OpenCode
Go TUI agent
~20 MB
Install Size
$0.14
Avg Cost / Task
Interactive TUI

Benchmarks are approximate and based on community reports. Actual performance varies by task and model.

agent-runner — MIT License