zscole

Bagman Skill — AI skill for Claude Code

AI community

Secure key management patterns for AI agents - storage, session keys, leak prevention, prompt injection defense.

How to install Bagman Skill

This entry records only its repository, not the path inside it, so there is no exact command to give. Open zscole/bagman-skill and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Bagman Skill does

Secure key management patterns for AI agents - storage, session keys, leak prevention, prompt injection defense.

Alternatives in AI

  • Hol Guard — Open-source antivirus for AI agents: block risky tools, secret access, prompt injection, malicious packages, M 485 ★
  • Prismor — Self-hosted runtime control plane for AI agents 334 ★
  • AI Claude Start — Multi-profile Claude Code launcher with secure credential management 219 ★

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:

  1. Key Loss — Agents forget credentials between sessions
  2. Accidental Exposure — Keys leaked to GitHub, logs, or outputs
  3. 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 `