# Secret Handling Review

Secret Handling Review is a tested SKILL.md that reviews pasted application code, scripts and config for the four ways a secret leaks from the code that uses it, and lists only those, one line each with a fixed code, the place, who can then read the secret and the fix - or exactly No findings; an agent buys it once for $0.01 over x402.

- Page: https://aiskills402.com/skills/secret-handling-review
- Category: Code & Engineering (https://aiskills402.com/categories/code)
- Price: $0.01 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/secret-handling-review

## Use it when

Reviews pasted application code, scripts and config for the four ways a secret leaks from the code that uses it, and lists only those, one line each with a fixed code, the place, who can then read the secret and the fix - or exactly No findings. It catches a secret value written to a log or printed (the key itself, an object or environment dump that contains it), a secret placed in a URL query string, a secret typed into source or a committed file, and a server secret sent to the browser through a public environment prefix or a prop of a client component. It leaves out the safe look-alikes: printing only that a key is present, its length or its last four characters, a publishable key that is public by design, and a secret read from the environment on the server. Use to review code that calls an API with a key, to check a Next.js or Vite project before release, or to gate a pull request that touches credentials.

## Not for

Removing secrets from a text, CI workflow files, container build files, rotation and scanning tools, and the storage of a value that lies outside the paste. It reads pasted code and judges only what is written in it.

## Tested, honestly

Tested 2026-10-29.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on all 3 cases, read by hand. On the forecast script it named the config object printed at start-up and the key placed in the query string, and left out the line that prints only that the key is present, its length and its last four characters, and the key read from the environment. On the shop it found the mail password typed into a committed file and the admin token under the public prefix in a client component, and left out the publishable payment key and the CAPTCHA site key under the same prefix. On the clean reports route it answered exactly No findings.
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on all 3 cases, read by hand. It gave the same pairs of findings as Sonnet on the forecast script and on the shop, with the same safe look-alikes left out, and answered exactly No findings on the clean route. Two of its lines ended with a full stop and one answer was indented by four spaces, which the checks accept.

Note: Light test: three cases (two planted, one clean), one run per model; no comparison without the skill. The code was written by us with made-up values only; each planted case carries a safe look-alike (a presence, length and last-four print, a publishable key and a site key under the public prefix), and neither planted case has a comment pointing at the defect. A fifth code the brief suggested, a secret passed as a command-line argument, was dropped because no official page read on 29 October 2026 supports it. Facts come from OWASP cheat sheets and the Next.js, Vite and Stripe documentation, read on 29 October 2026; there are no owner-measured facts.

Full summary: https://aiskills402.com/skills/secret-handling-review/tests

## Example

### English (claude-sonnet-5-5)

Before:

> // scripts/forecast.mjs const config = {   baseUrl: 'https://api.example.com/v1',   apiKey: process.env.WEATHER_API_KEY,   timeoutMs: 5000, }; console.log('starting with config', config); console.log('key present:', Boolean(config.apiKey), 'length:', config.apiKey.length, 'ends with:', config.apiKey.slice(-4)); export async function getForecast(city) {…

After:

> SECRET-LOGGED — `console.log('starting with config', config)` — the config object holds `apiKey` (from `WEATHER_API_KEY`), so anyone who can read the log or console output reads the key — print only `baseUrl` and `timeoutMs`, or mask `apiKey`…

## What is in the file

- The answer
- What is a secret
- The codes
- How to read the code
- Rules
- Work in this order
- Short example

## Languages

English

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/secret-handling-review/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 7.8 KB (8024 bytes)
- SHA-256: 7adc71c9a6289af4f5d3b4cdfac777bacf30ce2d5c94b354bd8525c20c20e56b
- Updated: 2026-10-30
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-30)

First release, written in the light-test batch of 29 October 2026 (three cases, price $0.01). The idea is ours; no foreign skill was opened, facts come from OWASP cheat sheets and the Next.js, Vite and Stripe documentation (see notes/ideas.md). Output: one line per finding with a fixed code, or exactly `No findings.`

Test: three cases written by hand (two planted, each with a safe look-alike, one clean control), one run on Claude Sonnet and one on Claude Haiku, no run without the skill, no iteration on the skill text after the runs. `test/control.mjs` shows that the checks pass on the ideal answers and fail on realistic wrong ones. See `test-summary.json` for the verdicts read by hand.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### Last four characters in a log: a leak or not?

Not reported. Printing that a key is present, its length or its last four characters does not hand anyone the secret, so the skill leaves it out. It reports the key itself, an object that holds it, an environment dump, or an error that echoes the config.

### Why is a NEXT_PUBLIC_ value sometimes fine?

The prefix publishes the value to every visitor by design, so it is wrong for a token and right for a value meant to be public, such as a payment provider's publishable key or a CAPTCHA site key. The skill judges what the value is used for, not only its name.

### Does it repeat a secret it finds?

No. The answer names the variable and the place, never the value, so the review itself can be pasted into a ticket. A key read with process.env on the server is not reported, because reading from the environment is the safe way to do it.

### What stood in the three test snippets?

A forecast script that printed its config and sent the key in a query string, a shop with a typed mail password and an admin token under the public prefix, and a clean reports route. Sonnet and Haiku answered each once; see the test summary for the hand-read verdicts.

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
