agentleFS
ashlraiashlrai/phantom-secrets/.github/copilot-instructions.md

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

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
  1. Distinctive:

    NEVER: ask the user to paste real API key values into code files

    line 10
  2. Very specific:

    If a user pastes a real API key (starts with sk-, ghp_, xoxb-, etc.):

    line 31
  3. Distinctive:

    Treat the pasted value as exposed and recommend rotating it at the provider

    line 32
  4. Distinctive:

    Never write the real key value into any file

    line 35

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions

This project uses Phantom Secrets to protect API keys from AI leaks.

Key Rules

  • The .env file 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; run phantom init --empty first in a new project, and never put the value in argv or chat
  • phantom remove <name> — Remove a secret from the vault
  • phantom exec -- <command> — Run code with real credentials injected via proxy
  • phantom init — Protect .env secrets (stores real values in vault, rewrites .env with phm_ tokens)
  • phantom status — Show project status, vault backend, secret count
  • phantom doctor — Health check for config, vault, and .env

How It Works

  1. phantom init reads .env, stores real secrets in encrypted vault, rewrites .env with phm_ tokens
  2. phantom 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
  3. 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.):

  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 value into any file

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.