access-protected-vercel-deployment

작성자: vercel

Vercel 인증, SSO 또는 Deployment Protection으로 보호되는 Vercel 배포에 접근하고 테스트합니다. curl, agent-browser, Playwright 또는 다른…

npx skills add https://github.com/vercel/vercel-plugin --skill access-protected-vercel-deployment

Access Protected Vercel Deployments

Use the caller's existing Vercel authentication. Do not disable Deployment Protection or ask for a long-lived bypass secret as the first solution.

Choose the access path

HTTP requests: use vercel curl

For response bodies, headers, health checks, and API calls, replace raw curl with vercel curl (vc curl). It accepts native curl options and uses Vercel authentication to access protected preview and production deployments.

vc curl https://my-app.vercel.app/api/health
vc curl https://app.example.com/api/health
vc curl my-app.vercel.app/api/users -X POST \
  -H "Content-Type: application/json" \
  -d '{"name":"Ada"}'
vc curl /api/health

The path-only form targets the linked project's production deployment. Pass a full URL when the exact deployment matters.

If authentication fails, check the local identity and project before changing protection settings:

vc whoami

Inspect .vercel/project.json to confirm the linked project and team. Run vc link only when the directory is not linked or is linked to the wrong project. Run vc login only when the CLI reports that no authenticated user is available.

Browser automation: attach the development OIDC token as a header

Browser requests must include the short-lived local token as a request header:

x-vercel-trusted-oidc-idp-token: <VERCEL_OIDC_TOKEN>

Use a browser tool that supports origin-scoped request headers. With agent-browser, inject development variables without printing or persisting the token:

vc env run -- sh -c \
  'test -n "$VERCEL_OIDC_TOKEN" && agent-browser open "$1" --headers "{\"x-vercel-trusted-oidc-idp-token\":\"$VERCEL_OIDC_TOKEN\"}"' \
  sh https://my-app.vercel.app

Then continue the normal browser workflow in the same session. For Playwright or another browser driver, set the same header in the browser context's extra HTTP headers before the first navigation.

If the local CLI version does not provide the token through vc env run, refresh local development credentials with:

vc env pull .env.local --yes

Load the file through the project's existing dotenv mechanism. Never print the token, paste its value into source code, or commit .env.local.

Use x-vercel-trusted-oidc-idp-token for Trusted Sources. Do not substitute x-vercel-oidc-token; that header carries an OIDC token into a Vercel Function and serves a different purpose.

Trusted Sources rules

A local development token for a linked Vercel project can access that same project's Preview deployments by default. It does not automatically access protected Production deployments. For protected Production, the project's own Trusted Sources entry must allow developmentproduction.

Do not ask the user to configure Trusted Sources for the normal same-project Preview case.

Configuration is needed when:

  • the target is a protected Production deployment and the caller uses a local development token;
  • the caller belongs to another Vercel project or team;
  • the target project's self-access rules were customized; or
  • the response is TRUSTED_SOURCES_ENVIRONMENT_MISMATCH.

In the target project, open Settings → Deployment Protection → Trusted Sources. Add or edit the caller and allow the required fromto environment pair. A local token has the development environment, so access to protected Production requires developmentproduction.

Treat this as an access-control change: explain the exact rule required and obtain authorization before changing it. Do not broaden unrelated environment pairs.

Diagnose the response

  • A Vercel login, SSO, or Deployment Protection page means the request did not use an accepted authentication path.
  • TRUSTED_SOURCES_ENVIRONMENT_MISMATCH means the token is valid but its caller environment is not allowed to reach the target environment.
  • An application-generated 401 or 403 after Vercel protection is bypassed belongs to the application's own authentication and must be debugged separately.
  • A deployment marked "target": "production" can still be protected. Do not assume production is public.

Avoid

  • Do not disable Deployment Protection to make automation pass.
  • Do not send raw unauthenticated curl repeatedly after receiving the protection page.
  • Do not start an interactive SSO browser login when vc curl or an origin-scoped OIDC header can authenticate the request.
  • Do not expose VERCEL_OIDC_TOKEN in logs, screenshots, committed files, or user-facing output.

Related skills

  • General Vercel CLI usage: ⤳ skill: vercel-cli
  • End-to-end application verification: ⤳ skill: verification

vercel의 다른 스킬

vercel
vercel
로컬 개발 및 테스트를 위한 Vercel REST API 에뮬레이션입니다. 사용자가 로컬에서 Vercel API 엔드포인트와 상호작용하거나 Vercel 통합을 테스트해야 할 때 사용합니다.
cron-jobs
vercel
Vercel Cron Jobs 구성 및 모범 사례. vercel.json에서 예약된 작업을 추가, 편집 또는 디버깅할 때 사용합니다.
codegen
vercel
json-render을 위한 코드 생성 유틸리티입니다. UI 명세서에서 코드를 생성하거나, 사용자 정의 코드 내보내기를 구축하거나, 명세서를 탐색하거나, props를 직렬화할 때 사용합니다.
next-best-practice
vercel
Next.js 모범 사례 - 파일 규칙, RSC 경계, 데이터 패턴, 비동기 API, 메타데이터, 오류 처리, 라우트 핸들러, 이미지/폰트 최적화,…
benchmark-sandbox
vercel
Vercel Sandbox에서 vercel-plugin eval 시나리오를 로컬 WezTerm 패널 대신 실행합니다. Claude Code와 플러그인이 사전 설치된 임시 마이크로VM을 프로비저닝합니다.
write-guide
vercel
점진적인 예제를 통해 실제 사용 사례를 가르치는 기술 가이드를 제작합니다. 개념은 독자가 필요로 할 때만 소개됩니다.
benchmark-testing
vercel
벤치마크 테스트 프로젝트를 생성하고 실행하여 실제 시나리오에서 vercel-plugin 스킬 인젝션을 테스트합니다. 격리된 디렉토리를 설정하고, 설치하며…
ai-gateway
vercel
Vercel AI Gateway 전문가 안내. 모델 라우팅, 제공업체 장애 조치, 비용 추적 또는 통합된 방식을 통해 여러 AI 제공업체를 관리할 때 사용합니다.