- Home
- Skills
- Frontend & Web Apps
- Vite Config Check
More screenshots
Works with the AI Agents you already use
Vite Config Check
This skill finds those and seven other Vite mistakes before you build or deploy, and tells you how to fix each one.
$5
Vite Config Check
Example session with this skill installed
Check this project with vite-config-check.
- Read your context and instructions
- Compiled the vite config check
$ python3 scripts/check_vite.py examples/risky
BLOCK .env.example:5 V01 SECRET_IN_CLIENT_ENV_VARIABLE
VITE_OPENAI_API_KEY=
Why: A .env file (or an example file that lists the app's variables) puts a secret in a variable that Vite exposes to the browser (VITE_, or a prefix set with envPrefix): its name says secret, password, private or service role or names an AI or other paid API key, its value looks like a secret key, or it copies a secret variable (VITE_DB="${DB_PASSWORD}"). Vite puts these variables in import.meta.env: in dev mode all of them reach the browser, and a build writes every one the code reads into JavaScript files that anyone can download.
Safer: Keep the secret in a variable without the exposed prefix and use it only on a server (an API route, edge function or backend) that the app calls. Put only publishable or anon keys in VITE_ variables, and rotate a secret that was exposed.
BLOCK .env.example:6 V01 SECRET_IN_CLIENT_ENV_VARIABLE
BLOCK vite.config.ts:11 V02 ENV_PREFIX_EXPOSES_SERVER_VARIABLES
BLOCK vite.config.ts:13 V03 ENVIRONMENT_INJECTED_BY_DEFINE
BLOCK vite.config.ts:20 V04 DEV_SERVER_FILE_GUARD_OFF
BLOCK vite.config.ts:21 V04 DEV_SERVER_FILE_GUARD_OFF
REVIEW package.json:7 V11 SERVER_ON_ALL_INTERFACES
REVIEW vite.config.ts:16 V11 SERVER_ON_ALL_INTERFACES
REVIEW vite.config.ts:17 V13 CORS_OPEN_TO_ANY_SITE
REVIEW vite.config.ts:18 V14 HOST_CHECK_OFF
REVIEW vite.config.ts:22 V15 FS_DENY_DROPS_ENV_FILES
REVIEW vite.config.ts:26 V12 PRODUCTION_SOURCE_MAPS
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 3 files, 3 with Vite content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
One VITE_OPENAI_API_KEY in .env, or one define: { 'process.env': env } after loadEnv(mode, process.cwd(), ''), puts your secret keys into JavaScript that every visitor downloads. This skill finds those and seven other Vite mistakes before you build or deploy, and tells you how to fix each one.
Your agent runs a scanner on your vite.config files, your .env files (including .env.example) and the vite scripts in package.json. It reads the envPrefix of each config and applies it to that project's .env files, so a prefix such as APP_ or TAURI_ is checked against the variables it really exposes. It skips comments, tells a setting apart from a string that only mentions it, and leaves public keys alone (VITE_FIREBASE_API_KEY, VITE_SUPABASE_ANON_KEY, publishable Stripe keys). The default npm create vite project passes clean. It never runs Vite or your app. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.
What it checks
BLOCK
- V01: secrets in variables Vite exposes to the browser (secret names, AI API keys, Stripe secret or Supabase service_role keys, copies such as VITE_DB="${DB_PASSWORD}")
- V02: an envPrefix that is empty, very short or matches server and CI secrets (APP_, TAURI_, GITHUB_, AWS_)
- V03: define that injects process.env, a loadEnv(mode, root, '') result, or a secret variable or value
- V04: server.fs.strict: false, or server.fs.allow with the filesystem root or home folder
REVIEW
- V11: dev or preview server on all interfaces (host: true, 0.0.0.0, a LAN address, vite --host)
- V12: production source maps in app builds (build.sourcemap or rollupOptions.output.sourcemap true or 'inline')
- V13: CORS open to any site (cors: true, origin '' or /./, Access-Control-Allow-Origin: *)
- V14: allowedHosts: true or legacy.skipWebSocketTokenCheck: true
- V15: a server.fs.deny list that replaces the defaults without .env entries
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example Vite project (vite.config.ts, .env.example, package.json), and the real report the scanner produces on the risky one
Limits It reads each file as written: options built by functions or imported from other files, and command-line flags other than --host, are not followed. Client source code is not read, and the installed Vite version is not checked. NOT FLAGGED is not a guarantee.
Static check of config and .env text. Computed options, settings from other files, client source code and the installed Vite version are not checked. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example .env.example files list variable names with empty values; they contain no keys. Nothing is run.