Bagman Skill
Description
Secure key management patterns for AI agents - storage, session keys, leak prevention, prompt injection defense
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Bagman
Secure key management patterns for AI agents handling wallets, private keys, and secrets.
**Bagman** solves the three critical problems of agentic key management:
- Key Loss — Agents forget credentials between sessions
- Accidental Exposure — Keys leaked to GitHub, logs, or outputs
- Prompt Injection — Malicious prompts extracting secrets
Quick Start
Choose Your Backend
Bagman supports multiple secret storage backends. **No 1Password required.**
| Backend | Setup | Best For |
|---|---|---|
| macOS Keychain | None (native) | macOS users, zero setup |
| 1Password CLI | brew install 1password-cli |
Teams, rich metadata |
| Encrypted File | brew install age |
Portable, git-friendly |
| Environment Vars | None | CI/CD, containers |
Bagman auto-detects the best available backend.
Install
# Clone
git clone https://github.com/zscole/bagman-skill.git
cd bagman-skill
# Optional: Install backend dependencies
brew install age # For encrypted file backend
brew install 1password-cli # For 1Password backend
Usage
from examples.secret_manager import get_secret, get_session_key
# Auto-detects backend
api_key = get_secret("openai-key")
# With session metadata
creds = get_session_key("trading-bot")
if creds.is_expired():
raise ValueError("Session expired")
print(f"Backend: {creds.backend}")
print(f"Expires: {creds.time_remaining()}")
Force Specific Backend
from examples.backends import get_backend
# Force macOS Keychain
backend = get_backend("keychain")
# Force 1Password
backend = get_backend("1password", vault="My-Vault")
# Force encrypted file
backend = get_backend("encrypted_file", path="~/.secrets.age")
# Force environment variables
backend = get_backend("env")
Or via environment variable:
export BAGMAN_BACKEND=keychain
Backends
macOS Keychain (Default on macOS)
Zero setup required. Uses native `
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI Headroom
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agen
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI