
Security proxy for AI agents. Scans every message for prompt injection, PII, and secrets. Defense-in-depth: Go proxy + iptables firewall + eBPF kernel monitor. YAML policy engine, audit logging, 5 AI agents with RAG knowledge bases.
Security proxy for AI agents. Sits in front of OpenClaw and scans every message for prompt injection, PII leaks, and secrets — before they reach the model or leave the network.
Ships with 5 specialized AI agents, a built-in dashboard, and a YAML policy engine. One command to start.
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ Browser │────▶│ ClawShield │────▶│ OpenClaw │
│ (you) │◀────│ Security Proxy │◀────│ Gateway │
└──────────────┘ └──────────────────┘ └──────────────┘
▪ Prompt injection ▪ Claude, GPT,
detection LM Studio
▪ PII/secrets redaction ▪ Multi-agent
▪ Policy enforcement routing
▪ Audit logging ▪ RAG knowledge
Prerequisites: Docker and an Anthropic API key.
# 1. Clone the repo
git clone https://github.com/SleuthCo/clawshield-public.git
cd clawshield-public
# 2. Set your API key
cp standalone/.env.template standalone/.env
# Edit standalone/.env and paste your Anthropic API key
# 3. Start
cd standalone
docker compose up -d
Open http://localhost:18801 in your browser. You'll see the ClawShield dashboard with 5 AI agents ready to chat.
That's it. ClawShield is scanning all traffic between you and the agents.
ClawShield uses Claude (via Anthropic's API) as the default language model. Here's how to get your key:
sk-ant-standalone/.env file:
ANTHROPIC_API_KEY=sk-ant-your-key-here
Cost: Anthropic charges per token. A typical chat session costs a few cents. New accounts get $5 in free credits. See anthropic.com/pricing for details.
Using a different model? ClawShield works with any OpenAI-compatible API (GPT, LM Studio, Ollama, etc.). Edit standalone/config/openclaw.json to point at your preferred provider.
Everything runs in a single container — ClawShield proxy + OpenClaw gateway + 5 agents.
See Quickstart above.
Download the latest release from GitHub Releases:
Then run the interactive setup wizard:
# Download the setup wizard too
chmod +x clawshield-setup-*
# Run the wizard — it walks you through everything
./clawshield-setup-linux-amd64
The wizard will:
Requires Go 1.24+.
git clone https://github.com/SleuthCo/clawshield-public.git
cd clawshield-public
# Build the proxy
cd proxy/cmd/clawshield-proxy
go build -o clawshield-proxy
# Build the setup wizard
cd ../../clawshield-setup
go build -o clawshield-setup
# Run setup
./clawshield-setup
ClawShield exposes a Prometheus-compatible /metrics endpoint for real-time monitoring:
curl http://localhost:18789/metrics
Key metrics:
clawshield_requests_total — Total requests evaluatedclawshield_decisions_allowed_total / _denied_total / _redacted_total — Decision outcomesclawshield_scanner_detections_total{scanner,action} — Detections by scanner typeclawshield_evaluation_duration_seconds — Evaluation latency histogramclawshield_active_connections — Current WebSocket connectionsclawshield_crosslayer_events_* — Cross-layer event bus activityThe core of ClawShield. An HTTP reverse proxy that intercepts all traffic between users and the AI gateway.
Scanners (each produces structured forensic audit records with rule IDs and redacted match excerpts):
Production Hardening (Layer 3):
/proc polling when eBPF is unavailable (no CAP_BPF, old kernel, containers)Policy Hot-Reload:
policy.yaml and changes take effect within 5 seconds, no restart neededStreaming Response Scanning:
Policy engine — YAML-based, deny-by-default:
default_action: deny
scanners:
prompt_injection:
enabled: true
action: block
pii:
enabled: true
action: redact
secrets:
enabled: true
action: block
domain_allowlist:
- "api.anthropic.com"
- "api.openai.com"
See policy/examples/ for more examples.
Each agent has a specialized role and its own RAG knowledge base:
Every request and response is logged to a local SQLite database with:
clawshield-audit --db /var/lib/clawshield/audit.db --last 50
clawshield-audit --db /var/lib/clawshield/audit.db --blocked-only
clawshield-audit --db /var/lib/clawshield/audit.db --scanner injection
clawshield-audit --db /var/lib/clawshield/audit.db --rule-id sqli
See docs/audit-log-format.md for the full schema and Decision Explainability for forensic query details.
SIEM Integration:
iptables-based egress firewall that restricts which domains/IPs agents can reach:
cd firewall/cmd/clawshield-fw && go build -o clawshield-fw
sudo ./clawshield-fw apply --config firewall/examples/firewall.yaml
Kernel-level syscall monitoring for detecting suspicious agent behavior:
sudo python3 ebpf/cmd/clawshield-ebpf/main.py --config ebpf/config/default.yaml
Detects: fork bombs, sensitive file access, privilege escalation, anomalous network connections.
ClawShield uses defense-in-depth — three security layers connected by a cross-layer event bus:
Layer 1: Application (ClawShield Proxy)
▪ Scans message content
▪ Enforces YAML policies
▪ Logs all decisions
Layer 2: Network (ClawShield Firewall)
▪ iptables egress rules
▪ Domain/IP allowlist
▪ Blocks unapproved connections
▪ Dynamic temporary rules from cross-layer events
Layer 3: Kernel (ClawShield eBPF)
▪ Syscall monitoring
▪ Behavioral anomaly detection
▪ Real-time alerts
Each layer works independently. If one is bypassed, the others still protect.
The three layers communicate via a Unix socket-based event bus, enabling adaptive security responses across layers:
┌──────────────┐ ┌──────────────┐
│ eBPF │──── Unix Socket ────────▶│ Proxy │
│ (Layer 3) │ /tmp/clawshield- │ (Layer 1) │
│ Produces: │ events.sock │ Produces: │
│ • privesc │ │ • injection │
│ • port_scan │◀── Adaptive Controller ──│ • malware │
│ • file_access│ │ • vuln_scan │
└──────────────┘ └──────────────┘
│
▼
┌──────────────┐
│ Firewall │
│ (Layer 2) │
│ Consumes: │
│ • temp block│
│ rules │
└──────────────┘
Example adaptive reactions:
| Trigger | Automatic Response |
|---|---|
| eBPF detects privilege escalation |
Enable cross-layer integration by adding an adaptive section to your policy YAML. See policy/examples/adaptive_crosslayer.yaml for a complete example.
For deploying on a real server with TLS, see docs/install-guide.md.
The deploy/ directory contains:
cloud-init.yaml — Hardened VM provisioning (SSH lockdown, fail2ban, nftables, auditd)docker-compose.yml — Full production stack with nginx TLS terminationnginx/conf.d/ — Production nginx configs with rate limiting, security headers, WebSocket proxydeploy.sh — Automated deployment scriptsmoke-test.sh — Post-deployment verification| File | Purpose |
|---|---|
standalone/config/openclaw.json | OpenClaw gateway config (models, agents, auth) |
standalone/config/policy.yaml | ClawShield security policy |
standalone/agents/*/ | Agent configs and knowledge bases |
# Unit tests
go test ./proxy/...
go test ./firewall/...
# Integration tests
go test ./integration/...
Issues and pull requests welcome at github.com/SleuthCo/clawshield-public.
Apache 2.0
Built on OpenClaw. Inspired by traditional network security architectures applied to AI agent contexts.
| Platform | File |
|---|
| Windows | clawshield-proxy-windows-amd64.exe |
| Linux x64 | clawshield-proxy-linux-amd64 |
| Linux ARM64 | clawshield-proxy-linux-arm64 |
| macOS Apple Silicon | clawshield-proxy-darwin-arm64 |
| macOS Intel | clawshield-proxy-darwin-amd64 |
| Agent | Role | Knowledge |
|---|
| Anvil | Software Development | Languages, architecture, DevOps, testing, secure coding |
| Shield | Security Engineering | NIST, MITRE ATT&CK, OWASP, zero trust, threat modeling |
| Harbor | Cloud Engineering | AWS, Azure, GCP, Kubernetes, IaC, networking |
| Beacon | Communications | Crisis comms, content strategy, executive briefings |
| Lens | Research & Analysis | OSINT, structured analysis, cognitive biases, intelligence |
Proxy elevates injection sensitivity to high for 5 min |
| eBPF detects port scanning | Proxy restricts domain access for 10 min |
| Proxy blocks 3+ injections in 60s | Default action forced to deny for 15 min |
| Proxy detects malware in response | Firewall adds temporary IP block rules |
| Variable | Required | Description |
|---|
ANTHROPIC_API_KEY | Yes | Your Anthropic API key (sk-ant-...) |
GATEWAY_AUTH_TOKEN | No | Shared auth token (auto-generated if omitted) |
CLAWSHIELD_PORT | No | Host port (default: 18801) |
CLAWSHIELD_STUDIO_URL | No | Studio deep-link base URL |