What If Your AI Agent Never Had to Leave the Browser? A developer demonstrated a browser-native AI agent runtime that runs entirely client-side using Pyodide, compiling CPython to WebAssembly so a ReAct-style tool-using loop executes inside a browser tab with no backend, container, or SSH. The demo agent calls arithmetic and virtual-filesystem tools through a deterministic policy function standing in for an LLM, with explicit termination via a final action or an eight-step cap, and the author notes the policy can be swapped for a fetch call to a real model without changing the loop. Most AI agents today run in a Python process on a server or your laptop. They call APIs, maybe execute shell commands, and return text. But what if the agent's entire runtime lived inside a browser tab? No backend, no container, no SSH. Just JavaScript and WebAssembly, with a Python kernel compiled to WASM. This post walks through a minimal agent loop that runs entirely client-side using Pyodide — Python in the browser via WebAssembly. We'll build a tool-using agent that can do arithmetic, read from a virtual filesystem, and stop under explicit conditions. All code is runnable in a modern browser. Server-side agents have friction: A browser-native agent flips this. The sandbox is the browser tab. The runtime is WebAssembly. The only network call is loading the Python runtime itself. We'll use Pyodide https://pyodide.org/ to run CPython in the browser. The agent loop is a simple ReAct-style loop: the model proposes a tool call, we execute it in Python, append the result, and repeat until a termination condition is met. We won't call a real LLM here — instead we use a deterministic policy function so the demo is reproducible and offline. Swap the policy for a fetch to an LLM API and the loop is unchanged. We'll call this a "ReAct-style" loop because it follows the observe-think-act pattern, not because it implements the exact paper. Termination conditions explicit : final action. MAX STEPS default 8 . < doctype html