Skip to content

About

Domain-agnostic AI coding harness — isolated Docker/Bubblewrap sandboxes, multi-provider model qualification, and independently verified patches.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

222 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Forge



An open, self-hostable coding agent that proves its patches work before calling a task done.

CI License: MIT Python 3.11+ Status: alpha

Use cases · Install · Models and keys · How it works · Status · Docs


Agent Forge hands a coding task to an AI model, lets it work in an isolated sandbox, and then checks the patch on a clean copy of your code. A run succeeds only when your own check command, such as your test suite, passes on that copy.

You can drive it from a terminal, a web editor, your IDE, or an HTTP API. It works with Gemini, Claude, GPT, OpenRouter, or a local model, and runs on your laptop, in CI, or on your own server.

Important

Alpha software. The harness is built and tested, but there is no current live-model benchmark. The status page says what is measured, what is only tested, and what is planned.

What do you want to do?

Every path below starts from the same install and needs one model key, except the first.

I want to… Command Key needed Guide
See it work without any key python -m agent_forge.eval --suite smoke None 1
Fix a bug from the terminal agent-forge run Any model key 2
Chat with the agent about my repo agent-forge chat Any model key 3
Use a web editor (browser UI) agent-forge studio Any model key 4
Use it inside Zed, JetBrains or Neovim agent-forge acp Any model key 5
Serve it as an HTTP API agent-forge serve Any model key 6
Split a larger job across parallel agents agent-forge super run Any model key 7
Gate a change in CI or a script agent-forge run --output-format json Any model key 8
Add my own tools or domain features agent-forge init-extension, MCP Depends on the tool 9
Check whether a model is good enough agent-forge models validate That model's key 10
Design a multi-agent system agent-forge system None (dry run) 11

Install once

You need: Python 3.11+ and Git. For real runs you also need a sandbox: Bubblewrap on Linux, or Docker on any OS.

git clone https://github.com/akoita/agent-forge.git
cd agent-forge
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[service]"        # [service] adds the web editor and HTTP API

Then set up one sandbox:

Your machine Do this once Pass on each command
Linux sudo apt install bubblewrap (or your distro's package) --sandbox-backend bwrap
macOS, Windows, or Linux with Docker Start Docker, then run make build-sandbox Nothing, Docker is the default

To make Bubblewrap the default for every command, run export AGENT_FORGE_SANDBOX_BACKEND=bwrap. The examples below assume you did this or use Docker.

Choose a model and key

Set the variable for the provider you want. Agent Forge reads keys from the environment only. They never enter the sandbox.

Provider Environment variable Example flags Notes
Google Gemini GEMINI_API_KEY none, it is the default (gemini-4-hydrogen) A free-tier key from Google AI Studio is enough to try these examples on gemini-4-hydrogen, within its daily quota. gemini-4-carbon and gemini-4-neon need a paid tier.
Anthropic Claude ANTHROPIC_API_KEY --provider anthropic --model claude-haiku-5-5 Haiku 5.5 is the cheapest. Sonnet 5.5, Opus 5.5 and Fable 5.2 also work.
OpenAI OPENAI_API_KEY --provider openai --model gpt-6-luna GPT-6 Luna is the cheapest. GPT-6.2 Sol and Astra also work.
OpenRouter OPENROUTER_API_KEY --provider openrouter --model anthropic/claude-sonnet-5-5 One key for many vendors.
Local model (Ollama, vLLM, llama.cpp) none --provider openai-compatible --base-url http://localhost:11434/v1 --model <name> No key and no cloud. Quality depends on the model.
export GEMINI_API_KEY="your-key"   # or ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY

To change the default model for good, set default_provider and default_model in agent-forge.toml. The configuration guide lists every setting and named profiles such as --model-profile anthropic-haiku55.

Getting started by use case

Run every command from the root of your clone, with the virtual environment active and a model key exported.

Most examples work on a small app with one failing test, examples/buggy-app. Each one starts with bash examples/new-buggy-app.sh, which copies it to /tmp/buggy-app as a Git repository of its own, or resets that copy if an earlier example changed it. Pass another directory as its argument to put the copy elsewhere.

1. See it work without a key

Replay scripted fixes through the full loop and verifier. No model is called and no sandbox is needed.

python -m agent_forge.eval --suite smoke

The deterministic-oracle rows report verified. The noop and incomplete rows report failed, which shows that the verifier rejects bad patches.

2. Fix a bug from the terminal

Give the agent a task and the command that proves it is done.

bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
agent-forge run \
  --task "Make the health check return 200 with status ok" \
  --repo /tmp/buggy-app \
  --verify-command "python -m unittest"

The run ends with Verification: verified or failed, its cost, and a patch file. Your repository stays unchanged. Apply the patch with the git apply command the run prints.

Useful flags: --max-cost 0.50 and --max-duration 300 cap spend and time, and --approval-mode prompt asks before risky actions. Follow or resume a run with agent-forge events <run-id> --follow and agent-forge resume <run-id>. More in verified coding runs.

3. Work interactively in a terminal chat

Open a multi-turn session on your repository. The agent edits your files in place, so start from a clean Git tree.

bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
agent-forge chat --repo /tmp/buggy-app

Type a request, such as fix the failing test. Then use /diff to see the changes, /undo to revert the last turn, /help for every command, and /exit to leave. /diff and /undo need a Git repository. Resume later with agent-forge chat --repo /tmp/buggy-app --resume latest. More in chat and sessions.

4. Use the web editor (Studio)

Agent Forge Studio is a browser editor with a file tree, Monaco editor, terminal and agent panel. It runs locally on your machine. There is no separate desktop app.

You also need: Node.js 22+ and the [service] extra from the install step.

(cd apps/studio && npm install && npm run build)   # once
bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
agent-forge studio --workspace /tmp/buggy-app

npm may warn that esbuild's install script is not covered by allowScripts. The build still succeeds, so you can ignore it.

Your browser opens Studio and connects on its own, so there is no token to type. No provider key exported? Click Add key above the prompt box, or API Keys in the top bar; the key is saved on your machine, never in the browser. Ask the agent for a change. Studio asks before risky actions. A page reload within an hour reconnects too. If the browser does not open, use the connect link printed in the terminal.

Ask the agent to start your app's dev server. A Ports chip such as 8000 ↗ appears in the status bar; click it to open the app in a new tab. The server keeps running between turns.

To start without a folder, run plain agent-forge studio. After you connect, Studio asks for one: browse to a project and press Open, or type a name and press Create and open. The picker starts in the directory where you ran the command. Use Open Folder in the top bar to switch folders later. More in ACP and Studio.

5. Use it inside your editor

Agent Forge speaks the Agent Client Protocol, so ACP editors can use it as their agent. For Zed, add this to ~/.config/zed/settings.json:

{
  "agent_servers": {
    "Agent Forge": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/akoita/agent-forge", "agent-forge", "acp"],
      "env": { "GEMINI_API_KEY": "your-key" }
    }
  }
}

