CounterClaw for Openclaw

CounterClaw is a production-grade defensive interceptor designed to protect AI agents from malicious prompt injections and sensitive data leaks.

nickconstantinou
v1.0.0
Feb 20, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install counterclaw

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 counterclaw 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 CounterClaw?

CounterClaw serves as a critical security layer for modern AI implementations. It acts as a defensive gatekeeper that proactively scans incoming user prompts for malicious injection patterns and monitors outgoing responses for sensitive personally identifiable information (PII). By utilizing this solution from the Openclaw Skills ecosystem, developers can ensure their agents operate within safe parameters, preventing unauthorized instruction overrides and accidental data exposure.

The skill is built for resilience, offering a snap-shut defense mechanism that identifies over 20 distinct prompt injection techniques. Whether you are building a customer-facing chatbot or an internal automation tool, CounterClaw provides the necessary guardrails to maintain system integrity and compliance without adding significant latency to your workflows.

CounterClaw Use Cases

  • Preventing prompt injection attacks where users attempt to bypass or override core system instructions.
  • Automating the detection and redaction of PII like emails, phone numbers, and credit cards in AI-generated responses.
  • Restricting administrative commands to verified users through secure environment configuration.
  • Creating automated audit trails by logging all security violations to local memory files.

How CounterClaw Works

  1. The interceptor initializes and loads pre-defined security patterns along with environment-specific admin IDs.
  2. Incoming user input is passed through the check_input method to identify potential prompt injection threats.
  3. If a threat is detected, the skill returns a blocked status, allowing the application to halt the request before it reaches the LLM.
  4. Outgoing LLM responses are processed via the check_output method to scan for leaked PII.
  5. Any detected security violations or data leaks are automatically recorded in the system logs for administrative review.

CounterClaw Setup

To begin securing your agent, install the skill using the following command:

claw install counterclaw

Next, configure your trusted administrator IDs by setting the required environment variable:

export TRUSTED_ADMIN_IDS="your_admin_id_here"

You can then integrate the interceptor directly into your Python application to start scanning inputs and outputs.

CounterClaw Data Schema & Taxonomy

CounterClaw returns structured JSON objects for every scan and maintains a persistent log of security events.

Attribute Type Description
blocked Boolean True if a prompt injection or security threat is detected.
safe Boolean Indicates if the content passed all security checks.
pii_detected Object A dictionary identifying specific PII types found (e.g., email: True).
MEMORY.md File The default location where security violations are logged for audit.

CounterClaw Advanced Features

  • Snap-Shut Defense: Real-time blocking of 20+ advanced prompt injection patterns used to manipulate LLMs.
  • Admin-Locked Configuration: Use the !claw-lock feature to ensure security settings are only modified by trusted administrators.
  • Enterprise-Ready Hooks: Includes opt-in dormant hooks for Nexus integration, facilitating enterprise-scale security management.
  • Integrated Memory Logging: Automatically syncs security events into the Openclaw Skills memory framework for long-term tracking.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*