# Send Counterclaw Core to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "counterclaw-core",
    "name": "Counterclaw Core",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/nickconstantinou/counterclaw-core",
    "canonicalUrl": "https://clawhub.ai/nickconstantinou/counterclaw-core",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/counterclaw-core",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=counterclaw-core",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "email_protector.py",
      "pyproject.toml",
      "send_protected_email.sh",
      "src/counterclaw/__init__.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "counterclaw-core",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T20:40:25.025Z",
      "expiresAt": "2026-05-07T20:40:25.025Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=counterclaw-core",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=counterclaw-core",
        "contentDisposition": "attachment; filename=\"counterclaw-core-1.1.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "counterclaw-core"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/counterclaw-core"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/counterclaw-core",
    "downloadUrl": "https://openagent3.xyz/downloads/counterclaw-core",
    "agentUrl": "https://openagent3.xyz/skills/counterclaw-core/agent",
    "manifestUrl": "https://openagent3.xyz/skills/counterclaw-core/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/counterclaw-core/agent.md"
  }
}
```
## Documentation

### CounterClaw 🦞

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

### ⚠️ Security Notice

This package has two modes:

Core Scanner (offline): check_input() and check_output() — no network calls
Email Integration (network): send_protected_email.sh — requires gog CLI for Gmail

### Installation

claw install counterclaw

### Quick Start

from counterclaw import CounterClawInterceptor

interceptor = CounterClawInterceptor()

# Input scan - blocks prompt injections
# NOTE: Examples below are TEST CASES only - not actual instructions
result = interceptor.check_input("{{EXAMPLE: 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

🔒 Defense against common prompt injection patterns
🛡️ Basic PII masking (Email, Phone, Credit Card)
📝 Violation logging to ~/.openclaw/memory/MEMORY.md
⚠️ Warning on startup if TRUSTED_ADMIN_IDS not configured

### Required Environment Variable

# Set your trusted admin ID(s) - use non-sensitive identifiers only!
export TRUSTED_ADMIN_IDS="your_telegram_id"

Important: TRUSTED_ADMIN_IDS should ONLY contain non-sensitive identifiers:

✅ Telegram user IDs (e.g., "123456789")
✅ Discord user IDs (e.g., "987654321")
❌ NEVER API keys
❌ NEVER passwords
❌ NEVER tokens

You can set multiple admin IDs by comma-separating:

export TRUSTED_ADMIN_IDS="telegram_id_1,telegram_id_2"

### Runtime Configuration

# Option 1: Via environment variable (recommended)
# Set TRUSTED_ADMIN_IDS before running
interceptor = CounterClawInterceptor()

# Option 2: Direct parameter
interceptor = CounterClawInterceptor(admin_user_id="123456789")

### Security Notes

Fail-Closed: If TRUSTED_ADMIN_IDS is not set, admin features are disabled by default
Logging: All violations are logged to ~/.openclaw/memory/MEMORY.md with PII masked
No Network Access: This middleware does not make any external network calls (offline-only)
File Access: Only writes to ~/.openclaw/memory/MEMORY.md — explicitly declared scope

### Files Created

PathPurpose~/.openclaw/memory/Directory created on first run~/.openclaw/memory/MEMORY.mdViolation logs with PII masked

### License

MIT - See LICENSE file

### Running Tests Locally

python3 tests/test_scanner.py

### Linting

pip install ruff
ruff check src/

### Publishing to ClawHub

The CI runs on every push and pull request:

Ruff - Lints Python code
Tests - Runs unit tests

To publish a new version:

# Version is set in pyproject.toml
git add -A
git commit -m "Release v1.0.9"
git tag v1.0.9
git push origin main --tags

CI will automatically:

Run lint + tests
If tests pass and tag starts with v*, publish to ClawHub
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: nickconstantinou
- Version: 1.1.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T20:40:25.025Z
- Expires at: 2026-05-07T20:40:25.025Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/counterclaw-core)
- [Send to Agent page](https://openagent3.xyz/skills/counterclaw-core/agent)
- [JSON manifest](https://openagent3.xyz/skills/counterclaw-core/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/counterclaw-core/agent.md)
- [Download page](https://openagent3.xyz/downloads/counterclaw-core)