If you installed from the clone, set "command" to the full path of .venv/bin/agent-forge and "args" to ["acp"] instead. On Linux without Docker, also add "AGENT_FORGE_SANDBOX_BACKEND": "bwrap" to env. JetBrains and Neovim setup is in the ACP and IDE guide.

6. Deploy it as an HTTP service

agent-forge serve runs a single-tenant API. Clients submit a task with POST /v1/runs, then poll it or stream its events, and fetch the verified patch.

1. Register a client. This writes ~/.agent-forge/service/clients.toml:

mkdir -p ~/.agent-forge/service
cat > ~/.agent-forge/service/clients.toml <<'EOF'
[clients.local-dev]
api_key_env = "AGENT_FORGE_LOCAL_CLIENT_KEY"
allowed_profiles = ["thorough"]
allowed_report_schemas = []
allowed_source_kinds = ["local_path"]
allow_local_path = true
max_active_runs = 1
max_runs_per_day = 25
EOF

2. Start the server. Keep your model key, and AGENT_FORGE_SANDBOX_BACKEND if you use Bubblewrap, exported in this shell.

export AGENT_FORGE_LOCAL_CLIENT_KEY="pick-a-client-secret"
export AGENT_FORGE_SERVICE_AUTH_ENABLED=true
export AGENT_FORGE_SERVICE_ALLOW_LOCAL_PATH_SOURCES=true
agent-forge serve --port 8000

3. Submit a task from a second shell, at the root of your clone:

bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
export AGENT_FORGE_LOCAL_CLIENT_KEY="pick-a-client-secret"   # same value as the server shell
curl -s -X POST http://127.0.0.1:8000/v1/runs \
  -H "Content-Type: application/json" \
  -H "X-Agent-Forge-API-Key: $AGENT_FORGE_LOCAL_CLIENT_KEY" \
  -d '{
    "schema_version": "agent-forge-run-request-v1",
    "client": {"name": "local-dev", "request_id": "demo-1"},
    "profile": {"id": "thorough"},
    "task": {
      "instruction": "Make the health check return 200 with status ok",
      "verify_command": "python -m unittest"
    },
    "source": {"kind": "local_path", "uri": "/tmp/buggy-app"}
  }'

The response holds a run_id. Poll GET /v1/runs/<run_id> until status is completed, then read the patch from GET /v1/runs/<run_id>/report. Send the same X-Agent-Forge-API-Key header on each call.

To run it in containers, use docker compose up agent-forge-service. The hosted service guide covers Git and archive sources, event streams, the Python client, and the trust model. The compose setup mounts the Docker socket, so keep it single-tenant.

7. Split a job across parallel agents (Super-Agent)

Note

Experimental and opt-in. Each ticket runs as a full agent, so a run costs a few times more than one agent-forge run.

