Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js template for building AI coding agents that run Claude Code, Codex, Copilot, Cursor, Gemini, and opencode in Vercel Sandboxes.
The Coding Agent Template is a deployable Next.js 15 app from Vercel Labs that builds AI-powered coding agents, letting users run Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, Cursor CLI, Google Gemini CLI, or opencode inside Vercel Sandboxes to automatically complete coding tasks on GitHub repositories.
The Coding Agent Template is a publicly available web application that pairs a Next.js frontend with Vercel Sandbox execution. Users sign in with GitHub or Vercel OAuth, enter a repository URL and a natural-language task, and the template spins up an isolated sandbox where the selected CLI coding agent edits the code, commits the changes, and pushes them to a new branch. The project is maintained in the Vercel Labs GitHub organization and uses Neon Postgres with Drizzle ORM for storage, Vercel AI Gateway for model routing, and AI SDK 5 for branch-name generation and agent integration.
feature/add-user-auth-K3mP9n are produced by AI SDK 5 + AI Gateway using Next.js 15's non-blocking after() hook, with a timestamp fallback if generation fails.deletedAt column) instead of permanent removal.ENCRYPTION_KEY.The template suits developers who want a self-hosted AI coding agent UI without building the plumbing themselves. Platform engineers can deploy it as an internal tool where team members authenticate with GitHub and run sandboxed code changes. SaaS founders can fork it to resell AI coding as a product. Maintainers of open-source projects can use it to automate branch creation for dependency bumps, documentation, and bug fixes.
npm run dev) starts automatically in the background so you can inspect the running app before the sandbox expires.A task flows through six stages: the user creates a task with a repository URL and prompt; the template stores it in Postgres; AI Gateway generates a branch name via a non-blocking after() call; Vercel Sandbox provisions an isolated environment with the repo; the chosen agent analyzes the prompt and makes edits; and finally Git operations commit and push to the generated branch. After that the sandbox either shuts down immediately (Keep Alive off) or stays alive for follow-up messages (Keep Alive on).
The template is available on GitHub and can be cloned at no cost, but running it requires your own Vercel account, a Neon Postgres database, and API keys for the agents you use (Anthropic, OpenAI, Cursor, Gemini, or AI Gateway), which generate usage-based charges.
The template supports Claude Code, OpenAI's Codex CLI, GitHub Copilot CLI, Cursor CLI, Google Gemini CLI, and opencode. You can select the agent per task, and users can override global API keys with their own in their profile settings.
Deployment needs POSTGRES_URL, Vercel sandbox credentials (SANDBOX_VERCEL_TOKEN, SANDBOX_VERCEL_TEAM_ID, SANDBOX_VERCEL_PROJECT_ID), JWE_SECRET for session encryption, and ENCRYPTION_KEY for encrypting user tokens. At least one OAuth provider (GitHub or Vercel) must also be configured.
Yes, if the Keep Alive setting is on. The sandbox stays alive until the maximum duration timeout (default 5 hours, configurable per deployment) so you can send follow-up messages or interact with a running dev server. With Keep Alive off, the sandbox shuts down immediately after changes are pushed.
No, MCP server connectors currently work only with the Claude Code agent. You add servers through the Connectors tab by providing a name, base URL, and optional OAuth credentials; using OAuth requires ENCRYPTION_KEY to be set.
