Bagman for Openclaw

Bagman is a secure key management framework for AI agents to handle wallets, API secrets, and private keys safely.

zscole
v2.1.0
Feb 9, 2026
2
2.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install bagman

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install bagman using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Bagman?

Bagman provides an essential security layer for AI agents that require access to sensitive credentials, private keys, or blockchain wallets. By integrating with secret managers like 1Password and implementing ERC-4337 session keys, it ensures that raw private keys never reside in conversation history, memory files, or local environment variables. This skill is critical for developers building autonomous systems that control funds or access high-value APIs using Openclaw Skills.

The framework adopts a defense-in-depth philosophy, providing multiple layers of protection against both accidental leaks and malicious intent. It effectively bridges the gap between agent autonomy and cryptographic security, ensuring that agents can perform financial or administrative tasks without exposing the master credentials of the operator.

Bagman Use Cases

  • Protecting API keys and credentials from prompt injection attacks.
  • Managing blockchain wallets with time-bounded, scoped session keys.
  • Building autonomous agents that can securely control funds within predefined limits.
  • Preventing accidental leakage of secrets in agent responses via automated sanitization.
  • Enforcing human-in-the-loop confirmation for high-value operations.

How Bagman Works

  1. The agent retrieves required credentials at runtime from a secure vault (like 1Password) rather than reading from disk.
  2. Input validation layers scan user prompts for injection, extraction, or role manipulation attempts before any tools are called.
  3. All operations are filtered through an allowlist that defines maximum values, cooldowns, and required confirmations.
  4. For blockchain tasks, session keys provide granular, time-limited permissions, restricting the agent to specific contracts and methods.
  5. Output sanitization filters all agent responses through regex patterns to redact any accidental mentions of keys or tokens.
  6. A pre-commit hook provides an additional safety net by blocking any commits containing sensitive patterns.

Bagman Setup

Install the 1Password CLI and authenticate to begin securing your Openclaw Skills:

# Install 1Password CLI
brew install 1password-cli

# Authenticate
eval $(op signin)

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

Enable the pre-commit hook to prevent local secret leakage:

cp examples/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commit

Bagman Data Schema & Taxonomy

Bagman organizes security metadata and session configurations to maintain a strict audit trail and clear permission boundaries:

Component Organization Method
Vault ACLs Read-only access for agents in specific vaults; master keys stored in separate, restricted vaults.
Sanitization Patterns A centralized registry of regex patterns for ETH keys, API tokens, BIP-39 seeds, and JWTs.
Session Config Metadata defining ERC-4337 spending limits, daily caps, and contract whitelists.
Confirmation Registry Time-limited SHA-256 codes used to validate high-value operations before execution.

Bagman Advanced Features

  • ERC-4337 Smart Account integration for programmable, on-chain permissions.
  • MetaMask Delegation Framework (EIP-7710) support for robust on-chain enforcement.
  • Multi-layered defense architecture covering inputs, operation allowlisting, and output sanitization.
  • Adversarial test suite designed to simulate prompt injection and secret extraction attacks.
  • Automated session key renewal logic that requests operator approval when credentials expire.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*