
Template details
Open Agents
Open-source reference app for building background coding agents on Vercel, with web UI, agent runtime, sandbox orchestration, and GitHub integration.
About this template
Open Agents is an open-source Vercel reference template for building and running background coding agents that convert a chat prompt into code changes — bundling a Next.js web UI, a durable agent workflow, sandbox orchestration, and GitHub integration for auto-commits and pull requests.
What is Open Agents?
Open Agents is an open-source reference app from Vercel Labs for building and running background coding agents on Vercel. It takes a natural-language chat prompt as input and produces code changes in a cloned GitHub repository, with optional auto-commit, push, and pull-request creation. The project is organized as a three-layer system — a Next.js web app, a Workflow SDK-backed agent runtime, and isolated Vercel sandbox VMs — and is designed to be forked and adapted rather than treated as a black box.
What makes Open Agents stand out?
The defining architectural decision is that the agent does not run inside the sandbox VM. The agent runs as a durable workflow outside the VM and interacts with it through tools such as file reads, edits, search, and shell commands — so agent execution is not tied to a single request lifecycle, sandboxes can hibernate and resume independently, and model/provider choices can evolve separately from the sandbox implementation.
- Chat-driven agent tools — file reads/edits, search, shell, task, skill, and web tools operate on a sandboxed workspace.
- Durable multi-step execution — each chat request starts a Workflow SDK run that can continue across many persisted workflow steps, with streaming and cancellation; active runs can be resumed by reconnecting to the existing stream.
- Isolated Vercel sandboxes — VMs with snapshot-based resume expose ports 3000, 5173, 4321, and 8000, can use an optional base snapshot, and hibernate after inactivity.
- GitHub integration — clones repositories and creates branches inside the sandbox; after a successful run it can optionally auto-commit, push, and open a pull request.
- Better Auth sign-in — Vercel and GitHub are pre-configured as social providers, with auth routes served from an /api/auth catchall.
- Session sharing — chat sessions can be shared via read-only links.
- Optional voice input — an ElevenLabs API key enables voice transcription for prompts.
- One-click Vercel deployment — the deploy button auto-provisions Neon Postgres, with optional Upstash KV for caching skills metadata.
Who should use Open Agents?
- Developers building a custom coding-agent service — fork the repo and customize the agent runtime, tools, and sandbox behavior without starting from scratch.
- Teams that want a self-hosted AI coding assistant — deploy on Vercel, connect to a GitHub org, and control auth and resource settings themselves.
- Technical founders prototyping background-agent products — the agent-sandbox separation and durable workflow architecture offer a working reference for turning prompts into code reviews, PRs, and long-running tasks.
- Engineers studying workflow plus sandbox design — the code shows how to combine Next.js, Workflow SDK, and isolated VMs for background execution.
What can you do with Open Agents?
- Turn GitHub issues into pull requests: clone a repo into a sandbox, let the agent edit files, and automatically push a branch with a PR when the run succeeds.
- Run hands-free coding tasks: start an agent from chat and let it execute file edits, shell commands, and tests inside the sandbox while your laptop is disconnected.
- Build a voice-enabled coding assistant: add an ElevenLabs API key to issue prompts by voice and have the agent work through the same durable workflow.
- Share agent sessions: create read-only links so others can review chat history and changes without write access.
How does Open Agents work?
Open Agents follows a three-layer architecture: web app → agent workflow → sandbox VM. The Next.js web app handles auth, sessions, chat, and streaming UI; the agent runs as a durable workflow on Vercel's Workflow SDK; the sandbox provides the execution environment with filesystem, shell, git, dev servers, and preview ports. Each agent turn can continue across many persisted workflow steps, and sandboxes can hibernate and resume via snapshots.
Pros and cons
Pros:
- Open-source and explicitly intended to be forked and adapted.
- Clean separation of agent runtime and sandbox so each can evolve independently.
- Durable runs with streaming, cancellation, and resume support.
- Optional auto-commit and auto-PR creation after successful runs.
Cons:
- The full GitHub-enabled flow requires creating and configuring a GitHub App plus six related environment variables, which adds setup complexity.
- Even a minimal deployment needs POSTGRES_URL and BETTER_AUTH_SECRET, and sign-in also requires Vercel OAuth credentials.
FAQ
What does Open Agents do?
Open Agents is an open-source reference template for building and running background coding agents on Vercel. It provides a Next.js web UI, a durable agent workflow, isolated sandbox VMs, and GitHub integration, so a chat prompt can result in code changes committed to a repo — including a pull request — without keeping a laptop involved.
Does Open Agents require a GitHub App?
A GitHub App is required for the full coding-agent flow: cloning repos, working on branches, and pushing changes with optional PRs. For basic Vercel OAuth sign-in without repo access, you can deploy with only the Vercel OAuth credentials, but auto-commit and PR features won't work.
What is the OPEN_AGENTS_RESOURCE_PROFILE environment variable?
Setting OPEN_AGENTS_RESOURCE_PROFILE to hobby makes the app use Hobby-compatible defaults for chat and sandbox resources on Vercel; leaving it unset uses standard behavior. This is useful when deploying to a Vercel Hobby plan and wanting resource defaults that match it.
Can I run Open Agents locally?
Yes. Enable Corepack, install dependencies with pnpm, copy apps/web/.env.example to apps/web/.env, fill in POSTGRES_URL and BETTER_AUTH_SECRET, and run pnpm web. If you already have a linked Vercel project, you can pull env vars locally with vc env pull.
















