leaked-secrets
What it does
This skill checks client-side code, page source and project history for credentials that anyone could read. It is for developers who want to keep their keys private.
When to use it
- ✓When an API key appears in a JavaScript file that visitors can download.
- ✓When a .env file may have been committed to a repository.
- ✓When you add a new service and want to be sure its secrets stay private.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/leaked-secrets/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you check my front-end code for API keys or passwords that should not be public?”
5 new skills a week. 1 minute to read.
How it works
The agent scans page source and JavaScript for secret-like patterns and searches project history for past leaks. It suggests moving secrets to the server, rotating any exposed key and adding secret scanning.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Leaked Environment Variables
An API key embedded in client-side JavaScript gives anyone with a browser devtools tab full access to your cloud services, databases, or third-party APIs — leading to data breaches, unexpected charges, or account takeover.
Quick Reference
- Any secret in client-side JavaScript is publicly readable — treat all front-end code as public
- In Next.js, only variables prefixed with
NEXT_PUBLIC_are exposed to the browser — never put secrets in these - Common leak locations:
.envfiles committed to git, hardcoded API keys in JS bundles, service account credentials inwindow.__INITIAL_STATE__ - Use
git log -S 'keyword'to search git history for previously committed secrets; rotate any found secrets immediately - Tools: GitLeaks, TruffleHog, GitHub Secret Scanning can detect leaks in repositories automatically
Check
Scan the page HTML source and JavaScript bundles for patterns that look like secrets: API keys, tokens, passwords, private keys, connection strings, or credentials. Check for common patterns like sk_, pk_, AIza, ghp_, AKIA, and base64-encoded strings in unusual contexts.
Fix
Move all secrets server-side. Replace client-exposed credentials with server-side API proxies. Rotate any leaked credentials immediately — treat them as compromised. Implement git-secrets or a pre-commit hook to prevent future leaks.
Explain
Explain why client-side JavaScript is public code, how secrets leak into bundles, what the impact of a leaked API key is, and how to architect applications to keep secrets server-side.
Code Review
Review server config, headers, forms, and integration points related to Leaked Environment Variables. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/security/leaked-secrets
FAQ
Why is a key in front-end code risky?
The skill says anyone with browser developer tools can read it and use the associated service.
What about Next.js public variables?
The skill says only variables with the NEXT_PUBLIC prefix reach the browser, so secrets must never use that prefix.
What should be done after a leak?
The skill says to rotate the leaked credential immediately and treat it as compromised.
Details
Original description by the author
Use when reviewing client-side JavaScript, HTML source, or git history for exposed credentials, API keys, or tokens.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2917
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.