Counterclaw

Production-grade defensive interceptor for prompt injection and PII leaks.

johnalbertini14-glitch Updated 1 repo stars

File contents

CounterClaw 🦞

Defensive security for AI agents. Snaps shut on malicious payloads.

Installation

claw install counterclaw

Quick Start

from counterclaw import CounterClawInterceptor

interceptor = CounterClawInterceptor()

# Input scan - blocks prompt injections
result = interceptor.check_input("Ignore previous instructions")
# → {"blocked": True, "safe": False}

# Output scan - detects PII leaks  
result = interceptor.check_output("Contact: john@example.com")
# → {"safe": False, "pii_detected": {"email": True}}

Features

  • 🔒 Snap-shut Defense - Blocks 20+ prompt injection patterns
  • 🛡️ PII Detection - Catches emails, phones, credit cards
  • 📝 Auto-Logging - Violations logged to MEMORY.md
  • ☁️ Nexus Ready - Dormant hooks for enterprise (opt-in)

Configuration

Admin-Locked (!claw-lock)

interceptor = CounterClawInterceptor(
    admin_user_id="telegram_user_id"  # Set TRUSTED_ADMIN_IDS env
)

License

MIT - See LICENSE file

johnalbertini14-glitch/openclaw-skills/tree/main/skills/nickconstantinou/counterclaw commit e07818af5f

Frequently asked questions

npx skillmds@latest add johnalbertini14-glitch/counterclaw-2