secrets-sweep

Extracts hardcoded credentials, API keys, and URLs from Playwright test suites into .env files.

5|2|Updated May 19, 2026
One-click install
npx skills add https://github.com/civitas-cerebrum/achilles --skill secrets-sweep-civitas-cerebrum
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secrets-sweep
Source: https://github.com/civitas-cerebrum/achilles/tree/main/skills/secrets-sweep
Command: npx skills add https://github.com/civitas-cerebrum/achilles --skill secrets-sweep-civitas-cerebrum

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites often accumulate hardcoded secrets — passwords, API keys, JWTs, real-looking emails, and app URLs — that leak into version control and break portability across environments. This Skill sweeps the test tree for those literals and replaces them with environment variables before the suite is published or shared. ## Core Features & Use Cases - Pattern-based secret detection: Greps the test tree for credential keywords, token shapes (JWTs, AWS keys, GitHub/Slack tokens), email addresses, and URL/port literals, with explicit handling of false positives. - Structured remediation: Replaces literals with process.env references, writes a gitignored .env with real values, a committed .env.example with placeholders, and verifies .gitignore coverage including .env.local variants. - Verification and reporting: Re-scans after remediation, runs the Playwright suite to confirm nothing broke, and returns a schema-conformant handover with status, env var names, and files modified. - Use Case: Before open-sourcing a Playwright E2E suite, run the sweep to extract a hardcoded Stripe test key and localhost URL into STRIPE_API_KEY and APP_URL, leaving the suite green and safe to publish. ## Quick Start Sweep my Playwright test suite for hardcoded secrets and extract them into .env before I publish it.

Frequently Asked Questions about secrets-sweep

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove hardcoded secrets from a Playwright test suite?

Grep the tests/ directory and playwright config for credential keywords, token shapes, emails, and URLs, then replace each literal with a process.env reference. Write real values to a gitignored .env and placeholders to a committed .env.example, then re-run the suite to verify.

What patterns detect leaked API keys in test code?

Effective patterns include three-segment JWTs starting with eyJ, AWS keys matching AKIA plus 16 characters, GitHub tokens (ghp_ or github_pat_), Slack tokens (xox[baprs]-), and sk- prefixed keys. Also grep for password, secret, token, and bearer keywords.

Should I extract [email protected] from my test fixtures?

No. The convention [email protected] and Test User are acceptable placeholder defaults and should be left alone. Only parameterize emails or names that resemble real people, mapping them to TEST_USER_EMAIL.

Does the secrets sweep modify application source code?

No. Application source under src/ or app/ is strictly out of scope. If a credential is found in application code, it is flagged in the summary for the application team to remediate rather than edited directly.

Why does my Playwright suite fail after extracting secrets to .env?

Failures usually mean an environment variable was not loaded before the specs ran. Verify that dotenv or the harness equivalent loads .env before test execution, and confirm every extracted variable is defined in the .env file.