AI-Native Workflow
Hush provides commands specifically designed for AI coding assistants. These let AI agents reason about your secrets without ever seeing the actual values.
The Problem
When you ask an AI assistant to help with your project, it often needs to understand your configuration:
- “Set up the database connection”
- “Configure Stripe integration”
- “Check if the API key is set”
If you let the AI read your .env file directly, those secrets get sent to the LLM provider. That’s a security risk.
The Solution
Hush provides two AI-safe commands:
hush inspect- Shows all variables with masked valueshush has <key>- Checks if a specific variable exists
These commands give AI agents enough information to help without exposing secrets.
Commands for AI Agents
hush inspect
Shows all variables with masked values:
hush inspectOutput:
Secrets for development:
DATABASE_URL = post****************... (45 chars) STRIPE_SECRET_KEY = sk_t****************... (32 chars) API_KEY = (not set)
Total: 3 variables
Target distribution:
root (.) - 3 vars app (./app/) - 1 vars include: EXPO_PUBLIC_* api (./api/) - 2 vars exclude: EXPO_PUBLIC_*The AI can see:
- Which variables exist
- Their approximate length
- Which are set vs unset
- Which targets receive which variables
But it never sees the actual values.
hush has
Check if a specific variable is set:
# Verbose outputhush has DATABASE_URL# Output: DATABASE_URL is set (45 chars)
# Quiet mode (for scripting)hush has DATABASE_URL -q# Exit code: 0 (exists) or 1 (missing)Use in conditional logic:
hush has STRIPE_SECRET_KEY -q && echo "Stripe is configured"hush has DATABASE_URL -q || echo "Missing DATABASE_URL"AI Agent Instructions
If you’re using AI coding assistants, add this to your project’s AI instructions:
## Secrets Management
This project uses Hush for secrets. NEVER read .env files directly.
Instead, use these commands:- `hush inspect` - See what variables are configured- `hush has <KEY>` - Check if a specific variable exists- `hush status` - See configuration and file status
These commands mask sensitive values, making them safe to run.Common AI Workflows
”Help me set up the database”
- AI runs
hush inspectto see current variables - AI sees
DATABASE_URL = (not set) - AI provides instructions for adding the variable
- Human adds the value and runs
hush encrypt
”Check if Stripe is configured”
hush has STRIPE_SECRET_KEY -q && echo "Ready" || echo "Missing"AI gets a clear yes/no without seeing the key.
”What environment variables does the API need?”
hush inspect -e productionAI sees which variables exist for production and which targets receive them.
Example Conversation
Human: Can you help configure the payment integration?
AI: Let me check your current secrets configuration.
hush inspectI can see you have:
STRIPE_SECRET_KEY- Set (32 chars)STRIPE_WEBHOOK_SECRET- Not setSTRIPE_PUBLISHABLE_KEY- Not set
You’re missing the webhook secret and publishable key. Here’s how to add them:
- Get your keys from the Stripe dashboard
- Add them to
.env:Terminal window STRIPE_WEBHOOK_SECRET=whsec_xxxSTRIPE_PUBLISHABLE_KEY=pk_xxx - Encrypt:
hush encrypt
Cursor Integration
For Cursor, add to your .cursorrules:
# Secrets- Never read .env, .env.*, or .dev.vars files directly- Use `hush inspect` to see variable names and status- Use `hush has <KEY>` to check specific variables- These commands mask values, making them safe to shareClaude Integration
For Claude’s project knowledge:
# Environment Variables
This project uses Hush for encrypted secrets management.
Safe commands (these mask values):- hush inspect - List all variables with masked values- hush has <KEY> - Check if a variable exists- hush status - Show configuration
Never run:- cat .env- echo $SECRET_KEY- Any command that would expose actual valuesClaude Code / OpenCode Skill
For Claude Code or OpenCode users, Hush includes a ready-to-use Agent Skill that automatically teaches the AI to use Hush commands instead of reading .env files directly.
Installation
The easiest way to install the skill is with the hush skill command:
npx hush skill # Interactive: choose global or localnpx hush skill --global # Install to ~/.claude/skills/ (all projects)npx hush skill --local # Install to ./.claude/skills/ (this project)Global vs Local:
- Global (
~/.claude/skills/) - Works across all your projects. Recommended for personal use. - Local (
./.claude/skills/) - Bundled with the project. Recommended for teams (commit to git).
How It Works
Once installed, Claude Code automatically:
- Detects when you’re working with secrets, environment variables, or
.envfiles - Loads the Hush skill instructions
- Uses
hush inspectandhush hasinstead of reading files directly - Guides you through adding or modifying secrets safely
What the Skill Teaches Claude
- Never read
.env,.env.*,.env.local, or.dev.varsfiles - Use
hush inspectto see what variables exist (with masked values) - Use
hush has <KEY>to check if specific secrets are configured - Use
hush setto help users add or modify secrets - Guide users through
hush encryptafter changes
Skill Files
The skill uses progressive disclosure - only loading detailed docs when needed:
| File | Purpose |
|---|---|
SKILL.md | Core rules and daily commands (always loaded) |
SETUP.md | First-time setup instructions (loaded if Hush not configured) |
REFERENCE.md | Detailed command reference (loaded when needed) |
examples/workflows.md | Step-by-step workflow examples |
Security Considerations
What AI Sees
With hush inspect:
- Variable names
- Whether they’re set or unset
- Character length (approximate)
- First 4 characters (masked:
sk_t***...)
What AI Never Sees
- Full secret values
- Complete connection strings
- API keys or tokens
- Passwords
Why This Matters
Even if your AI conversation is logged:
- No secrets in the logs
- No risk of accidental exposure
- Audit-friendly workflow