AgentForge

A Python terminal harness for coding agents, with typed tools, approval gates, MCP, skills and resumable sessions.

Stars
★ 67
Last updated
3d ago
FARS reviewed
Nov 24, 2026
License
MIT
Primary language
Python

At a glance

How it runs
CLI
Works with
Universal · cross-platformOpenAI API · Claude API
Cost
Free software; you pay for model usage
Setup effort
Low · running in minutes
You'll need
Python (pip install)npx (optional, for npx-based MCP servers)Shell / CLINetwork accessLocal filesystemMCP Server
Typical use
Engineers who want to understand coding-agent internals: read or edit the loop, tool registry, compaction and approval modules directly and experiment.
Not a fit if
  • Teams needing production multi-agent orchestration: swarm mode, deterministic replay and workspace rollback are still planned.
  • Anyone expecting a sandboxed runtime: shell commands and MCP servers are explicitly not sandboxed.
  • Developers who want an IDE-embedded assistant rather than a terminal TUI.
Maintenance
Commits in the last 30 dayslast commit 2026-11-21

What does this agent do, and when should you use it?

AgentForge (PyPI package agentforge-harness, CLI agentforge) is a Python terminal coding-agent harness built as a learning lab for how coding agents are structured, not a chatbot wrapper. Each interactive run is owned by a Session object that wires together an LLMClient, ToolRegistry, MCPManager, ContextManager, ApprovalManager, HookSystem, ChatCompactor, LoopDetector and PersistenceManager. The loop in agentforge_harness/agent/agent.py is a hybrid ReAct/function-calling loop: text deltas stream to a Rich TUI, completed tool calls are validated against Pydantic schemas and executed through the registry, and observations return to context. Fourteen built-in tools cover file read/write/edit, unified-diff patching, git_diff inspection, shell, grep/glob, todos and memory, and web search/fetch, while external MCP servers register tools as server__tool. Safety lives in the harness: secret redaction, output hygiene, <untrusted_content> prompt-injection boundaries and six approval modes — though the README states plainly that this is not a sandbox. State is captured as atomic session snapshots, JSONL event logs and checkpoints under the platform data directory, so runs can be resumed, restored and exported to Markdown or HTML; deterministic replay, workspace rollback and swarm orchestration are still planned.

A user message reaches the CLI, Agent.run() adds it to context and sends it with the tool schemas to the model. Text deltas render live in the Rich TUI; completed tool calls go through ToolRegistry, which looks up the tool, validates params against a Pydantic schema, runs before-tool hooks, checks approval for mutating operations, executes the tool, then passes the result through output_hygiene.py (ANSI/control-character stripping and truncation), redaction.py (secret removal), and prompt_injection.py (untrusted-content wrapping) before after-tool hooks fire and a ToolResult is appended to context as an observation. ContextManager assembles the system prompt, project instructions, user memory, messages and tool results; ChatCompactor has the model write a continuation summary when context grows too large, LoopDetector catches repeated actions and cycles, and a circuit breaker with a fallback chain switches models after consecutive errors. Every event is appended to a JSONL event log; /save, /checkpoint, /resume and /restore handle snapshots and recovery, /report prints a session summary and /export writes Markdown or HTML. /plan blocks mutating tools at the registry layer, /build restores them, and agentforge doctor checks config, provider keys, skill roots, MCP commands and safety flags.

  1. Engineers who want to understand coding-agent internals: read or edit the loop, tool registry, compaction and approval modules directly and experiment.
  2. Teams building an internal coding assistant: start from the MIT-licensed code and extend it with dynamic tools under .agentforge/tools and [[subagents]] config entries.
  3. Researchers studying harness safety: compare behaviour across six approval modes, secret redaction, output hygiene and prompt-injection boundaries.
  4. Developers who want external MCP servers in a terminal workflow, exposing them via [mcp_servers.*] with server__tool naming.
  5. Anyone who prefers inspect-before-edit: use /plan to restrict the agent to read-only tools and produce a plan, then /build to implement and run checks.
  6. Teams that need an audit trail of agent runs: JSONL event logs, checkpoints, /report --json and session export show which tools fired and when.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Install / run
  • pip install agentforge-harness
  • pip install -e ".[dev]"
Environment variables
OPENROUTER_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY API_KEY BASE_URL
Config files
.agentforge/config.toml

How do you install or deploy this agent?

You need Python with pip and credentials for at least one model provider: OPENROUTER_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, or API_KEY / BASE_URL for a custom OpenAI-compatible endpoint.

Install from PyPI and initialize:

pip install agentforge-harness
agentforge init
agentforge doctor
agentforge

For an isolated install:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install agentforge-harness
agentforge init
agentforge doctor
agentforge

For local development from the repository:

pip install -e ".[dev]"
agentforge --version
agentforge doctor

agentforge doctor --json gives machine-readable output, and agentforge doctor fix applies safe fixes.

How do you use this agent?

Start by exporting a provider key, for example OpenRouter:

export OPENROUTER_API_KEY=sk-or-v1-...

Then write the project config at .agentforge/config.toml:

hooks_enabled = true
approval = "on-request"
max_turns = 100
output_hygiene_enabled = true
redaction_enabled = true
prompt_injection_protection_enabled = true
skills_enabled = true
skill_roots = [".skills"]

[model]
provider = "openrouter"
name = "deepseek/deepseek-v4-flash:free"
temperature = 1.0
context_window = 256000
max_output_tokens = 4096
fallbacks = ["openai/gpt-4o-mini", "anthropic/claude-sonnet-4"]

Run a single prompt or start interactive mode:

agentforge run "read the current project and explain the agent loop"
agentforge

Inside the TUI use /plan and /build to switch modes, /approval <mode> to change policy, /tools, /skills and /mcp to inspect registered capabilities, /save, /checkpoint, /resume <session_id> and /restore <checkpoint_id> for state, /compact to force compaction, /export html to export, and /reload to hot-reload config. You can also read the last report without starting the agent:

agentforge report --json

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

External MCP tool bridge

Inherits capabilities of connected MCP servers; audit third-party servers before enabling.

What are this agent's strengths and limitations?

Pros
  • Transparent, separable architecture: the loop, registry, approval, compaction, loop detection and persistence each live in their own module, so the harness is readable rather than monolithic.
  • Multi-provider with a real fallback chain: OpenRouter, OpenAI, Anthropic and custom OpenAI-compatible endpoints, backed by a circuit breaker that moves to the next fallback model after consecutive errors.
  • Safety enforced in code, not only in prompts: centralized redaction before hooks/TUI/persistence, output hygiene, <untrusted_content> wrapping, six approval modes, and plan mode blocking mutations at the registry layer.
  • Recoverable and auditable runs: atomic snapshots, JSONL event logs and checkpoints with /resume, /restore, /report and Markdown/HTML export.
  • Multiple extension points: dynamic tools from .agentforge/tools, config-declared hooks receiving AGENTFORGE_* env vars, MCP servers, [[subagents]] with allowed_tools, and progressively disclosed skill roots.
Limitations
  • Pre-1.0: swarm mode, deterministic replay, workspace rollback, /cost tracking and git tools are listed as in progress or planned.
  • Not a sandbox by the project's own statement: shell commands and MCP servers are unisolated, and prompt-injection handling does not trace whether later tool calls derive from untrusted content.
  • Requires a Python runtime plus a model provider account; cloud models mean outbound network and per-use billing.
  • Wide configuration surface: many config.toml keys and six approval modes take real tuning before behaviour matches expectations.
  • Terminal TUI only — no IDE plugin or graphical interface.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
AgentForge This agent 55 · Major gaps CLIFree + model costs ★ 67 3d ago Python OpenAI API · Claude API
zerostack 69 · Some gaps CLIFree + model costs ★ 1.8k 5d ago Rust OpenAI API · Claude API
agentty 73 · Some gaps CLIFree + model costs ★ 561 today C++ OpenAI API · Claude API
Pi Agent Harness 65 · Some gaps CLIFree + model costs ★ 124k today TypeScript OpenAI API · Claude API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
55/ 100 5-point scale 2.8 / 5
Trust 14/29
Reliability 8/14
Adaptability 12/18
Convention 10/18
Effectiveness 6/13
Verifiability 5/8
Why each dimension lost points
Trust14 / 29 · 2.4/5

Evidence shows approval modes, tool allowlists, read-only subagents, Plan mode, secret redaction, output hygiene, prompt-injection boundaries, and owner-only snapshot permissions, so least privilege, user confirmation, data-flow transparency, and sensitive-data handling have real implementations but are not a sandbox. Deductions: yolo/auto modes can relax approvals; shell/MCP/hooks still run as trusted local code and external effects lack isolation; dependencies are unpinned with no audit/hash evidence; workspace rollback is planned while only chat/context checkpoints are implemented; MIT and author info are clear, but third-party attribution and publisher identity are unverified.

Reliability8 / 14 · 2.9/5

README, configuration docs, SECURITY, and tests corroborate approval, retry, event lifecycle, and failure paths; failure messages include retry events, circuit breaker, and error events. Deductions: dependencies are mostly listed without version constraints except pydantic, and there is no lockfile or dependency-audit evidence; although the package is on PyPI, static review cannot verify installability or long-term dependency availability.

Adaptability12 / 18 · 3.3/5

