AgentForge
A Python terminal harness for coding agents, with typed tools, approval gates, MCP, skills and resumable sessions.
- Source repo
- MohitGoyal09/AgentForge
- Stars
- ★ 67
- Last updated
- 3d ago
- FARS reviewed
- Nov 24, 2026
- License
- MIT
- Primary language
- Python
- FA score
- 55/100 · Major gaps
At a glance
- How it runs
- 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
- 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
- Source review
- 55/100 · Major gaps
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.
- Engineers who want to understand coding-agent internals: read or edit the loop, tool registry, compaction and approval modules directly and experiment.
- Teams building an internal coding assistant: start from the MIT-licensed code and extend it with dynamic tools under
.agentforge/toolsand[[subagents]]config entries. - Researchers studying harness safety: compare behaviour across six approval modes, secret redaction, output hygiene and prompt-injection boundaries.
- Developers who want external MCP servers in a terminal workflow, exposing them via
[mcp_servers.*]withserver__toolnaming. - Anyone who prefers inspect-before-edit: use
/planto restrict the agent to read-only tools and produce a plan, then/buildto implement and run checks. - Teams that need an audit trail of agent runs: JSONL event logs, checkpoints,
/report --jsonand 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-harnesspip install -e ".[dev]"
- Environment variables
OPENROUTER_API_KEYOPENAI_API_KEYANTHROPIC_API_KEYAPI_KEYBASE_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
agentforgeFor an isolated install:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install agentforge-harness
agentforge init
agentforge doctor
agentforgeFor local development from the repository:
pip install -e ".[dev]"
agentforge --version
agentforge doctoragentforge 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"
agentforgeInside 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 --jsonSafety 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)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
What are this agent's strengths and limitations?
- 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,/reportand Markdown/HTML export. - Multiple extension points: dynamic tools from
.agentforge/tools, config-declared hooks receivingAGENTFORGE_*env vars, MCP servers,[[subagents]]withallowed_tools, and progressively disclosed skill roots.
- Pre-1.0: swarm mode, deterministic replay, workspace rollback,
/costtracking 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.tomlkeys 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?
Why each dimension lost points
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.
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.
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.
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.
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.
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.
- 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.
FAQ
Do I need a paid model API to use it?
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?
Can I inspect what happened after a run ends?
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?
.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?
Is AgentForge open source?
Is AgentForge safe to use?
Is AgentForge still maintained?
Who makes AgentForge?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.