# The Complete Guide to Vercel Agent

**Author:** Ben Sabic

---

Vercel Agent is a suite of AI-powered development tools that reviews your pull requests, investigates production anomalies, answers questions about your projects, and adds features to your code. Because Vercel builds your code, deploys your functions, and serves your traffic, Vercel Agent reasons about problems with full context about your codebase, deployment history, and runtime behavior.

Everything runs on Vercel's [agentic infrastructure](https://vercel.com/blog/agentic-infrastructure), which lets Vercel Agent reproduce issues in secure sandboxes, use current AI models, and validate its suggestions before you see them. The result is a tested, actionable output rather than a set of speculative guesses.

In this guide, you'll learn what Vercel Agent is and how it uses context about your application to review pull requests, investigate anomalies, and answer questions. You'll see how each of its four features works (Code Review, Investigation, Chat, and Installation) and how to enable and configure them for your team. You'll also learn how to control what Vercel Agent can access, which actions require your approval, and how to estimate costs under its credit-based pricing.

## How Vercel Agent works

Vercel Agent works because it already understands your application. Vercel builds your code, deploys your functions, and serves your traffic. This allows Vercel Agent to have direct access to your codebase, deployment history, and runtime behavior without any extra setup. That context is what separates Vercel Agent from a general-purpose coding assistant. It can connect a failing deployment to a recent code change, or a latency spike to a specific function, because it sees the whole picture.

Every Vercel Agent feature runs on Vercel's agentic infrastructure, purpose-built for AI workloads. This gives Vercel Agent two capabilities that make its output reliable:

- It spins up secure sandboxes (isolated microVMs with their own filesystem and kernel) to reproduce issues and run your real builds, tests, and linters.
  
- It also validates its work before surfacing it, so a suggested fix appears only after it passes those checks.
  

Every suggestion you see has already been tested in a sandbox.

## Code Review

Code Review automatically reviews every pull request you open and suggests fixes you can apply in one click. It uses multi-step reasoning to catch security vulnerabilities, logic errors, and performance issues that linters miss, and it uses your entire codebase as context to understand how each change fits the larger system.

Code Review validates every suggestion before showing it to you. It generates a patch, runs it in a secure sandbox against your real builds, tests, and linters, and surfaces the suggestion only if it passes. You apply specific changes directly from the pull request, confident they've already been tested.

