Secrets Handling
FreeKeep credentials on the server, out of the client bundle, and out of the repository.
Purpose
Stop agents from pasting keys into frontend code or sample env files.
Procedure
--- name: secrets-handling description: Keep credentials on the server, out of the client bundle, and out of the repository. ---
Secrets Handling
Purpose
Stop agents from pasting keys into frontend code or sample env files.
Procedure
Secrets (database URLs, provider secret keys, webhook signing secrets, service tokens) are read on the server from the environment the platform injects. They are not VITE_ variables, not imported into components, and not committed.
Do not create .env, .env.local, or .env.example files in this project.
Do not put a real or realistic secret in source as a placeholder. A missing secret means the feature reports "not configured" and does not fall back to a fake success.
Client code may know public identifiers the provider documents as public. It must not know the secret that moves money or reads private rows.
Logs: do not print headers, cookies, or request bodies of payment webhooks.
If you find a secret already in the repo, say so and remove it from the change you control. Do not repeat the secret in the chat summary.
Rotation and storage beyond the running process are an operator task. Say what the operator must set, by name, without inventing a value.
Example requests
1. Where does the key go
Request: We need a payment provider secret. Apply Secrets Handling. Do not create a .env file. Expected: Server-only use, no example secret, and a clear statement that the provider is not configured.
Dependencies
None. Work in the repository that is already open. Do not add packages unless the procedure names one.
Compatibility
This document follows the Agent Skills layout (a folder named secrets-handling containing SKILL.md). Claude Code, Cursor, Codex, and Gemini CLI can load that file from the paths in the Skilling installation guide. GitHub Copilot does not load SKILL.md. Use the Copilot instructions copy, and narrow applyTo before you commit it.
Example prompts
Where does the key go
We need a payment provider secret. Apply Secrets Handling. Do not create a .env file.
Expected: Server-only use, no example secret, and a clear statement that the provider is not configured.
Choose the agent
This skill is installed for one agent at a time. Pick the section you are using.
Related
- Session Review
Check that a feature uses the server session and never a user id sent from the browser.
- Webhook Verification
Accept a payment or provider webhook only after the signature is checked on the server.
- Threat Model a Change
Walk a change for spoofing, tampering, and data exposure before it ships.
Reviews
No reviews yet.
Sign in to review.
Report a problem
Inaccurate steps, an unsafe instruction, or a licensing concern.
Sign in to report.