phantom-secrets
Copilot instructions20 starsChanged 8 days agoMITView on GitHub
This project uses Phantom Secrets to protect API keys from AI leaks. phantom setup has no Copilot client. Print a snippet with phantom setup --client claude --print and adapt it for your VS Code MCP settings. The snippet runs the server bundled in the installed phantom executable and never downloads a registry package. The runtime tools/list response and mcp-registry/server.json are the canonical tool catalog. Start with phantom_capability. Value-free tools include phantom_status, phantom_why, and phantom_list_secrets. MCP never accepts or returns secret…
- Reads credentials
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- llms.txtllms.txt
The file
We split this copilot-instructions.md into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
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 chat or code files
- Distinctive: line 11
NEVER: put a secret value in a command line.
- Very specific: line 49
If a user pastes a real API key (starts with sk-, ghp_, xoxb-, etc.):
- Distinctive: line 50
Treat the pasted value as exposed and recommend rotating it at the provider
- Distinctive: line 53
Never write the real key value into any file
- Very specific: line 77
Add a changelog.d/ fragment instead of editing CHANGELOG.md.
- Very specific: line 78
Before pushing, run node scripts/changelog-fold.mjs --check and git diff main...HEAD | perl .github/tests/secret-shape/scrub.pl --check …
≈ “Common” is an estimate: at least 1 in 5 of the 3,894 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 chat or code files
- NEVER put a secret value in a command line; argv is observable
- 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 why <KEY>— Explain whether a variable is protected, without reading the vaultphantom doctor— Health check for config, vault, and .env
MCP Server
phantom setup has no Copilot client. Print a snippet with
phantom setup --client claude --print and adapt it for your VS Code MCP
settings. The snippet runs the server bundled in the installed phantom
executable and never downloads a registry package.
The runtime tools/list response and mcp-registry/server.json are the
canonical tool catalog. Start with phantom_capability. Value-free tools
include phantom_status, phantom_why, and phantom_list_secrets. MCP never
accepts or returns secret values: phantom_add_secret_interactive returns the
phantom add NAME command for the user to run in a trusted terminal. Mutating
tools such as phantom_rotate and phantom_remove_secret require
confirm: true plus a one-use out-of-band approval_token, and stay disabled
unless the operator sets PHANTOM_MCP_EFFECTS=trusted-terminal.
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
Working on this repository
Agents changing Phantom itself follow AGENTS.md for operating
rules, CLAUDE.md for build, test, lint, and format commands, and
the "Contribute with an agent" path in CONTRIBUTING.md.
While iterating, run scripts/fast-check.sh main. Before opening a pull
request, run the full gate once, because pull request CI does not run the Rust
test suite: cargo test --workspace --all-targets --locked --no-fail-fast,
cargo fmt --all -- --check, and
cargo clippy --workspace --all-targets --locked -- -D warnings. For a
documentation-only change, skip scripts/fast-check.sh (a non-Rust path
checks the whole workspace) and run the docs drift checks instead, which pull
request CI also skips:
node --test scripts/release/readme-mcp-catalog.test.mjs,
node --test scripts/docs-distribution.test.mjs,
node --test scripts/hot-file-rule.test.mjs, and
cargo test --locked -p phantom-secrets --test docs_command_flags_test,
plus every suite that reads the file you edited, including those in
apps/web/tests/ (list them with git grep -l -F <file-name> -- '*.test.*').
That search misses two checks: after editing docs/agents.md, run
bash scripts/test-docs-agents.sh; after editing a file with a
<!-- fresh:begin marker, run node scripts/freshness/check.mjs.
Add a changelog.d/ fragment instead of editing CHANGELOG.md.
Before pushing, run node scripts/changelog-fold.mjs --check and
git diff main...HEAD | perl .github/tests/secret-shape/scrub.pl --check --allow-fixtures;
the second is the local form of the Secret-shape scan that CI Gate requires.
On a fork, diff against upstream/main instead of main.
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.

