# Agent Forge

> An open-source TypeScript library that lets a web app expose its real operations to AI agents as typed tools, each with a declared effect and a flag for consequential actions.

- Tags: Web, Agents, Open source
- Areas: [Agent-Ready Web Applications](https://dreamawakelabs.com/agent-ready-web.md), [AI agents & business automation](https://dreamawakelabs.com/agents.md), [Custom engineering](https://dreamawakelabs.com/software.md)

## What it is

When an AI agent uses a website, it usually clicks through the interface or scrapes it. That breaks when the layout changes, and the business cannot tell a harmless lookup from an action that sends money or personal details. Agent Forge is the layer that decides what a site exposes, how it is described, and which calls need a person to confirm.

## What we built

A developer defines each operation once with defineCapability: a stable id, a description, a JSON Schema for input, and an effect class (read, reversible write, write, or irreversible write). A consequential flag marks actions that need a person to confirm, and defaults to true for irreversible writes. The WebMCP adapter registers each capability as a tool in the browser, and an execution observer reports metadata-only lifecycle events, never input values. Apache-2.0.

## How it is used

Agent City defines its five demo tools with it, the WebMCP Replay Room defines its six, and The Rectangle website uses it for the tools browser agents call to ask about services and send an inquiry.

## Behind the experience

- [Agents & Operations](https://dreamawakelabs.com/technology#platform-agents): Tools for people and agents. Systems: [Agent Forge](https://dreamawakelabs.com/technology#agent-forge)

## Our technology

- Agent Forge: This is the library itself.

## Built with

TypeScript, WebMCP, JSON Schema, Vitest, Apache-2.0

## Media

- Diagram: an application defines four capabilities, from a read to an irreversible write, with the two writes flagged consequential. Agent Forge runs each call through one execution wrapper in four steps and emits metadata-only execution events. The WebMCP adapter publishes the tools to a browser agent. (One capability definition, published to agents through an adapter.): https://dreamawakelabs.com/work/agent-forge/capability-flow.svg

## Links

- [Source on GitHub](https://github.com/DreamAwakeLabs/agent-forge) (Source code)

## Credit

Written and maintained by Dream Awake Labs. Open source under Apache-2.0.

[All projects](https://dreamawakelabs.com/work.md)
