Securing a Vercel team means deciding who can reach each deployment URL, what traffic reaches your functions, which values each environment receives and which people can change production. Vercel makes shipping fast: every push can create a new preview URL, every integration can add environment variables, and every team member with the right role can promote a build. That speed is the reason the platform needs a deliberate security baseline rather than defaults left as they were on the day the team was created.
This guide covers the wider Vercel platform: Deployment Protection and its bypass methods, the Vercel Firewall and WAF, environment scoping across Production, Preview, Development and custom environments, and team and project roles. Access tokens, OAuth integrations and the identity model behind them are covered in depth in our Vercel Tokens Security Guide, and the AI app builder is covered in What Is v0 by Vercel? Features and Pricing. This page links to them rather than repeating them. For platform-neutral function hardening, see the Serverless Security Guide.
This is an independent guide from NHI Mgmt Group, based on Vercel's public documentation as of November 2026. It is not sponsored or reviewed by Vercel. Product features change, so confirm settings against Vercel's current documentation.
Key takeaways
- Every Vercel deployment gets a URL. Unless Deployment Protection covers it, a preview built from an unfinished branch can be reached by anyone who finds or guesses the address.
- Standard Protection is available on all plans and protects everything except production domains. All Deployments, also available on all plans, protects production as well.
- Bypass methods (Protection Bypass for Automation, Shareable Links, Deployment Protection Exceptions, OPTIONS Allowlist and Trusted Sources) are where most protection gaps appear. Treat each one as a credential or an exception that needs an owner.
- Environment variable changes apply only to new deployments, so a rotated secret is not fully rotated until you redeploy, and old deployments may still hold the old value.
- Anything with the
NEXT_PUBLIC_prefix is inlined into the browser bundle at build time. It is public by design and must never hold a secret. - Developers can deploy to production by merging to the production branch, so branch protection in Git is part of your Vercel access model.
- The Vercel Firewall runs DDoS mitigation, IP blocking, custom rules and managed rulesets in a fixed order. Send its logs to your SIEM through Drains.
The Vercel attack surface in one view
A Vercel team is a set of projects. Each project is connected to a Git repository, builds on push, and produces deployments. A deployment is reachable on one or more URLs: production domains you own, generated deployment URLs on vercel.app, and branch URLs that follow the latest commit on a branch. Functions and Routing Middleware run behind those URLs and read environment variables at build time or runtime.
That gives five places where security decisions sit:
- Reachability. Who can load a given deployment URL. This is Deployment Protection.
- Traffic filtering. Which requests reach your code at all. This is the Vercel Firewall.
- Configuration and secrets. Which values each environment receives and who can read them. This is environment variables and environments.
- People and roles. Who can deploy, promote, change settings and read secrets. This is team and project RBAC.
- Machine access. Tokens, integrations, deploy hooks and CI pipelines acting on the team. This is covered in the Vercel Tokens Security Guide.
Attackers rarely need a platform vulnerability. The common paths are an unprotected preview that calls a production database, a secret committed to a public bundle, a bypass secret pasted into a webhook URL that ends up in logs, or a former contractor who still holds a role. ATT&CK describes the first and second patterns as Exploit Public-Facing Application and Credentials In Files, and the last as Valid Accounts.
Deployment Protection: methods and scopes
Vercel describes Deployment Protection as a project-level control that combines a protection method (how you protect) with a protection scope (what you protect). Vercel's documentation states that Deployment Protection requires authentication for all requests, including those to Routing Middleware, so middleware cannot be used as an unprotected side door once protection applies.
Protection methods
| Method | What it checks | Plan availability (per Vercel docs, Nov 2026) |
|---|---|---|
| Vercel Authentication | The visitor is a logged-in Vercel user with suitable access to the project | All plans |
| Passport | The visitor authenticates through your own identity provider | Enterprise |
| Password Protection | The visitor knows a shared password | Pro as a per-project add-on; included on Enterprise at team level; not on Hobby |
| Trusted IPs | The request comes from an allowed IPv4 address | Enterprise |
From an identity perspective, these are not equal. Vercel Authentication and Passport tie access to a named person, which gives you attribution and lets you remove access when someone leaves. A shared password is a group secret: it cannot be attributed, it is easily forwarded, and rotating it disrupts everyone. Trusted IPs is a network control and should be paired with an identity method where possible, because shared egress addresses cover many people.
Protection scopes
- Standard Protection protects all deployments except production domains. Vercel recommends it for most projects and it is available on all plans.
- All Deployments protects every URL, including your production domain and generated URLs. It is available on all plans and is the right choice for internal tools, admin consoles and staging-only projects.
- Only Production Deployments uses Trusted IPs to restrict production while previews stay public. It is Enterprise only, and leaving previews public is rarely what a security team wants.
- Legacy scopes (Legacy Standard Protection and Legacy Pre-Production Deployments) leave some production branch URLs, such as
*-main.vercel.appstyle addresses, publicly reachable. Find any project still on a legacy scope and move it.
When you move to Standard Protection, Vercel notes that the production generated deployment URL becomes restricted, so code that calls itself using VERCEL_URL or VERCEL_BRANCH_URL should switch to relative paths on the client or the request origin on the server. Teams sometimes respond to the resulting errors by adding a broad bypass. Fix the calls instead.
Team defaults and source maps
Owners can set a team default protection level and method for new projects, which individual projects can override. Set the default to Standard Protection with Vercel Authentication or Passport as a minimum, and review overrides regularly. Vercel also offers Protected Source Maps, which gates .map requests behind Vercel Authentication so you can ship browser source maps without exposing source code publicly.
Bypass methods: treat each as a credential
Protection only works if the exceptions stay narrow. Vercel documents five ways to let traffic past Deployment Protection, all listed as available on all plans.
| Bypass method | How it works | Main risk | Control to apply |
|---|---|---|---|
| Trusted Sources | Other Vercel projects or external services present a short-lived OIDC token | Rules broader than needed across environments | Keep the default of matching environments; review custom rules |
| Protection Bypass for Automation | A project secret, exposed as VERCEL_AUTOMATION_BYPASS_SECRET, sent as the x-vercel-protection-bypass header or query parameter | One secret opens all deployments in the project; query parameters leak into logs and referrers | Prefer the header; store it in CI secrets; rotate; use multiple secrets per consumer |
| OPTIONS Allowlist | Paths that skip protection for CORS preflight OPTIONS requests | Prefix matching means /api covers every path below it | List the narrowest prefixes; ensure handlers do no work on OPTIONS |
| Deployment Protection Exceptions | Named preview domains become publicly accessible | Exceptions are forgotten after a demo or launch | Record owner and expiry; remove after use |
| Shareable Links | A secure query parameter grants access to the latest deployment of a branch | Links are forwarded beyond the intended reviewer | Issue per review; revoke when the review ends |
Prefer Trusted Sources over a static bypass secret wherever the caller can obtain an OIDC token, for example a GitHub Actions workflow. A short-lived, audience-bound token is easier to defend than a long-lived shared string, which is the same reasoning behind replacing static deploy tokens with workload identity. Where a third-party webhook cannot set headers and needs the query parameter form, give that consumer its own bypass secret so that one leaked URL can be revoked without breaking your test suite. Vercel's changelog notes that Protection Bypass for Automation supports multiple secrets.
Also check where previews are used for automated agents and testing tools. Vercel publishes guidance on automated and agent access to protected deployments, and the same principle applies: an agent should get the narrowest bypass, scoped to the environment it tests, with a secret that is not reused elsewhere. For wider guidance on bypass strings as non-human credentials, see the AI Coding Tools and Secrets Sprawl guide.
Vercel Firewall and WAF
Every request passes through the Vercel Firewall. Vercel describes two layers: a platform-wide firewall with DDoS mitigation that is free on all plans and needs no configuration, and the Vercel WAF, which you configure per project. Rules run in a fixed order:
- DDoS mitigation rules
- WAF IP blocking rules
- WAF custom rules, in the order you set
- WAF Managed Rulesets
The WAF tools are Custom Rules, IP Blocking, Managed Rulesets and Attack Mode. Configuration can be managed through the dashboard or programmatically through the REST API, the Vercel SDK or Terraform. Managing rules as code is worth the effort: it gives you review, history and the ability to restore a known-good rule set after an emergency change.
Practical WAF baseline
- Enable the managed rulesets that match your stack and test them in a log-only posture before you block, where the rule type allows it.
- Write custom rules for high-value paths such as login, password reset, checkout, admin routes and API endpoints that trigger costly work, and combine them with rate limits.
- Block or challenge traffic to paths that should never be public in production, such as debug routes or internal health endpoints that reveal configuration.
- Keep IP blocks short-lived and documented. Permanent IP lists age badly as address space is reassigned.
The WAF protects production domains from the internet. It does not replace Deployment Protection on previews, and it does not replace authentication and authorisation inside your application. Vercel's own knowledge base describes application authentication as a layered concern covering proxy checks and a data access layer, which is the right mental model: the edge filters, the application decides.
Environments and environment variables
Vercel environment variables are encrypted at rest and assigned to one or more environments: Production, Preview, Development and any custom environments. They can be declared at team level and linked to projects, or at project level. When you add a variable you choose a type. Vercel documents that Config values stay readable to authorised members, while Secret values are write-only after saving. Integrations from the Marketplace can also add variables automatically, and the project settings show which integration added each one.
Detailed handling of secret values, rotation and integration tokens is covered in the Vercel Tokens Security Guide. The platform-level decisions to get right are these:
Separate production from everything else
Previews are built from any branch that is not the production branch. If a preview build receives production database credentials, then any branch, including one pushed by a compromised developer account or an over-permissive bot, can run code against production data. Give Preview and Development their own credentials pointing at non-production resources. Use branch-specific preview variables, which override general preview values with the same name, when a single branch needs a special target.
Choose Secret for credentials
Mark API keys, database passwords, signing keys and tokens as Secret so they cannot be read back from the dashboard after saving. Reserve Config for non-sensitive values such as feature flags and public endpoints. In the CLI, vercel env add accepts --type secret or --sensitive. Make the type explicit in scripts rather than relying on defaults.
Know what becomes public
Vercel's troubleshooting guidance notes that Next.js inlines NEXT_PUBLIC_ variables into the client bundle at build time. Any value with that prefix is shipped to every browser. Add a check in CI that fails the build if a variable with a public prefix matches a secret pattern or shares a value with a server-only variable.
Remember that changes need a redeploy
Changes to environment variables apply only to new deployments. The running deployment keeps the values it was built with. After a rotation, redeploy production and any previews that must keep working, and then revoke the old credential at the provider. Old deployments that remain reachable may still hold the previous value, which is another reason to keep generated URLs protected.
Control local copies
vercel env pull writes Development variables to a plain text .env.local file on the developer's machine. Keep Development values low privilege, make sure .env* files are in .gitignore, and include developer laptops in your secret scanning scope.
Team roles, project roles and production rights
Vercel separates team-level roles, which apply to every project, from project-level roles, which apply only to assigned projects. Team roles are available on Pro and Enterprise; project roles are Enterprise only and can only be held by members with the Contributor team role.
| Role | Security-relevant rights (per Vercel docs) |
|---|---|
| Owner | Full control of team settings, all projects, members and roles. Only owners change roles. Vercel recommends at least two owners for continuity. |
| Member | Full control over projects, integrations, domains, deploy hooks and project security settings; cannot invite users by default. |
| Developer | Deploys and manages preview and development variables; cannot change production variables; can still reach production by merging to the production branch. |
| Security | Manages Firewall, rate limiting and Deployment Protection, with read-only project access; no deployment rights by default. Enterprise only. |
| Billing | Billing plus read-only access to every project. |
| Pro Viewer and Enterprise Viewer | Read-only. Enterprise Viewer also sees logs, team settings and usage. |
| Contributor | No project access unless assigned a project role: Project Administrator, Project Developer or Project Viewer. |
Two details matter most for least privilege, as described in NIST SP 800-53 control AC-6. First, Developers cannot edit production variables, but they can still put code into production through Git, and that code can read every production secret at runtime. Your real production boundary is therefore branch protection, required reviews and status checks on the production branch, plus the Vercel role. Second, Project Viewers can examine environment variables across all environments, which is one reason to use the Secret type for anything sensitive.
Permission groups let you add specific rights such as Full Production Deployment, Environment Variable Manager or Connector Manager to compatible roles. Grant these to named people for a reason, and review them alongside role assignments. On Enterprise, use the Contributor role and project roles to keep agency staff and contractors inside the projects they work on, and use the Security role so your security team can manage the Firewall and Deployment Protection without deployment rights.
Joiner, mover and leaver processes should cover Vercel. Connect team membership to your identity provider where your plan supports it, require multi-factor authentication for every member, and run a monthly reconciliation of owners, members and permission groups against HR records.
Builds, Git connections and supply chain
Because every push can trigger a build, the Git connection is a trust boundary. A build runs your dependency install and build scripts with access to the environment variables for that target. Practical controls:
- Protect the production branch with required reviews and status checks so a single compromised account cannot ship to production.
- Review project security settings, including Git Fork Protection, so that pull requests from forks cannot run builds with your secrets without approval.
- Pin dependencies with a lockfile and scan them in CI. Vercel's changelog records that new deployments of vulnerable Next.js versions and of some vulnerable third-party packages are blocked by default, which helps, but your own dependency policy should not depend on it.
- Treat deploy hooks as credentials. A deploy hook URL can trigger a build, so store it in a secret manager and rotate it if it appears in a ticket or chat.
- When CI deploys to Vercel, prefer OIDC-based trust over long-lived tokens, and see the Vercel Tokens Security Guide for token scoping.
Logging, monitoring and response
Vercel offers Firewall traffic monitoring with a live view, Firewall alerts, Observability queries that can filter by WAF action, and Drains to send logs to a SIEM. Use them to answer three questions continuously:
- Is anyone probing previews? Spikes in denied requests on generated URLs suggest URL discovery.
- Are bypasses used as expected? Requests carrying the bypass header from unexpected sources suggest a leaked secret.
- Is the WAF doing its job? Track blocked and challenged requests per rule, and alert on sudden drops that might mean a rule was disabled.
Pair platform logs with the team audit trail for role changes, protection setting changes and new integrations, following NIST SP 800-53 AU-6 on audit review. For incident response, keep a short runbook: switch the affected project to All Deployments protection, rotate bypass secrets and affected environment variables, redeploy, review recent role and integration changes, and remove stale deployments. The Serverless Function Compromise Playbook covers the function side of a response.
Common failure patterns
- Projects left on a legacy protection scope, so production branch URLs stay public.
- Preview deployments wired to production databases or payment keys.
- A single automation bypass secret shared between CI, monitoring and several webhooks, and passed as a query parameter that appears in logs.
- OPTIONS Allowlist set to
/or/api, with handlers that perform work on preflight requests. - Deployment Protection Exceptions added for a launch demo and never removed.
- Secrets stored with a
NEXT_PUBLIC_prefix and shipped to every browser. - Credentials rotated in the dashboard without a redeploy, leaving the old value live.
- Developers relied on as a production control while the production branch has no review requirement.
- Firewall rules changed by hand during an incident with no record and no rollback.
Practitioner checklist
- Set the team default to Standard Protection or All Deployments with Vercel Authentication or Passport.
- Find and migrate every project on a legacy protection scope.
- Use All Deployments for internal tools, admin apps and staging-only projects.
- Inventory every bypass: automation secrets, Trusted Sources rules, OPTIONS paths, exceptions and shareable links, each with an owner and review date.
- Prefer Trusted Sources with OIDC over static bypass secrets; use the header form and one secret per consumer where a secret is unavoidable.
- Separate Production credentials from Preview and Development, and use the Secret type for every credential.
- Fail CI if a
NEXT_PUBLIC_variable looks like a secret. - Redeploy after every rotation and revoke the old value at the provider.
- Protect the production branch with required reviews and checks; enable fork protection.
- Keep at least two owners, review roles and permission groups monthly, and use Contributor project roles for third parties on Enterprise.
- Manage WAF rules as code, enable relevant managed rulesets, and rate limit sensitive endpoints.
- Send Firewall and application logs to your SIEM through Drains and alert on bypass use and protection changes.
Standards and references
- Vercel: Deployment Protection
- Vercel: Bypass Deployment Protection for testing, sharing, and automation
- Vercel: Vercel Firewall
- Vercel: Environment variables
- Vercel: Access Roles
- NIST: SP 800-53 Rev. 5 (AC-6 Least Privilege, SC-7 Boundary Protection, AU-6 Audit Record Review)
- MITRE ATT&CK: Credentials In Files
- MITRE ATT&CK: Exploit Public-Facing Application
Related NHI Mgmt Group resources: Vercel Tokens Security Guide · What Is v0 by Vercel? Features and Pricing · Serverless Security Guide · Serverless Function Compromise Playbook