Code Review runs automatically when you create a pull request, push a batch of commits to an open pull request, or open a draft pull request (if you've enabled draft reviews). It analyzes all human-readable files in your repository, including source code, test files, configuration files such as `package.json`, documentation, and inline comments.

### Mention `@vercel` in a pull request

Beyond automatic reviews, you can interact with Vercel Agent on demand by mentioning `@vercel` in any pull request comment. Vercel Agent reads your comment and either proposes a fix for you to review and apply or answers your question in the same thread. For example:

- `@vercel run a review` runs a full code review
  
- `@vercel fix the type errors` implements and commits a fix
  
- `@vercel why is this failing?` investigates the issue
  

### Apply your team's coding guidelines

Code Review detects and applies coding guidelines from your repository so its feedback matches your project's conventions. It looks for guideline files in priority order, from highest to lowest:

| File                                     | Tool                                                    |
| ---------------------------------------- | ------------------------------------------------------- |
| `AGENTS.md`                              | OpenAI Codex / [universal standard](https://agents.md/) |
| `CLAUDE.md`                              | Claude Code                                             |
| `.github/copilot-instructions.md`        | GitHub Copilot                                          |
| `.cursor/rules/*.mdc`                    | Cursor                                                  |
| `.cursorrules`                           | Cursor (legacy)                                         |
| `.windsurfrules`                         | Windsurf                                                |
| `.windsurf/rules/*.md`                   | Windsurf (directory)                                    |
| `.clinerules`                            | Cline                                                   |
| `.github/instructions/*.instructions.md` | GitHub Copilot workspace                                |
| `.roo/rules/*.md`                        | Roo Code                                                |
| `.aiassistant/rules/*.md`                | JetBrains AI Assistant                                  |
| `CONVENTIONS.md`                         | Aider                                                   |
| `.rules/*.md`                            | Generic rules                                           |
| `agent.md`                               | Generic agent file                                      |

When several guideline files exist in the same directory, Code Review uses the highest-priority one. Guidelines apply hierarchically and by scope: a `CLAUDE.md` at the repository root applies to every file, while a `src/components/CLAUDE.md` adds context for that directory only, and a guideline in `src/` never affects files in `lib/`. Guidelines can reference other files with `@import "file.md"` or relative markdown links, and the total guideline size is capped at 50 KB.

Write guidelines to capture conventions a linter can't enforce, such as architecture patterns, project-specific pitfalls, and testing requirements. Code Review treats guidelines as context, so its core job of finding bugs, security issues, and performance problems takes precedence over any conflicting guidelines.

### Set up Code Review

To enable Code Review, open the [Agent](https://vercel.com/d?to=%2F%5Bteam%5D%2F~%2Fagent%2Ftasks) section of the dashboard, and:

1. Click **Enable Automatic Reviews** to turn on Vercel Agent.
   
2. Under **Code Review** in the modal, enable **Review PRs and build failures automatically**
   
3. Under **Repositories**, choose which repositories to review: all repositories (the default), public only, or private only.
   
4. Under **Review Draft PRs**, choose whether to skip draft pull requests or review them.
   
5. Under **PR Approval**, choose whether to auto-approve low-risk PRs or not.
   
6. Click **Save**.
   

Once saved, Code Review reviews pull requests in every repository connected to your Vercel projects. Learn more about [using Vercel Agent to review pull requests](https://vercel.com/kb/guide/vercel-agent-code-review).

## Investigation

Investigation analyzes your logs and metrics when an anomaly alert fires and shows you the likely root cause, so you spend less time digging through data during an incident. An anomaly alert fires when Vercel detects unusual application activity, such as a sudden spike in error rate or response time. When that happens, Investigation queries the logs and metrics around the time of the alert, looks for patterns and correlations that might explain the change, checks for related errors, and summarizes what it found.

Investigation requires an [Observability Plus](https://vercel.com/docs/observability/observability-plus) subscription, which includes 10 alert investigations per billing cycle. To run investigations automatically for every alert, enable Agent Investigations in your team settings. Enabling Vercel Agent for Code Review does not enable Investigations; you need to turn them on separately.

### Enable automatic investigations

1. Go to [Agent](https://vercel.com/d?to=%2F%5Bteam%5D%2F~%2Fsettings%2Fagent) in your team settings.
   
2. Under **Investigations**, enable **Investigate anomalies automatically**.
   
3. Click **Save**.
   

With automatic investigations enabled, Vercel Agent runs an investigation each time an alert fires. Make sure your team has enough credits to cover investigations beyond the 10 included in each billing cycle.

### View or rerun an investigation

To review an investigation, go to your [Vercel dashboard](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fobservability%2Falerts&title=Open+Alerts), open **Observability**, then **Alerts**, and select the alert. The investigation results appear alongside the alert details, and if the investigation is still running, you can watch the analysis stream in real time. You can also send the agent a follow-up if you have any questions.

If you haven't enabled automatic investigations, you can still investigate any alert that has already fired. Open the alert from [Observability > Alerts](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fobservability%2Falerts&title=Open+Alerts) and click **Investigate**.

## Chat

Chat is a conversational interface for Vercel Agent that answers questions about your projects and makes configuration changes on your behalf. Click [New Chat](https://vercel.com/d?to=%2F%5Bteam%5D%2F~%2Fagent%2Fchat) in your dashboard to start a conversation. You can ask about deployments, projects, domains, and logs, investigate issues across your linked repositories, and have Vercel Agent carry out changes after you approve its plan.

**Through Chat, Vercel Agent can:**

- Answer questions about deployments, projects, domains, and logs
  
- Create, update, and delete environment variables
  
- Trigger deployments, rollbacks, and redeployments
  
- Configure observability alerts and dashboards
  
- Create, update, and delete storage resources (Blob, Redis, and Edge Config)
  

Chat reads public and private repositories you have access to that are linked to your Vercel projects, and it may read from multiple repositories at once when investigating an issue. Vercel Agent only accesses data you can already access on the currently selected team, and it can't reach other teams or their projects, even if you belong to them.

**These example prompts give you a sense of what Chat handles:**

- "Fix my 500 errors"
  
- "How do I improve the Core Web Vitals of my site?"
  
- "Where can I add caching to reduce my bill?"
  
- "Why did I get charged more this month compared to last?"
  
- "List environment variables and who created them"
  
- "Configure bot protection for my project"
  

## Installation

Installation adds [Web Analytics](https://vercel.com/docs/analytics) and [Speed Insights](https://vercel.com/docs/speed-insights) to your project for you, rather than requiring you to install packages and write integration code by hand.

Web Analytics tracks your site's visitors and traffic, and Speed Insights reports your site's performance against [Core Web Vitals](https://web.dev/explore/learn-core-web-vitals). When you start an installation, Vercel Agent analyzes your project configuration and connected repository, installs the required dependencies, writes the integration code, and opens a pull request for you to review.

### Install Web Analytics or Speed Insights

1. In your [Vercel dashboard](https://vercel.com/d?to=%2F%5Bteam%5D%2F%5Bproject%5D&title=Open+Project), select your GitHub-connected project.
   
2. Navigate to the **Analytics** or **Speed Insights** tab.
   
3. If the feature isn't on yet, click **Enable**.
   
4. Click **Implement with Vercel Agent** to begin.
   
5. Review the pull request and merge it when you're ready.
   

Once you merge and deploy the pull request, tracking starts automatically. To regenerate the pull request, click **Run Again**.

Installation is free for every team. You pay only for usage of the features it installs: after Vercel Agent adds Web Analytics, you're billed for [Web Analytics usage](https://vercel.com/docs/analytics/limits-and-pricing), and the same applies to [Speed Insights](https://vercel.com/docs/speed-insights/limits-and-pricing).

## Authorization and permissions

Vercel Agent operates within your existing permissions and requests approval before performing sensitive reads or writes. It can't approve or perform an action you don't have permission to do yourself. The table below shows what runs automatically and what needs your sign-off:

| Operation                                                               | Authorization     |
| ----------------------------------------------------------------------- | ----------------- |
| Reads on non-sensitive resources (projects, deployments, logs, domains) | Auto-approved     |
| Reads on sensitive resources (environment variables, tokens)            | Requires approval |
| All write operations                                                    | Requires approval |

When an action needs approval, Vercel Agent presents a plan that lists the tasks it intends to perform and the permissions it needs, then waits for you to authorize it. Authorization is plan-based rather than session-based. Each plan is a discrete unit of work with its own permissions, a new plan needs new authorization even within the same chat, and permissions expire when the plan finishes or is cancelled.

GitHub write operations get an extra layer of control. Creating or updating pull requests, writing comments, and pushing commits all require your explicit authorization, and these actions are attributed to you, with commits listing Vercel Agent as a co-author.

Every authorization event and write operation is recorded in your team's Activity Log, including who approved each plan and what was authorized. Enterprise customers can also view these events in the Audit Log. Write operations to your account and projects appear as performed by you "via Vercel Agent."

### Disable Vercel Agent

Team Owners and Admins can disable Vercel Agent from [Team Settings > Agent](https://vercel.com/vercel-labs/~/settings/agent).

Disabling it immediately ends all ongoing chat sessions, revokes permissions for in-progress tasks, and stops team members from starting new chats. To turn it back on, return to the same page and toggle it on. You can also disable Agent Investigation on its own from your team settings without disabling the rest of Vercel Agent.

## Pricing

Vercel Agent uses usage-based billing for paid work.

If your team has an existing Vercel Agent credit balance, that credit is used first, and once it runs out, additional paid usage is billed on-demand.

Code Review and Agent Investigation are billed the same way as Chat. For each, you pay the underlying AI provider's pass-through cost, plus the Vercel Token Rate of $0.25 per 1 million billable tokens. Billable tokens include input tokens, output tokens, and cached input tokens, so the cost of an action scales with how much work it involves.

Some usage is free or included. Each user gets 5 free Chat responses per day, and Chat only becomes paid when you approve a plan that needs paid work or continue past those free responses. Agent Investigation includes 10 alert investigations per billing cycle with Observability Plus, after which additional investigations are billed at the same token-based rate. Installation is free, though you still pay for usage of the Web Analytics or Speed Insights features it sets up.

Vercel Agent doesn't bill paid work until an authorized team member enables usage billing, and it prompts for consent before any paid work continues. Rejecting a proposed plan never incurs a charge. You can track your spending in the Agent section of your dashboard sidebar, where usage and cost columns show the cost of each Code Review, investigation, or paid Chat action.

Enterprise billing depends on your team's pricing model. See the [enterprise billing documentation](https://vercel.com/docs/agent/pricing#enterprise-billing) or contact your account team.

## Privacy and data use

Vercel Agent only accesses data you can already access on your currently selected team. That can include your Vercel and GitHub profile information, team memberships and billing details, project and deployment configurations, build and runtime logs, usage and traffic metrics, and private repositories linked to your Vercel projects. Vercel Agent can't access other teams or their projects.

Vercel doesn't train on your source code or chat transcripts if your team's [data preferences setting](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fsettings&title=Data+Preference+Settings) is off or if you're on an [Enterprise plan](https://vercel.com/docs/plans/enterprise). Chat transcripts may be reviewed by Vercel to improve Vercel Agent, in accordance with Vercel's [Privacy Notice](https://vercel.com/legal/privacy-policy).

## Resources and next steps

- Explore the [Code Review docs](https://vercel.com/docs/agent/pr-review) to fine-tune which repositories get reviewed and monitor your review metrics.
  
- Set up [Agent Investigation](https://vercel.com/docs/agent/investigation) and see how it works with [Observability Plus](https://vercel.com/docs/observability/observability-plus).
  
- Start a conversation with [Chat](https://vercel.com/docs/agent/chat) and review its data access and authorization model.
  
- Add analytics with [Agent Installation](https://vercel.com/docs/agent/installation), then learn more about [Web Analytics](https://vercel.com/docs/analytics) and [Speed Insights](https://vercel.com/docs/speed-insights).
  
- See full [Vercel Agent pricing](https://vercel.com/docs/agent/pricing) for credit management and cost tracking.
  
- Learn how Vercel Agent runs your code safely in [Vercel Sandbox](https://vercel.com/docs/sandbox).

---

[View full KB sitemap](/kb/sitemap.md)
