🏎️ 🏠 🍎 🪟 🐧 - Secrets manager that injects credentials into commands as environment variables so agents never…
secretctl
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Stop pasting API keys into AI chat.**
When you paste sk-proj-xxx into Claude Code, that secret is now in your conversation history, Anthropic's logs, and potentially exposed to prompt injection attacks.
secretctl fixes this. Your AI gets command results, never secret values.
---
The Problem
Every day, developers paste secrets into AI coding assistants:
**This is a security incident waiting to happen.**
- Secrets in conversation history
- Secrets in cloud logs
- Secrets exposed to prompt injection
- No way to rotate or revoke
The Solution
secretctl injects secrets as environment variables. Your AI runs commands and sees results, but **never sees the actual credentials**.
- **Single binary** — No servers, no configuration, no subscription
- **Local-first** — Secrets never leave your machine
- **MCP integration** — Works with Claude Code out of the box
- **Defense in depth** — AES-256-GCM + Argon2id + output sanitization
Why Local-First & AI-Safe?
1. **Your secrets, your machine** — No cloud sync, no third-party servers, no subscription fees. Your credentials stay on your device, period.
2. **AI agents don't need plaintext** — When Claude runs aws s3 ls, it needs the *result*, not your AWS keys. secretctl injects credentials directly into commands—AI never sees them.
3. **Defense in depth** — AES-256-GCM encryption at rest, Argon2id key derivation, MCP policy controls, and automatic output sanitization. Multiple layers, not a single point of failure.
Installation
From Source
Binary Releases
Download the latest release from GitHub Releases.
**CLI:**
- secretctl-linux-amd64 — Linux (x86_64)
- secretctl-linux-arm64 — Linux (ARM64)
- secretctl-darwin-amd64 — macOS (Intel)
- secretctl-darwin-arm64 — macOS (Apple Silicon)
- secretctl-windows-amd64.exe — Windows (x86_64)
**Desktop App:**
- secretctl-desktop-macos — macOS (Universal)
- secretctl-desktop-linux — Linux (AppImage)
- secretctl-desktop-windows.exe — Windows (Installer)
Verify Downloads
macOS: Gatekeeper Warning
macOS may show a security warning for unsigned apps. To allow:
Windows: SmartScreen Warning
Windows SmartScreen may show a warning. To allow:
1. Click "More info"
2. Click "Run anyway"
Quick Start
1. Initialize your vault
2. Store a secret
3. Retrieve a secret
4. List all secrets
5. Delete a secret
Features
Core
- **AES-256-GCM encryption** — Industry-standard authenticated encryption
- **Argon2id key derivation** — Memory-hard protection against brute force
- **SQLite storage** — Reliable, portable, no external dependencies
- **Audit logging** — HMAC-chained logs for tamper detection
- **AI-safe by design** — MCP integration never exposes plaintext secrets to AI agents
Metadata Support
Run Commands with Secrets
Inject secrets as environment variables without exposing them in your shell history:
> **Note**: Output sanitization uses exact string matching. Encoded secrets (Base64, hex) or partial matches are not detected.
Export Secrets
Export secrets for use with Docker, CI/CD, or other tools:
Import Secrets
Import secrets from existing .env or JSON files:
Generate Passwords
Create secure random passwords:
Backup and Restore
Create encrypted backups and restore your vault:
> **Security**: Backups are encrypted with AES-256-GCM using a fresh salt. The HMAC-SHA256 integrity check detects any tampering.