TRUSTED_SOURCES_ENVIRONMENT_MISMATCH
The TRUSTED_SOURCES_ENVIRONMENT_MISMATCH error occurs when a request from one Vercel project to another (or to itself) reaches a deployment protected by Trusted Sources with a valid OIDC token, but the caller's environment is not allowed to reach the target deployment's environment under the project's current rules.
For example, a token issued for a preview deployment trying to reach a production deployment will be rejected unless a rule on the target project explicitly allows it.
TRUSTED_SOURCES_ENVIRONMENT_MISMATCH:
Forbidden
To resolve this error, add a custom access rule to the target project's Trusted Sources so the caller's environment is permitted to reach the target environment:
- Open the target project's Settings, then go to Deployment Protection, and find the Trusted Sources section.
- Locate the entry for the calling project under Vercel Projects. If the caller is the same project, use the entry pinned at the top of the list and labeled
(this project). - Edit the entry's rules so the caller's
fromenvironment is allowed to reach the target'stoenvironment. For example, allowfrom: previewtoto: productionif a preview deployment needs to call production. - Save the rule and retry the request.
If you didn't expect this caller to reach the deployment, no change is required: the request was correctly blocked.
For more details on how rules are matched and which claims are checked, see the Trusted Sources documentation.
Was this helpful?