ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

bagman

Secure key management for AI agents. Use when handling private keys, API secrets, wallet credentials, or when building systems that need agent-controlled funds. Covers secure storage, session keys, leak prevention, prompt injection defense, and MetaMask Delegation Framework integration.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/zscole/bagman
Or

Bagman

Secure key management patterns for AI agents handling wallets, private keys, and secrets.

When to Use This Skill

  • Agent needs wallet/blockchain access
  • Handling API keys, credentials, or secrets
  • Building systems where AI controls funds
  • Preventing secret leakage via prompts or outputs

Quick Start

# Install 1Password CLI
brew install 1password-cli

# Authenticate
eval $(op signin)

# Create vault for agent credentials
op vault create "Agent-Credentials"

# Run examples
cd examples && python test_suite.py

Core Rules

RuleWhy
Never store raw private keysConfig, env, memory, or conversation = leaked
Use delegated accessSession keys with time/value/scope limits
Secrets via secret manager1Password, Vault, AWS Secrets Manager
Sanitize all outputsScan for key patterns before any response
Validate all inputsCheck for injection attempts before wallet ops

Architecture

┌─────────────────────────────────────────────────────┐
│                   AI Agent                          │
├─────────────────────────────────────────────────────┤
│  Session Key (bounded)                              │
│  ├─ Expires after N hours                           │
│  ├─ Max spend per tx/day                            │
│  └─ Whitelist of allowed contracts/methods          │
├─────────────────────────────────────────────────────┤
│  Secret Manager (1Password/Vault)                   │
│  ├─ Retrieve at runtime only                        │
│  ├─ Never persist to disk                           │
│  └─ Audit trail of accesses                         │
├─────────────────────────────────────────────────────┤
│  Smart Account (ERC-4337)                           │
│  ├─ Programmable permissions                        │
│  └─ Recovery without key exposure                   │
└─────────────────────────────────────────────────────┘

Implementation Files

FilePurpose
examples/secret_manager.py1Password integration for runtime secret retrieval
examples/sanitizer.pyOutput sanitization (keys, seeds, tokens)
examples/validator.pyInput validation (prompt injection defense)
examples/session_keys.pyERC-4337 session key configuration
examples/delegation_integration.tsMetaMask Delegation Framework (EIP-7710)
examples/pre-commitGit hook to block secret commits
examples/test_suite.pyAdversarial test suite
docs/prompt-injection.mdDeep dive on injection defense
docs/secure-storage.mdSecret storage patterns
docs/session-keys.mdSession key architecture
docs/leak-prevention.mdOutput sanitization patterns
docs/delegation-framework.mdOn-chain permission enforcement (EIP-7710)

1. Secret Retrieval

1Password CLI Pattern

# Retrieve at runtime (never store result)
SESSION_KEY=$(op read "op://Agents/my-agent/session-key")

Metadata

Author@zscole
Stars879
Views0
Updated2026-02-11
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-zscole-bagman": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.