SuperAPIAI Directory

AgentForge

github.com · AI developer platforms

AgentForge is an open-source terminal AI coding agent framework (harness) written in Python, designed to help learners understand the internal structure of modern coding agents. It is not a simple chatbot wrapper, but is built around core mechanisms such as the agent loop, tool calling, MCP integration, the skills system, security approvals, persistence, and checkpoints. The project supports OpenRouter, OpenAI, Anthropic, and custom OpenAI-compatible model providers, and offers streaming responses, typed tool calls, approval gates, output sanitization, secret redaction, prompt injection boundaries, hooks, subagents, context compaction, loop detection, persistent memory, session snapshots, event logs, JSON reports, HTML/Markdown session export, resume/restore commands, plan/build modes, a skills system, and a Rich terminal interface. It can be installed via pip install agentforge-harness and is suitable as a teaching lab environment for learning AI framework engineering.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

AgentForge is a Python-based terminal AI coding agent framework (harness), positioned as a teaching lab project for learning how modern coding agents are built. It is not a simple chatbot wrapper; rather, its code is organized around the core framework concerns that make coding agents reliable, inspectable, and safe.

Purpose and Positioning The project is primarily used to study topics such as the agent loop, tool calling, MCP (Model Context Protocol), the skills system, security mechanisms, and persistence. The repository explicitly states its intent as a learning lab for AI framework engineering, and the v1 release focuses on packaging, documentation, tool reliability, release standards, and a clear security baseline.

Key Capabilities

  • Agent loop: uses a hybrid ReAct/function-calling loop, in which the model reasons in natural language and executes actions through typed tools.
  • Model providers: supports OpenRouter, OpenAI, Anthropic, and custom OpenAI-compatible providers, with streaming responses.
  • Tool system: tools inherit from a base class and provide Pydantic schemas, an async execute() method, and optional approval metadata; built-in tools cover files, search, shell, web, memory, and to-dos, and local tools can be dynamically discovered from .agentforge/tools.
  • Security and approvals: centralized secret redaction (covering common API keys, GitHub tokens, JWTs, private key blocks, and more), output sanitization (removing ANSI escapes and unsafe control characters), prompt injection boundaries (wrapping tool observations as untrusted content), and 6 approval modes.
  • Hook system: supports lifecycle triggers such as before/after agent, before/after tool, and on error, passing runtime context through environment variables.
  • MCP integration: external MCP servers can expose tools to the agent, using server__tool naming to avoid conflicts.
  • Subagents: built-in read-only subagents (exploration, debugging, codebase investigation, code review, test planning, architecture) with support for configuring allowed tools.
  • Context management: system prompts, message management, pruning of old tool outputs, generating compaction summaries when context grows too large, and budget estimates with a 70% warning and 80% automatic compaction.
  • Persistence and checkpoints: session snapshots, event JSONL logs, checkpoints (including message history, tools, MCP server names, snapshots of changed files, git diff capture, checkpointreasons), supporting resume, restore, and checkpoint commands.
  • Other: loop detector, circuit breaker and model fallback chain, persistent user memory, plan/build modes and tool filtering, config hot reload, skill system (progressive disclosure, auto-activation, body token limits), Rich terminal interface, CLI commands (new, reload, version, retry, history, report, export, todos --clear, config pretty-print, etc.).

Usage Install from PyPI: pip install agentforge-harness. After creating a provider configuration, verify the settings, then launch the terminal UI. Supports single-prompt runs, interactive mode, specifying a working directory, local readiness checks, printing the latest session report, etc. Configuration is loaded from the user config directory and the project-local .agentforge/config.toml.

Use cases Suitable for learners and developers who want to deeply understand the internal mechanisms of coding agents, for studying engineering practices such as agent loop design, tool-calling contracts, security boundaries, context management, persistence, and checkpoints.

Limitations The project's self-described redaction is not a sandbox and cannot make arbitrary tools or MCP servers safe; prompt injection protection is a boundary layer rather than a complete policy engine, and it does not yet track whether subsequent tool calls originate from untrusted content, nor does it sandbox shell commands or MCP servers. Some features (cost tracking, secret scanning, prompt injection test suite, browser tools, deterministic replay, workspace rollback, read-only swarm, etc.) are still in progress or planned. The project uses the MIT license.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools