vaultbix-cli
v1.2.6
Published
PTY-based wrapper around Claude Code that scans your keystrokes for API keys and secrets before they leave your machine.
Maintainers
Readme
vaultbix-cli
⭐ Star this repo if VaultBix ever caught a key before it leaked → https://github.com/carlgaopapi-png/vaultbix-cli
A PTY-based wrapper around Claude Code that scans every line you type for API keys and secrets before they leave your machine. The full Claude Code TUI works exactly as normal — arrow keys, history, autocomplete, paste — but if a secret slips into your prompt, VaultBix blocks the submission and tells you what it caught.
⚠️ VaultBix is no longer actively maintained. The code stays up and
vaultbix-clikeeps working — fork it, build on it, ship it. Built by Carl and Max, 2025–2026.
Install
npm install -g vaultbix-cliThis puts a vaultbix binary on your PATH.
Requirements
- Node.js 16 or newer
- A C/C++ toolchain only if a
node-ptyprebuilt binary isn't available for your platform. Prebuilds ship for macOS (arm64 + x64) and Windows (arm64 + x64). On Linux or unusual Node versions,npm installwill fall back to compiling from source — make sure you havepython3andmakeplus eithergcc/g++(Linux) or Xcode Command Line Tools (macOS). - A
postinstallstep automatically fixes a known permission issue withnode-pty's prebuiltspawn-helperon macOS. No manual action needed.
If the install fails with a node-pty error, the most common fix is:
npm install -g vaultbix-cli --build-from-sourceUsage
Run vaultbix anywhere you would normally run claude:
vaultbixAny extra arguments are forwarded to the underlying claude process. If your Claude binary lives under a different name or path, point at it explicitly:
vaultbix --command /usr/local/bin/claude -- --some-claude-flagTo see the full list of detection patterns:
vaultbix --list-patternsWhat it detects
- AWS Access Key ID (
AKIA...) - AWS Secret Access Key (40 chars after
aws_secret) - GitHub tokens (
ghp_,gho_,ghu_,ghs_,ghr_) - OpenAI API keys (
sk-+ 48 chars) - Anthropic API keys (
sk-ant-...) - Stripe secret keys (
sk_live_,sk_test_) - Stripe publishable keys (
pk_live_,pk_test_) - Google API keys (
AIza...) - Slack tokens (
xoxb-,xoxa-,xoxp-,xoxr-,xoxs-) - Slack webhook URLs (
hooks.slack.com/services/...) - Firebase realtime DB URLs (
*.firebaseio.com) - Twilio API key SIDs (
SK+ 32 hex) - SendGrid API keys (
SG.xxx.yyy) - Mailgun API keys (
key-+ 32 chars) - Heroku API keys (UUIDs near the word "heroku")
- RSA, PKCS#8, and OpenSSH private key blocks
- MongoDB / PostgreSQL / MySQL connection strings with embedded credentials
- JWT tokens (
eyJ...three-part) - Generic high-entropy strings (32+ chars near words like
key,secret,token,password)
What happens when a secret is detected
VaultBix sends Ctrl+U to Claude's TUI to clear the input line, prints a warning showing which pattern matched and a redacted preview (first 4 chars + *), and drops the submission. Claude never sees the secret.
Recommended workflow: export the value as an environment variable in your shell before launching vaultbix:
export ANTHROPIC_API_KEY=sk-ant-...
vaultbixThen in Claude, refer to it by name: "use the key in process.env.ANTHROPIC_API_KEY". The value stays out of the Claude conversation entirely.
Note: older versions of vaultbix-cli (< 1.1.0) shipped an interactive "inject as env var" prompt via
inquirer. That flow doesn't work inside the PTY-based wrapper because Claude Code owns the terminal in raw mode, so injection has been simplified to block-and-warn. Theinjector.tsmodule still ships in the source for programmatic use.
How it works
vaultbix spawns claude inside a real PTY using node-pty, so the Claude Code TUI gets a true terminal — arrow keys, history, autocomplete, bracketed paste, and resize events all work normally. Output from the PTY flows straight to your stdout untouched.
On the input side, stdin is put into raw mode and processed character by character:
- Printable characters are buffered locally and forwarded to the PTY for immediate visual feedback.
- Backspace,
Ctrl+U, andCtrl+Wupdate the local buffer to match what Claude's TUI displays. - Escape sequences (arrow keys, function keys, mouse events, bracketed paste, etc.) are forwarded to the PTY but not scanned; the local buffer is cleared since the TUI's state may have changed (e.g. history navigation).
- When you press
Enter, the buffered line is scanned. If clean, just\ris sent to the PTY (your characters are already there). If a secret is detected,Ctrl+Uis sent instead to clear Claude's input line and a warning is printed.
Terminal resize is forwarded to the PTY so Claude's TUI stays in sync when you drag your window.
Development
npm install
npm run build # compile to dist/
npm run dev # run via ts-node
npm start # run compiled dist/index.jsLicense
MIT
