vercel-labs / open-agents
- четверг, 16 апреля 2026 г. в 00:00:04
An open source template for building cloud agents.
Open Agents is an open-source reference app for building and running background coding agents on Vercel. It includes the web UI, the agent runtime, sandbox orchestration, and the GitHub integration needed to go from prompt to code changes without keeping your laptop involved.
The repo is meant to be forked and adapted, not treated as a black box.
Open Agents is a three-layer system:
Web -> Agent workflow -> Sandbox VM
The agent does not run inside the VM. It runs outside the sandbox and interacts with it through tools like file reads, edits, search, and shell commands.
That separation is the main point of the project:
A few details that matter for understanding the current implementation:
3000, 5173, 4321, and 8000, and hibernate after inactivity.These requirements are based on the current apps/web codepath, not older setup scripts.
These are the hard requirements for the app to boot and load server state:
POSTGRES_URL=
JWE_SECRET=A useful deployment also needs token encryption plus Vercel OAuth sign-in:
ENCRYPTION_KEY=
NEXT_PUBLIC_VERCEL_APP_CLIENT_ID=
VERCEL_APP_CLIENT_SECRET=Without these, the site can deploy, but Vercel sign-in will not work.
If you want users to connect GitHub, install the app on repos/orgs, clone private repos, push branches, or open PRs, add these GitHub App values:
NEXT_PUBLIC_GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_APP_ID=
GITHUB_APP_PRIVATE_KEY=
NEXT_PUBLIC_GITHUB_APP_SLUG=
GITHUB_WEBHOOK_SECRET=REDIS_URL=
KV_URL=
VERCEL_PROJECT_PRODUCTION_URL=
NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL=
VERCEL_SANDBOX_BASE_SNAPSHOT_ID=
ELEVENLABS_API_KEY=REDIS_URL / KV_URL: optional skills metadata cache (falls back to in-memory when not configured).VERCEL_PROJECT_PRODUCTION_URL / NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL: canonical production URL for metadata and some callback behavior.VERCEL_SANDBOX_BASE_SNAPSHOT_ID: override the default sandbox snapshot.ELEVENLABS_API_KEY: voice transcription.Recommended path: deploy this repo at the repo root on Vercel, then layer on auth and GitHub integration.
Fork this repo.
Create a PostgreSQL database and copy its connection string.
Generate these secrets:
openssl rand -base64 32 | tr '+/' '-_' | tr -d '=\n' # JWE_SECRET
openssl rand -hex 32 # ENCRYPTION_KEYImport the repo into Vercel.
Add at least these env vars in Vercel project settings:
POSTGRES_URL=
JWE_SECRET=
ENCRYPTION_KEY=Deploy once to get a stable production URL.
Create a Vercel OAuth app with callback URL:
https://YOUR_DOMAIN/api/auth/vercel/callback
Add these env vars and redeploy:
NEXT_PUBLIC_VERCEL_APP_CLIENT_ID=
VERCEL_APP_CLIENT_SECRET=If you want the full GitHub-enabled coding-agent flow, create a GitHub App using:
https://YOUR_DOMAINhttps://YOUR_DOMAIN/api/github/app/callbackhttps://YOUR_DOMAIN/api/github/app/callbackIn the GitHub App settings:
NEXT_PUBLIC_GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRETAdd the GitHub App env vars and redeploy.
Optionally add Redis/KV and the canonical production URL vars.
Install dependencies:
bun installCreate your local env file:
cp apps/web/.env.example apps/web/.envFill in the required values in apps/web/.env.
Start the app:
bun run webIf you already have a linked Vercel project, you can still pull env vars locally with vc env pull, but setup is now intentionally manual so you can see exactly which values matter.
Create a Vercel OAuth app and use this callback:
https://YOUR_DOMAIN/api/auth/vercel/callback
For local development, use:
http://localhost:3000/api/auth/vercel/callback
Then set:
NEXT_PUBLIC_VERCEL_APP_CLIENT_ID=...
VERCEL_APP_CLIENT_SECRET=...You do not need a separate GitHub OAuth app. Open Agents uses the GitHub App's user authorization flow.
Create a GitHub App for installation-based repo access and configure:
https://YOUR_DOMAINhttps://YOUR_DOMAIN/api/github/app/callbackhttps://YOUR_DOMAIN/api/github/app/callbackFor local development, use http://localhost:3000/api/github/app/callback for the callback/setup URL and http://localhost:3000 as the homepage URL.
Then set:
NEXT_PUBLIC_GITHUB_CLIENT_ID=... # GitHub App Client ID
GITHUB_CLIENT_SECRET=... # GitHub App Client Secret
GITHUB_APP_ID=...
GITHUB_APP_PRIVATE_KEY=...
NEXT_PUBLIC_GITHUB_APP_SLUG=...
GITHUB_WEBHOOK_SECRET=...GITHUB_APP_PRIVATE_KEY can be stored as the PEM contents with escaped newlines or as a base64-encoded PEM.
bun run web
bun run check
bun run typecheck
bun run ci
bun run sandbox:snapshot-baseapps/web Next.js app, workflows, auth, chat UI
packages/agent agent implementation, tools, subagents, skills
packages/sandbox sandbox abstraction and Vercel sandbox integration
packages/shared shared utilities