arc-shield
БесплатноЗапускает вложенные скриптыНе проверенOutput sanitization for agent responses - prevents accidental secret leaks
от modbender★ 21 звезда на GitHubОб этом скилле
arc-shield
Output sanitization for agent responses. Scans ALL outbound messages for leaked secrets, tokens, keys, passwords, and PII before they leave the agent.
⚠️ This is NOT an input scanner — clawdefender already handles that. This is an OUTPUT filter for catching things your agent accidentally includes in its own responses.
Why You Need This
Agents have access to sensitive data: 1Password vaults, environment variables, config files, wallet keys. Sometimes they accidentally include these in responses when:
- Debugging and showing full command output
- Copying file contents that contain secrets
- Generating code examples with real credentials
- Summarizing logs that include tokens
Arc-shield catches these leaks before they reach Discord, Signal, X, or any external channel.
What It Detects
🔴 CRITICAL (blocks in --strict mode)
- API Keys & Tokens: 1Password (
ops_*), GitHub (ghp_*), OpenAI (sk-*), Stripe, AWS, Bearer tokens - Passwords: Assignments like
password=...orpasswd: ... - Private Keys: Ethereum (0x + 64 hex), SSH keys, PGP blocks
- Wallet Mnemonics: 12/24 word recovery phrases
- PII: Social Security Numbers, credit card numbers
- Platform Tokens: Slack, Telegram, Discord
🟠 HIGH (warns loudly)
- High-entropy strings: Shannon entropy > 4.5 for strings > 16 chars (catches novel secret patterns)
- Credit cards: 16-digit card numbers
- Base64 credentials: Long base64 strings that look like tokens
🟡 WARN (informational)
- Secret file paths:
~/.secrets/*, paths containing "password", "token", "key" - Environment variables:
ENV_VAR=secret_valueexports - Database URLs: Connection strings with credentials
Installation
cd ~/.openclaw/workspace/skills
git clone <arc-shield-repo> arc-shield
chmod +x arc-shield/scripts/*.sh arc-shield/scripts/*.py
Or download as a skill bundle.
Usage
Command-line
# Scan agent output before sending
agent-response.txt | arc-shield.sh
# Block if critical secrets found (use before external messaging)
echo "Message text" | arc-shield.sh --strict || echo "BLOCKED"
# Redact secrets and return sanitized text
cat response.txt | arc-shield.sh --redact
# Full report
arc-shield.sh --report < conversation.log
# Python version with entropy detection
cat message.txt | output-guard.py --strict
Integration with OpenClaw Agents
Pre-send hook (recommended)
Add to your messaging skill or wrapper:
#!/bin/bash
# send-message.sh wrapper
MESSAGE="$1"
CHANNEL="$2"
# Sanitize output
SANITIZED=$(echo "$MESSAGE" | arc-shield.sh --strict --redact)
EXIT_CODE=$?
if $EXIT_CODE -eq 1; then
echo "ERROR: Message contains critical secrets and was blocked." >&2
exit 1
fi
# Send sanitized message
openclaw message send --channel "$CHANNEL" "$SANITIZED"
Manual pipe
Before any external message:
# Generate response
RESPONSE=$(agent-generate-response)
# Sanitize
CLEAN=$(echo "$RESPONSE" | arc-shield.sh --redact)
# Send
signal send "$CLEAN"
Testing
cd skills/arc-shield/tests
./run-tests.sh
Includes test cases for:
- Real leaked patterns (1Password tokens, Instagram passwords, wallet mnemonics)
- False positive prevention (normal URLs, email addresses, file paths)
- Redaction accuracy
- Strict mode blocking
Configuration
Patterns are defined in config/patterns.conf:
CRITICAL|GitHub PAT|ghp_[a-zA-Z0-9]{36,}
CRITICAL|OpenAI Key|sk-[a-zA-Z0-9]{20,}
WARN|Secret Path|~\/\.secrets\/[^\s]*
Edit to add custom patterns or adjust severity levels.
Modes
| Mode | Behavior | Exit Code | Use Case |
|---|---|---|---|
| Default | Pass through + warnings to stderr | 0 | Development, logging |
--strict |
Block on CRITICAL findings | 1 if critical | Production outbound messages |
--redact |
Replace secrets with [REDACTED:TYPE] |
0 | Safe logging, auditing |
--report |
Analysis only, no pass-through | 0 | Auditing conversations |
Entropy Detection
The Python version (output-guard.py) includes Shannon entropy analysis to catch secrets that don't match regex patterns:
# Detects high-entropy strings like:
kJ8nM2pQ5rT9vWxY3zA6bC4dE7fG1hI0 # Novel API key format
Zm9vOmJhcg== # Base64 credentials
Threshold: 4.5 bits (configurable with --entropy-threshold)
Performance
- Bash version: ~10ms for typical message (< 1KB)
- Python version: ~50ms with entropy analysis
- Zero external dependencies: bash + Python stdlib only
Fast enough to run on every outbound message without noticeable delay.
Real-World Catches
From our own agent sessions:
# 1Password token
"ops_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
# I
Установить arc-shield в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл arc-shield?
Output sanitization for agent responses - prevents accidental secret leaks
Как установить скилл arc-shield?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл arc-shield запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic