phantom-secrets
Copilot instructions16 starsChanged 3 months agoMITView on GitHub
This project uses Phantom Secrets to protect API keys from AI leaks. If a user pastes a real API key (starts with sk-, ghp_, xoxb-, etc.): 1. Treat the pasted value as exposed and recommend rotating it at the provider 2. Suggest phantom add <KEY_NAME> so the replacement value is entered only in the hidden trusted-terminal prompt 3. Reference the key by name or its phantom token (phm_...) in code, not the real value 4. Never write the real key…
- Reads credentials
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
The file
We split this copilot-instructions.md into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
NEVER: ask the user to paste real API key values into code files
- Very specific: line 31
If a user pastes a real API key (starts with sk-, ghp_, xoxb-, etc.):
- Distinctive: line 32
Treat the pasted value as exposed and recommend rotating it at the provider
- Distinctive: line 35
Never write the real key value into any file
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions
This project uses Phantom Secrets to protect API keys from AI leaks.
Key Rules
- The
.envfile contains phantom tokens (phm_...), NOT real secrets - Real secrets are stored in an encrypted vault (OS keychain or encrypted file)
- NEVER hardcode API keys in source code
- NEVER ask the user to paste real API key values into code files
- NEVER attempt to read, log, or display real secret values
Commands
phantom list— See available secrets (never shows values)phantom add <name>— Add a new secret transactionally through the hidden trusted-terminal prompt; runphantom init --emptyfirst in a new project, and never put the value in argv or chatphantom remove <name>— Remove a secret from the vaultphantom exec -- <command>— Run code with real credentials injected via proxyphantom init— Protect .env secrets (stores real values in vault, rewrites .env with phm_ tokens)phantom status— Show project status, vault backend, secret countphantom doctor— Health check for config, vault, and .env
How It Works
phantom initreads.env, stores real secrets in encrypted vault, rewrites.envwithphm_tokensphantom exec -- <cmd>starts a local proxy that injects only a matched route's vault value into its fixed authentication header; client headers and bodies never resolve phantom tokens- AI agents see only worthless
phm_tokens — real keys are never in the AI context window
When You See API Keys
If a user pastes a real API key (starts with sk-, ghp_, xoxb-, etc.):
- Treat the pasted value as exposed and recommend rotating it at the provider
- Suggest
phantom add <KEY_NAME>so the replacement value is entered only in the hidden trusted-terminal prompt - Reference the key by name or its phantom token (
phm_...) in code, not the real value - Never write the real key value into any file
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

