Introduction
LLM Secrets protects your .env files from AI coding assistants like Claude Code. Your secrets are encrypted with Windows Hello and only decrypted at runtime in isolated subprocesses.
Claude Code can use your secrets without ever seeing them. Commands run with injected environment variables, but the actual values never appear in Claude's context.
Installation
Prerequisites
- Windows 10/11 with Windows Hello enabled
- PowerShell 5.1 or later
- Claude Code CLI installed
CLI Installation Free
# Clone the repository
git clone https://github.com/VestedJosh/Scrt.git
# Navigate to the directory
cd Scrt
# Run the setup wizard
.\Initialize-SimpleSecret.ps1
Desktop App $10
Download the installer from the downloads page.
Quick Start
After installation, you'll have an encrypted .env.encrypted file. Here's how to use it:
# 1. Start a session (Windows Hello prompt)
Import-Module .\env-crypto-test\EnvCrypto.psm1
New-SessionKey
# 2. Run commands with secrets - they inject automatically
forge script script/Deploy.s.sol --rpc-url $env:ALCHEMY_RPC_URL --private-key $env:PRIVATE_KEY
Your secrets are injected at runtime. Claude Code never sees the actual values.
How It Works
The injection mechanism is simple:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Your Command │ --> │ Scrt injects │ --> │ Command runs │
│ (no secrets) │ │ $env:VARS │ │ with secrets │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Encryption at rest - Your
.envis encrypted with AES-256-CBC - Windows Hello unlock - Master key protected by DPAPI + Windows Hello
- Runtime injection - Secrets decrypted only in subprocess environment
- Isolation - Values never return to parent process or Claude's context
Security Model
| Claude CAN See | Claude CANNOT See |
|---|---|
Secret names (e.g., PRIVATE_KEY) |
Secret values (e.g., 0x7f3a...) |
| Command structure | Decrypted environment variables |
| Transaction hashes | Private keys or tokens |
| Success/failure messages | Passwords or API secrets |
Simple vs Advanced Mode
| Feature | Simple Mode | Advanced Mode |
|---|---|---|
| Authentication | Windows Hello only | Windows Hello + KeePass password |
| Master key storage | DPAPI encrypted | KeePass database |
| Best for | Daily use, personal machines | High-security, shared machines |
Using with Claude Code
Claude Code automatically has access to use your secrets via the $env:SECRET_NAME syntax.
Example: Deploy a Smart Contract
# Claude writes this command:
forge script script/Deploy.s.sol \
--rpc-url $env:ALCHEMY_RPC_URL \
--private-key $env:PRIVATE_KEY \
--broadcast
# Scrt injects the actual values at runtime
# Claude never sees your private key
Example: Push to GitHub
git push https://$env:GITHUB_PAT@github.com/user/repo.git
Example: Deploy to Vercel
vercel --token $env:VERCEL_TOKEN --prod
Claude should never run decryption scripts like New-SessionKey or /dscrt. If authentication is needed, Claude should ask you to authenticate, then retry the command.
Commands Reference
| Command | Description |
|---|---|
New-SessionKey |
Authenticate with Windows Hello (you run this, not Claude) |
/dscrt |
Decrypt .env for editing (you run this) |
/escrt |
Re-encrypt .env after editing (you run this) |
Initialize-SimpleSecret.ps1 |
Initial setup or mode change |
Environment Variables
Add secrets to your .env file using standard format:
PRIVATE_KEY=0x...
ALCHEMY_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/...
GITHUB_PAT=ghp_...
VERCEL_TOKEN=...
GODADDY_API_KEY=...
GODADDY_API_SECRET=...
Reference them in commands as $env:SECRET_NAME.
Backup & Restore
LLM Secrets supports encrypted cloud backups:
- Automatic backups - Configurable frequency (daily, weekly, monthly)
- Recovery password - Separate from Windows Hello, for disaster recovery
- Cross-machine restore - Restore secrets on a new Windows machine
Troubleshooting
"No valid Windows Hello session"
Your session expired. Run:
Import-Module .\env-crypto-test\EnvCrypto.psm1
New-SessionKey
"DPAPI master key not found"
Initial setup needed. Run:
.\Initialize-SimpleSecret.ps1
Asking for KeePass but you want Simple mode
Wrong mode configured. Run:
.\Initialize-SimpleSecret.ps1 -Force
# Choose option 1 (Simple Mode)
Secret not found
The secret may not be in your encrypted vault. Run /dscrt to decrypt, add the secret, then /escrt to re-encrypt.