$ show SeyZ/clawbands
ClawBands is a security middleware for OpenClaw AI agents that provides runtime interception with human-in-the-loop approval. It hooks into OpenClaw's plugin system to intercept tool executions (file operations, shell commands, network requests) and enforces policy-based decisions before allowing potentially dangerous actions. The system operates in two modes: terminal mode with interactive prompts, and channel mode (WhatsApp/Telegram) using a special response tool. Every decision is logged to an immutable JSON Lines audit trail, and statistics are tracked. The architecture features clean separation of concerns with distinct modules for policy interception, decision arbitration, approval queuing, logging, and storage.
The LLM identified 2 files worth highlighting for reuse:
Implements a sophisticated in-memory approval system for channel-based human-in-the-loop interactions. Handles complex state management with TTL expiration, blanket allows, and retry-as-approval mechanisms. Demonstrates non-obvious skill in managing asynchronous human decisions within synchronous execution flows while maintaining idempotency and preventing race conditions.
Core security policy evaluation engine that cleanly separates policy lookup, decision execution, and logging. Handles all three decision types (ALLOW, DENY, ASK) with proper async/await patterns for human interaction. Shows excellent engineering practices with dependency injection, clear error handling, and separation of concerns that would allow extraction as a reusable policy engine for other systems.