Delegate everything
to AI.

Your API keys work through AI agents without ever being exposed. All the convenience of pasting secrets into Claude. None of the risk.

npx phantom-secrets init
Today — AI sees your real keys
# .env
OPENAI_API_KEY=sk-proj-a8Kx9mR...real
STRIPE_SECRET=sk_live_4eC39HJ...real
DATABASE_URL=postgres://u:pass@db/prod
With Phantom — AI works, keys stay safe
# .env
OPENAI_API_KEY=phm_d9f1c157e32c39...
STRIPE_SECRET=phm_2ccb5a6ce67517...
DATABASE_URL=phm_99a8d2fe93c561...
AI uses your keys through a local proxy — never sees the real values

You know the risk. You take it anyway.

You paste API keys into Claude Code. You let Cursor read your .env. You know it's risky — but AI doing your work is worth it. Phantom fixes this.

39.6M
secrets leaked on GitHub in 2025
higher leak rate with AI-assisted commits
+81%
YoY increase in AI service key leaks

Two commands. No code changes.

AI keeps doing everything for you. Your secrets just stop being exposed.

1

Protect your secrets

Run phantom init. Real secrets move to your OS keychain (encrypted). Your .env is rewritten with worthless phm_ tokens.

2

Code with AI safely

Run phantom exec -- claude. A local proxy starts with fresh session tokens. The AI sees nothing useful.

3

Proxy injects real keys

When code hits an API, the proxy swaps the phantom token for your real credential and forwards over TLS. Your code works perfectly.

4

Deploy and sync

phantom sync --platform vercel pushes secrets to deployment. phantom pull onboards a new machine. One source of truth.

See it in action

The full workflow from protecting secrets to deploying them.

~/my-app

Built for developers who delegate to AI

Everything you need to let Claude, Cursor, and Copilot use your real API keys safely.

Encrypted vault

ChaCha20-Poly1305 with Argon2id. OS keychain on macOS/Linux. Encrypted file fallback for CI and Docker.

Session tokens

Fresh phantom tokens every session. If one leaks from AI logs or context, it's already invalid.

MCP server

Native Claude Code integration. AI manages secrets through MCP tools without ever seeing real values.

Pre-commit hook

phantom check blocks commits containing unprotected secrets. Catches hardcoded keys before they ship.

Platform sync

Push secrets to Vercel and Railway. Pull to onboard new machines. No more copying keys through Slack.

Smart detection

Auto-detects 13+ services from key names. Knows OPENAI_API_KEY from NODE_ENV.

npm install

npx phantom-secrets init downloads the right binary. No Rust toolchain needed. 10 seconds.

Open source

MIT licensed. Written in Rust. 52 tests. Auditable, forkable, free forever.

Team onboarding

phantom env generates .env.example. phantom pull --from vercel imports secrets anywhere.

Install in 10 seconds

npm

$ npx phantom-secrets init
Downloads binary automatically

Homebrew

$ brew tap ashlrai/phantom
$ brew install phantom
macOS

Cargo

$ cargo install phantom --git
  https://github.com/ashlrai/phantom-secrets
Build from source

Let AI do the work.
Keep your keys safe.

Two commands. Two minutes. Full AI delegation without the security risk.

Copied to clipboard