# Counterclaw

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

- Skill: `johnalbertini14-glitch/counterclaw-2` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add johnalbertini14-glitch/counterclaw-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/johnalbertini14-glitch/counterclaw-2/raw
- Safety review: pending (external: skill-scanner WARNING, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: johnalbertini14-glitch (https://skillmd.com/u/johnalbertini14-glitch)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/johnalbertini14-glitch/counterclaw-2

---


# CounterClaw 🦞

> Defensive security for AI agents. Snaps shut on malicious payloads.

## Installation

```bash
claw install counterclaw
```

## Quick Start

```python
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)
```python
interceptor = CounterClawInterceptor(
    admin_user_id="telegram_user_id"  # Set TRUSTED_ADMIN_IDS env
)
```

## License

MIT - See LICENSE file