Docs clearly target developers studying harness engineering and cover terminal TUI, single-run mode, skills, MCP, subagents, and multiple providers; capability boundaries are explicit in README and SECURITY, including the statement that it is not a sandbox and the separation of implemented versus planned features; skill matching is conservative and the environment requires Python 3.10+ in a terminal. Deductions: no full FAQ or broad deployment/environment guidance, and several advanced capabilities remain roadmap items.

Convention10 / 18 · 2.8/5

Information architecture is clear: README, docs, SECURITY, pyproject, tests, and example skills form a readable structure; install steps are explicit, the MIT license is complete, and known limitations are documented. Deductions: version 0.1.4 has no CHANGELOG; naming stability is uncertain due to alpha status and roadmap changes; examples/FAQ are limited; maintenance responsibility is only author/Issues/private-report guidance, and publisher identity is unverified.

Effectiveness6 / 13 · 2.3/5

Output usability is supported by TUI, event logs, JSON/HTML/markdown export, checkpoints, and stats, which fit learning and debugging agent loops. Deductions: marginal value is limited by the crowded coding-agent harness space and the project's self-description as a learning lab; cost-benefit lacks local evals, deterministic replay, or quantitative comparison, and LLM costs versus benefits cannot be confirmed statically.

Verifiability5 / 8 · 3.1/5

README claims map to source structure, configuration docs, SECURITY, and test files, and the docs separate implemented from planned behavior, so fact/inference separation is reasonably handled. Deductions: the packet contains a sample rather than every file, so not all claims can be checked; there is no CHANGELOG/release record to corroborate version evolution, and some performance/safety effects remain documentation claims.

Risks and how to mitigate them
  • AgentForge explicitly is not a sandbox; shell, MCP servers, and hooks run as trusted local code, and approval gates are not OS isolation.
  • Approval modes such as yolo/auto relax or skip confirmation and should be used only in disposable workspaces; keep on-request as the default.
  • Workspace rollback is still planned; current checkpoints mainly restore chat/context state and are not a substitute for file-level rollback.
  • Dependencies are largely unpinned and there is no lockfile or dependency-audit evidence; pin and audit versions before production use.
  • Publisher identity is unverified, and this is a static sample review without execution, installation, or security testing.
Evidence confidence: Low Reviewed Nov 24, 2026 Reviewed revision 19ac59ab0fc8
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/agentforge.svg)](https://followagents.com/en/agents/agentforge)
<a href="https://followagents.com/en/agents/agentforge"><img src="https://followagents.com/badge/agentforge.svg" alt="FARS review"></a>

FAQ

Do I need a paid model API to use it?
The framework itself is free under MIT; cost comes from whichever provider you point it at. It supports OpenRouter (the README example uses a model name with a free suffix), OpenAI, Anthropic, and custom OpenAI-compatible endpoints such as base_url = "http://localhost:11434/v1" for a local server.
Does it isolate the commands the agent runs?
No. The README is explicit that redaction, approval and prompt-injection boundaries are protective layers, not a sandbox, and that shell commands and MCP servers are not sandboxed. Real isolation has to come from your container or VM.
Can I inspect what happened after a run ends?
Yes. Every agent event the CLI handles is appended to JSONL under events/, snapshots live in sessions/ and checkpoints in checkpoints/. Use /report (or agentforge report --json) for a summary, /resume and /restore to bring state back, and /export for Markdown or HTML.
How do I add my own tools, skills or subagents?
Drop dynamic tools into .agentforge/tools, or subclass Tool from agentforge_harness/tools/base.py with a name, description, ToolKind, Pydantic schema and async execute(). Skills are SKILL.md folders under .agentforge/skills or ~/.agents/skills. Subagents are declared in config.toml via [[subagents]] with allowed_tools, max_turns and timeout_seconds. Hooks bind to before_agent, after_agent, before_tool and after_tool via [[hooks]].
Is it ready for a production pipeline?
The project describes itself as a learning lab; the v1 focus is packaging, docs, tool reliability and a clear safety baseline, with deterministic replay, workspace rollback, browser QA and read-only swarm sequenced after 1.0. It is a good fit for evaluation and internal experiments, not yet as a production orchestration engine.
Is AgentForge open source?
Yes. The source code is on GitHub (MohitGoyal09/AgentForge) under the MIT licence.
Is AgentForge safe to use?
FollowAgents' FARS review (Nov 24, 2026) scored AgentForge 14/29 on trust and safety. None of the eight safety controls the review checks for was missing outright.
Is AgentForge still maintained?
Yes. The latest commit on GitHub is from 2026-11-21, within the last 30 days.
Who makes AgentForge?
AgentForge is published on GitHub by the account MohitGoyal09. FollowAgents has not verified which person or company is behind that account.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts