I was "nerd-sniped" into asking: Why can't an agent in the browser just write dynamic code and
execute it?
Edge Agent is primed out of the box. No cloud VMs. No tedious local install. Just visit the page and get
value.
A true browser-native runtime
Add an AI agent to any web app with @tjfontaine/web-agent-core.
(Currently building from source).
import { WebAgent } from '@tjfontaine/web-agent-core';
const agent = new WebAgent({ provider, model, apiKey });
for await (const event of agent.send(prompt)) { ... }
All code runs in a WASM sandbox in your browser. No server-side execution, no cloud processing, no latency from round-trips.
Persistent storage using the browser's Origin Private File System. Your files survive page reloads and work offline.
Config stored locally in your browser's OPFSβnever sent to our servers. Direct API calls to your chosen provider.
Secure, isolated WebAssembly execution with Component Model. 50+ Unix commands, TypeScript, SQLite, Git, and more.
Tools exposed via Model Context Protocol. Connect to external MCP servers for Stripe, GitHub, and custom integrations.
Works with Anthropic Claude, OpenAI GPT, Google Gemini, and any OpenAI-compatible endpoint. Bring your own key.
Other agents require cloud VMs or complex local toolchains. Edge Agent just works. Visit the page, enter your key, and you have a full runtime.
Three components, one powerful agent
A terminal interface written in Rust, compiled to WASM. Renders via ghostty-web with full keyboard support.
Multi-turn agent built with Rig. Supports Anthropic, OpenAI, Gemini, and any OpenAI-compatible endpoint.
WASI P2 runtime with MCP server. Files persist in OPFS. TypeScript compiles via SWC and executes in QuickJS.
Write TypeScript, the agent compiles and runs itβall in your browser.
Everything you need, in the browser
ls, cat, grep, sed, find, curl, jq, diff, sort, wc, and more
Run TSX with ESM imports auto-resolved from CDN
Full sqlite3 support with persistent storage
Modal editing with syntax highlighting
init, add, commit, status, log, diff
curl and fetch() with full network access
Use the browser sandbox with any MCP-compatible agent
Run Claude Code with all built-in tools disabled, and let it execute commands in your browser sandbox via MCP.
claude --tools "" --mcp-config '{"mcpServers": {"browser-sandbox": {"type": "http", "url": "http://localhost:3050/mcp"}}}'