The Super-Agent turns a multi-part request into tickets, runs each in its own Git worktree, verifies it, and merges the verified ones into your branch. It needs a Git repository with at least one commit, and it commits to that repository.

bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
agent-forge super run --repo /tmp/buggy-app --verify-command "python -m unittest" \
  "Improve the app:
- make health() return 200 with status ok
- add a docstring to tests/test_app.py"

Write one task per bullet line, and start the prompt with words, not a dash. The table at the end shows each ticket's state. agent-forge super status --repo /tmp/buggy-app shows it again later, and agent-forge super inbox lists items that wait for your approval. More in Super-Agent and systems.

8. Automate it in CI or scripts

agent-forge run exits non-zero when verification fails, so a script or CI job can gate on it. Run this in your own repository, with your own task and check command, to get a machine-readable report:

agent-forge run --task "Fix the flaky date parser test" --repo . \
  --verify-command "python -m pytest -q" \
  --max-cost 0.50 --output-format json --report-file run-result.json

run-result.json holds the run state, the verification result, token use, and the patch path. Store the model key as a CI secret and pass it as an environment variable.

9. Add tools, MCP servers and plugins

  • MCP tools: declare external MCP servers under [mcp.servers] in agent-forge.toml, then check them with agent-forge mcp list.
  • Your own extension: agent-forge init-extension my-extension scaffolds a package that adds tools and profiles. agent-forge extensions list shows what is loaded.
  • Domain plugins in plugins/: cloud deployment with plan-before-apply, EVM and Foundry, Proof of Audit reports, and a Harbor benchmark adapter.

Read extensions and MCP and the extending guide.

10. Check a model before you rely on it

Run a short, budgeted probe of tool calling, then a graded coding fix, on a named profile from agent-forge.toml:

bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
agent-forge models list
agent-forge models validate anthropic-haiku55 --live \
  --fix-repo /tmp/buggy-app \
  --fix-task "Make the health check return 200 with status ok" \
  --verify-command "python -m unittest"

It must run from the clone, where agent-forge.toml defines the profiles, and needs the key for that profile's provider: ANTHROPIC_API_KEY for anthropic-haiku55.

11. Design a multi-agent system (experimental)

Describe agents, tools and budgets in a system.yaml, then validate it, draw it, and dry-run it. No model is called.

bash examples/new-buggy-app.sh                     # fresh demo repo in /tmp/buggy-app
agent-forge system validate examples/systems/multi-agent-coding.yaml
agent-forge system plan examples/systems/multi-agent-coding.yaml --output-format mermaid
agent-forge system run examples/systems/single-agent.yaml --goal "Fix the health check" --repo /tmp/buggy-app

system run uses a stub simulator, and real execution is planned. See the system spec and the control plane for deployed systems.

How a verified run works

Verified run: pin HEAD, work in the sandbox, export the patch, verify on a clean checkout, report the result
  • Verified patches. The agent works against a pinned Git revision. Its patch is applied to a clean checkout and graded by your --verify-command, so a run cannot pass because the agent says it is done.
  • Sandboxed tools. Tools run in Docker with no network and CPU, memory and process limits, or in Linux Bubblewrap.
  • Budgets and approvals. Hard caps on cost, tokens and time, and auto, prompt or deny rules for risky actions.
  • A record of every run. An event journal you can follow live, resume from a checkpoint, or replay.
  • A small, generic core. Domain features live in plugins, and a CI check keeps domain code out of the core.
Watch a scripted replay of a run
Scripted terminal replay of Agent Forge fixing a health endpoint bug

This animation is a scripted replay (bash scripts/demo.sh), not a recording of a live model.

Project status

Agent Forge is alpha. The status page has every capability with its evidence and date.

Area State
Verified runs, chat, Studio, ACP, hosted API Available. Tested in CI with scripted models.
Super-Agent Experimental and opt-in.
system.yaml and control-plane deployments Experimental. Runs are simulated.
Live benchmarks (Terminal-Bench, SWE-bench subsets) Planned in milestone 19.

Architecture

Agent Forge architecture: clients, agent core, LLM adapters, sandbox and tools, verification, extensions

Clients (CLI, Studio, ACP, HTTP API) drive one agent core. The core calls models through provider adapters, runs tools in the sandbox, and verifies patches on a clean checkout. Read the architecture overview and the ADRs.

Documentation

Topic Read
Every feature Feature catalog · Documentation map · Status
Running it Configuration · Hosted service · ACP and IDEs · Extending
Design Architecture · Technical spec · Threat model
Direction Vision · Strategy · Roadmap

Contributing

Contributions are welcome. Read the contributing guide and the code of conduct, then:

pip install -e ".[dev]"
make check   # lint, boundary, release and docs checks, unit tests

The engineering guides cover adding a tool, a model provider, or an extension. Report vulnerabilities through the security policy.

License

MIT

About

Domain-agnostic AI coding harness — isolated Docker/Bubblewrap sandboxes, multi-provider model qualification, and independently verified patches.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages