The hardware-secured environment injector. Eliminate plain-text .env files with Libsodium encryption and macOS Secure Enclave (Touch ID) integration.
- ✘ No Plain-Text: Stop storing secrets in naked
.envfiles that can be leaked or stolen. - ◈ Hardware Gated: Your Global Identity is locked behind the macOS Secure Enclave. Use your fingerprint to unlock project secrets.
- ✔ Temporary Injection: Secrets are injected into a child process and destroyed the moment you exit the session.
- ◈ Agent Aware: AI agents can securely manage your secrets without ever seeing your master password.
- ◈ Clean Aesthetic: Warm, professional TUI using the Flexoki color palette.
Screen.Recording.2026-04-12.at.1.35.14.PM.mov
The Vault CLI interface is styled with Flexoki, an inky color scheme for toolmakers. Special thanks to Steph Ango for creating this beautiful, high-contrast palette that makes terminal work a delight.
- macOS (for Touch ID/Secure Enclave support).
- Swift (part of Xcode Command Line Tools).
- Node.js (v20+ recommended).
git clone https://github.com/LutfiGarzon/vault.git
cd vault
npm install
# Compile and sign the hardware bridge
./scripts/setup.sh
# Build TypeScript
npm run build
# Link globally
npm linkScan your .env files and create an encrypted .env.vault:
vault initStore machine-wide secrets (like NPM_TOKEN or AWS_KEYS) in your global machine identity. You can automatically migrate secrets from your shell config:
vault init -g -f ~/.zshrcOnce migrated, you can safely delete the plain-text exports from your .zshrc.
Upgrade your machine identity from password-only to biometrics:
vault ebIf you lose your computer, you can restore your Global Identity on a new machine using your Recovery Key:
vault recoverAdd a variable to the local project or global vault:
# Interactively (securely hidden)
vault add API_KEY
# Machine-wide global secret
vault add NPM_TOKEN --globalSee what secrets are currently available in your environment (values are masked by default):
vault ls
# Reveal plain-text values
vault ls --show-secretsSecurely strip secrets from your .env file while keeping public config (like PORT) intact:
# Preview changes first
vault clean --dry-run
# Execute clean
vault clean
# Clean global files (e.g., .zshrc)
vault clean -g -f ~/.zshrcEject secrets from .env.vault back into a plain-text .env file:
vault exportInject variables into process.env (Node), os.environ (Python), or any child process. This automatically merges Global + Project secrets:
# Node.js
vault npm start
# Python
vault python app.pyOpen a new shell session where your secrets are available to every command you type:
vault
echo $MY_SECRET
exitGenerate Terraform templates to establish OIDC-based trust between your CI provider and cloud provider. This allows your CI pipelines to authenticate via OpenID Connect instead of long-lived cloud credentials.
# Interactive wizard
vault oidc
# With environment suffix (generates vault-oidc-aws-prod.tf)
vault oidc --env prodSupported cloud providers: AWS, Azure, GCP
Supported CI providers: GitHub Actions, GitLab CI
| Cloud | Terraform resources created |
|---|---|
| AWS | IAM OIDC provider, trust policy, IAM role, role ARN output |
| Azure | Azure AD application, federated identity credential, object ID output |
| GCP | Workload identity pool, pool provider, service account, IAM binding, project_id variable |
After generating the template, apply it with:
terraform init
terraform apply -var="project_id=$GCP_PROJECT_ID" # GCP only
terraform apply # AWS / AzureKMS Key: The OIDC templates configure trust between CI and your cloud provider, but do not create the encryption key (KMS key). Create the key manually in your cloud console, encrypt your vault's Group Master Key with it, and pass the ciphertext as an environment variable.
Inside your CI pipeline, vault ci uses OIDC to decrypt secrets at runtime. Configure these environment variables in your CI secrets:
AWS
VAULT_AWS_ROLE_ARN=arn:aws:iam::123456789:role/vault-ci-role
VAULT_KMS_CIPHERTEXT=base64-encrypted-kms-ciphertextAzure
VAULT_AZURE_TENANT_ID=your-tenant-id
VAULT_AZURE_CLIENT_ID=your-app-registration-client-id
VAULT_AZURE_KEY_VAULT_URL=https://myvault.vault.azure.net
VAULT_AZURE_KEY_NAME=my-key
VAULT_AZURE_CIPHERTEXT=base64-encrypted-ciphertext
# Optional: override auto-detection
# VAULT_CLOUD_PROVIDER=azureGitLab users: Configure your
.gitlab-ci.ymlid_tokenswith audienceapi://AzureADTokenExchangefor the Azure path.
GCP
VAULT_GCP_PROJECT_NUMBER=123456789
VAULT_GCP_POOL_ID=vault-pool
VAULT_GCP_PROVIDER_ID=github
VAULT_GCP_PROJECT_ID=my-project # defaults to PROJECT_NUMBER
VAULT_GCP_KMS_LOCATION=global # defaults to global
VAULT_GCP_KMS_KEY_RING=my-keyring
VAULT_GCP_KMS_KEY_NAME=my-key
VAULT_GCP_CIPHERTEXT=base64-encrypted-ciphertextDisambiguation: If multiple cloud env vars are set, use:
VAULT_CLOUD_PROVIDER=aws|azure|gcpjobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
contents: read
steps:
- uses: actions/checkout@v4
- run: vault ci npm start
env:
VAULT_AWS_ROLE_ARN: ${{ secrets.VAULT_AWS_ROLE_ARN }}
VAULT_KMS_CIPHERTEXT: ${{ secrets.VAULT_KMS_CIPHERTEXT }}Vault is designed for the age of AI. When you run an agent with Vault (e.g., vault pi), the CLI creates a temporary session token.
- Read Access: The agent automatically sees all decrypted secrets in its environment.
- Write Access: The agent can call
vault add KEY VALUEto store new secrets without triggering a biometric prompt. - Security: The session token is only valid for the life of the agent process. It is never stored on disk and cannot be used after you close the agent.
This project is built with a feature-first modular architecture and follows TDD (Test-Driven Development). To add a new command:
- Write failing tests in
test/features/your-feature/. - Create
src/features/your-feature/for logic, TUI, templates, and providers. - Add the route to
src/cli.ts. - Run
npm testto ensure all tests pass and coverage thresholds are met.
See src/features/oidc/ for a complete example of a feature with templates, providers, and full test coverage.
- Memory Safety: All sensitive keys are wiped using
sodium.memzero()immediately after use. - Disk Safety: Decrypted payloads reside only in memory; they are never written to temporary files.
- Hardware Integrity: Any changes to
src/core/bridge.swiftrequire a re-compile and re-sign ofvault-bridge.
Author: Lutfi Garzon
License: Apache-2.0
If Vault has helped you secure your workflow, consider supporting its development: