vibe-check
AGENTS.md115 starsChanged 2 months agoMITView on GitHub
These rules apply to all code generated in this project. They are non-negotiable. - A CSP header that exists is not enough. Start from this baseline and add only the origins your app actually uses: default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none' - ALWAYS declare default-src. Every fetch directive that isn't declared (script-src, style-src, img-src, connect-src, font-src, frame-src, media-src) falls back to it - ALWAYS declare base-uri, form-action, and frame-ancestors explicitly. They do NOT fall…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- vibe-checkSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
30 rules. About 5 are common, 9 are distinctive, and 16 are very specific to this project.
≈5
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 7
NEVER put API keys, database credentials, or tokens in frontend code (anything under src/, app/, pages/, components/, public/)
- Very specific: line 8
NEVER put secret keys in environment variables prefixed with NEXT_PUBLIC_, VITE_, or REACT_APP_ (these are bundled into the client)
- Common: line 9
NEVER hardcode credentials in source files.
- Common: line 11
Use .env.example with placeholder values only, never real credentials
- Very specific: line 16
NEVER set a Supabase RLS policy to USING (true) or FOR ALL without a WHERE condition
- Very specific: line 18
NEVER use pickle.loads, pickle.load, or any deserialization on user-supplied data.
- Distinctive: line 22
EVERY API route that returns or modifies user data MUST have authentication middleware that runs BEFORE the handler, not inside it
- Very specific: line 24
EVERY route that takes a resource ID MUST verify the authenticated user owns that resource: current_user.id == resource.owner_id.
- Distinctive: line 30
NEVER concatenate user input into SQL queries.
- Very specific: line 31
NEVER use dangerouslySetInnerHTML, v-html, or innerHTML with user-supplied content unless it is first sanitized with DOMPurify
- Distinctive: line 32
ALL user input MUST be validated server-side.
- Distinctive: line 37
If the application fetches URLs provided by users (link previews, image proxies, URL validators), it MUST:
- Very specific: line 51
If the app is served by a host or CDN (Vercel, Netlify, Cloudflare, nginx), set the same headers in that layer's config (vercel.json, …
- Very specific: line 57
ALWAYS declare default-src.
- Very specific: line 58
ALWAYS declare base-uri, form-action, and frame-ancestors explicitly.
- Very specific: line 59
NEVER use 'unsafe-inline', 'unsafe-eval', *, data:, http:, or bare https: in script-src.
- Very specific: line 60
NEVER use * in connect-src, frame-src, or form-action
- Very specific: line 66
NEVER set CORS origin to * (wildcard).
- Very specific: line 67
NEVER reflect the request's Origin header back without checking it against the allowlist
- Very specific: line 68
NEVER combine origin: '*' with credentials: true
- Distinctive: line 73
Every state-changing endpoint (POST, PUT, PATCH, DELETE) that uses cookie-based auth MUST be protected by SameSite=Lax/Strict session …
- Distinctive: line 74
NEVER perform state changes on GET requests (SameSite=Lax still sends cookies on top-level GET navigations)
- Distinctive: line 80
Do NOT trust X-Forwarded-For for rate limiting unless behind a trusted reverse proxy
- Distinctive: line 90
NEVER expose stack traces, SQL errors, file paths, or library names in API responses
- Very specific: line 98
NEVER serve source maps (.js.map) publicly in production.
- Very specific: line 99
NEVER let the web server serve .env, .git/, database dumps, backups, or log files.
- Common: line 104
ALWAYS use bcrypt, Argon2, or scrypt for password hashing
- Common: line 105
NEVER use MD5, SHA-1, or plain SHA-256 for passwords
- Distinctive: line 109
Before installing any package, verify it exists on the official registry with a reasonable download count and history
- Very specific: line 111
Commit lock files (package-lock.json, poetry.lock, yarn.lock)
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Rules
These rules apply to all code generated in this project. They are non-negotiable.
Secrets
- NEVER put API keys, database credentials, or tokens in frontend code (anything under src/, app/, pages/, components/, public/)
- NEVER put secret keys in environment variables prefixed with NEXT_PUBLIC_, VITE_, or REACT_APP_ (these are bundled into the client)
- NEVER hardcode credentials in source files. Use environment variables loaded server-side only
- The .env file MUST be in .gitignore before the first commit. Verify this before creating any .env file
- Use .env.example with placeholder values only, never real credentials
Database
- Enable Row Level Security on EVERY Supabase table before deployment. Default policy: deny all. Write explicit policies scoped to auth.uid()
- NEVER set a Supabase RLS policy to
USING (true)orFOR ALLwithout a WHERE condition - Firebase Security Rules MUST require
request.auth != nulland scope access torequest.auth.uid - NEVER use
pickle.loads,pickle.load, or any deserialization on user-supplied data. Use JSON for all network data exchange
Authentication and Authorization
- EVERY API route that returns or modifies user data MUST have authentication middleware that runs BEFORE the handler, not inside it
- Unauthenticated requests to protected endpoints MUST return 401
- EVERY route that takes a resource ID MUST verify the authenticated user owns that resource:
current_user.id == resource.owner_id. This is a SEPARATE check from authentication - Admin endpoints MUST verify admin role and return 403 for non-admin users
- Session cookies MUST set
httpOnly: true,secure: true, andsameSite: 'lax'
Input and Output
- NEVER concatenate user input into SQL queries. ALWAYS use parameterized queries or ORM methods
- NEVER use
dangerouslySetInnerHTML,v-html, orinnerHTMLwith user-supplied content unless it is first sanitized with DOMPurify - ALL user input MUST be validated server-side. Client-side validation is for UX only
- File uploads MUST validate file type by reading magic bytes, not by checking the filename extension. Rename all uploads to UUIDs server-side. Store on a separate domain (S3, R2, GCS), never on the app origin
URL Fetching (SSRF Prevention)
- If the application fetches URLs provided by users (link previews, image proxies, URL validators), it MUST:
- Block all private/internal IP ranges: 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, ::1
- Allow only http and https schemes
- Resolve the hostname and check the IP BEFORE making the request
Security Headers
- Set these headers on ALL responses via a single global middleware:
Content-Security-Policy(see CSP rules below)Strict-Transport-Security: max-age=31536000; includeSubDomainsX-Frame-Options: DENYX-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-origin
- In Express, use the
helmetpackage. In Next.js, set headers in next.config.js - If the app is served by a host or CDN (Vercel, Netlify, Cloudflare, nginx), set the same headers in that layer's config (vercel.json, netlify.toml, _headers, nginx.conf) for static files, since those responses never pass through your app middleware
Content Security Policy
- A CSP header that exists is not enough. Start from this baseline and add only the origins your app actually uses:
default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none' - ALWAYS declare
default-src. Every fetch directive that isn't declared (script-src, style-src, img-src, connect-src, font-src, frame-src, media-src) falls back to it - ALWAYS declare
base-uri,form-action, andframe-ancestorsexplicitly. They do NOT fall back todefault-src - NEVER use
'unsafe-inline','unsafe-eval',*,data:,http:, or barehttps:inscript-src. For inline scripts, use nonces or hashes - NEVER use
*inconnect-src,frame-src, orform-action 'unsafe-inline'is tolerated instyle-srconly (many CSS-in-JS and Tailwind setups need it)- Roll out a new policy as
Content-Security-Policy-Report-Onlyfirst, fix what it reports, then switch it to enforcing
CORS
- NEVER set CORS origin to
*(wildcard). Use an explicit allowlist of your actual domains - NEVER reflect the request's
Originheader back without checking it against the allowlist - NEVER combine
origin: '*'withcredentials: true - Declare allowed methods explicitly (only the ones the API uses) instead of allowing all methods
CSRF
- Every state-changing endpoint (POST, PUT, PATCH, DELETE) that uses cookie-based auth MUST be protected by SameSite=Lax/Strict session cookies, a CSRF token, or both
- NEVER perform state changes on GET requests (SameSite=Lax still sends cookies on top-level GET navigations)
- Set cookie flags on EVERY cookie that carries auth or session data, not just the main session cookie
Rate Limiting
- Login, registration, and password reset endpoints MUST have rate limiting (block after N failed attempts per IP within a time window)
- Do NOT trust X-Forwarded-For for rate limiting unless behind a trusted reverse proxy
Payments
- Stripe webhook endpoints MUST verify the signature using
stripe.Webhook.construct_event(or equivalent) on every request. Reject any request with an invalid or missing signature - Webhook handlers MUST track processed event IDs and skip duplicates (idempotency)
- Handle the full event lifecycle:
payment_intent.succeeded,invoice.payment_failed,customer.subscription.updated(checkstatusforpast_due/unpaid),customer.subscription.deleted
Error Handling
- NEVER expose stack traces, SQL errors, file paths, or library names in API responses
- Production error responses MUST return only generic messages:
{"error": "Something went wrong"} - Full error details go to server-side logs only
- Debug mode / development error pages MUST be disabled in production
Production Exposure
- Disable or put behind auth these endpoints in production: API docs (FastAPI
/docs,/redoc,/openapi.json; Swagger UI), GraphQL playgrounds/GraphiQL and introspection, Spring Boot Actuator, phpinfo, server-status, Werkzeug debugger - NEVER serve source maps (
.js.map) publicly in production. Disable them in the build config (e.g. Vitebuild.sourcemap: false, Next.jsproductionBrowserSourceMaps: false) or upload them privately to your error tracker - NEVER let the web server serve
.env,.git/, database dumps, backups, or log files. Only the build output directory is publicly served - Directory listing MUST be disabled on the web server and on any public bucket
Password Hashing
- ALWAYS use bcrypt, Argon2, or scrypt for password hashing
- NEVER use MD5, SHA-1, or plain SHA-256 for passwords
Dependencies
- Before installing any package, verify it exists on the official registry with a reasonable download count and history
- Pin exact versions in package.json / requirements.txt (no ^ or ~ in production)
- Commit lock files (package-lock.json, poetry.lock, yarn.lock)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

