| name | vercel-policy-guardrails |
| description | Implement lint rules, CI policy checks, and automated guardrails for Vercel projects.
Use when setting up code quality rules, preventing secret exposure,
or enforcing deployment policies for Vercel applications.
Trigger with phrases like "vercel policy", "vercel lint",
"vercel guardrails", "vercel best practices check", "vercel secret scan".
|
| allowed-tools | Read, Write, Edit, Bash(npx:*), Bash(npm:*) |
| version | 1.18.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","vercel","policy","linting","security"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Vercel Policy Guardrails
Overview
Protect against common Vercel failure modes with automated guardrails: ESLint rules preventing secret exposure in client bundles, pre-commit hooks scanning for credentials, CI checks validating vercel.json and edge runtime compatibility, and runtime middleware enforcing auth on protected routes.
Prerequisites
- ESLint configured in project
- Git hooks infrastructure (husky or lefthook)
- CI/CD pipeline (GitHub Actions or similar)
- TypeScript for type enforcement
Instructions
Step 1: ESLint Rules — Prevent Secret Exposure
module.exports = {
rules: {
'no-restricted-syntax': [
'error',
{
selector: 'MemberExpression[object.property.name="env"][property.name=/^NEXT_PUBLIC_(SECRET|KEY|TOKEN|PASSWORD|PRIVATE)/]',
message: 'Do not prefix secrets with NEXT_PUBLIC_ — they will be exposed in the client bundle',
},
],
},
overrides: [
{
files: ['**/edge-*.ts', '**/middleware.ts'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{ name: 'fs', message: 'fs is not available in Edge Runtime. Use fetch or Vercel Blob.' },
{ name: 'path', message: 'path is not available in Edge Runtime. Use URL API.' },
{ name: 'crypto', message: },
{ : , : },
{ : , : },
],
},
],
},
},
],
};