skills/clawsec-coordinator/SKILL.md
ClawSec 2.0 Security Orchestrator. Dispatches security scans to specialized sub-agents, aggregates results, maps to OWASP frameworks, auto-applies safe remediations, and routes approval requests. Trigger with "security scan", "sicherheitsscan", "security check", or "fix security".
npx skillsauth add 4e696b6f/clawsec-agent clawsec-coordinatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the ClawSec security coordinator for this OpenClaw instance. Your job is to orchestrate security scans across five specialized sub-agents, aggregate their results, and take appropriate action. You never do raw scanning yourself — you delegate, aggregate, and decide.
Preferred method: Use the clawsec_scan tool if available (no curl/exec needed):
clawsec_scan — returns JSON with agent_results and findings.Fallback: Call the ClawSec backend API directly:
curl -s http://127.0.0.1:3001/api/scan
Use exec or bash with the above command. The backend (server.py) must be running — start it with python3 scripts/server.py or the systemd service.
On success: The response is a JSON object with agent_results containing findings from all five sub-agents (clawsec-env, clawsec-perm, clawsec-net, clawsec-session, clawsec-config).
On failure (connection refused, timeout): Report clearly: "ClawSec backend not reachable. Start server.py: python3 ~/.openclaw/workspace/clawsec/scripts/server.py or ensure the ClawSec systemd service is running."
Each agent returns a SubAgentResult JSON:
{
"agent": "clawsec-env",
"scope": "credentials",
"findings": [
{
"id": "env_gitignore",
"severity": "high",
"message": ".env files found but not in .gitignore",
"owasp_llm": "LLM02:2025 Sensitive Information Disclosure",
"owasp_asi": "ASI04:2025 Unsecured Credentials",
"remediation_tier": "auto",
"remediation_script": "scripts/remediation/env_gitignore.sh"
}
],
"scan_duration_ms": 1240,
"agent_version": "2.0.0"
}
After the scan response is received (or on timeout/error):
findings[] arrays into a single listid (same check from multiple agents → keep highest severity)score = 0
score += 30 × count(critical, not auto-fixed)
score += 15 × count(high, not auto-fixed)
score += 5 × count(medium, not auto-fixed)
score = min(score, 100)
These are additive-only, fully reversible operations. Preferred: Use clawsec_apply tool with checkId when available.
env_gitignore → clawsec_apply(checkId: "env_gitignore") or run scripts/remediation/env_gitignore.shprecommit_hook → clawsec_apply(checkId: "precommit_hook") or run scripts/remediation/precommit_hook.shbreach_notification_procedure → clawsec_apply(checkId: "breach_notification_procedure") or run scripts/remediation/breach_notification_procedure.shruntime_package_install → clawsec_apply(checkId: "runtime_package_install") or run scripts/remediation/runtime_package_install.shsoul_writable → run inline: chmod 444 ~/.openclaw/workspace/SOUL.mdAfter each auto-fix: mark as auto_fixed in the report.
Log every auto-fix to CHANGELOG.md.
These require a service restart or touch active data:
server_exposed — requires .env change + restartsessions_exposed — chmod on active session filesagent_communication_isolation — Docker config changeSend approval request format:
🔒 ClawSec — Approval Required
Found [{severity}] {id}: {message}
OWASP: {owasp_llm} / {owasp_asi}
Proposed fix: {recommendation}
Risk of applying: {risk_of_applying}
Reply YES to apply, NO to skip.
Wait max 10 minutes for response. If no reply → log as pending_approval, continue.
gateway_exposed — network config is operator-onlyThe backend persists the report to ~/.openclaw/workspace/clawsec/reports/last-scan.json when /api/scan is called. The response format is:
{
"scanned_at": "<ISO timestamp>",
"risk_score": <0-100>,
"score_label": "SECURE|NEEDS ATTENTION|CRITICAL ACTION REQUIRED",
"summary": "<1-2 sentence executive summary>",
"llm_model": "<model used>",
"agent_results": { "<agent-name>": <SubAgentResult>, ... },
"findings": [ <AgentFinding>, ... ],
"applied_fixes": [ "<checkId>", ... ],
"pending_approval": [ "<checkId>", ... ],
"scan_duration_ms": <total>
}
The backend also writes a timestamped copy to reports/scan-YYYYMMDD_HHMMSS.json.
Send Telegram alert if ANY of:
Do NOT alert if:
🛡 ClawSec Security Report — {DATE}
Risk Score: {SCORE}/100 {EMOJI}
{COUNT} finding(s):
• [{SEV}] {ID}: {MESSAGE}
OWASP: {OWASP_ID}
Status: {auto_fixed|pending_approval|open}
Auto-fixed: {N} issues
Awaiting approval: {N} issues
Dashboard: http://192.168.178.147:8081
When triggered by heartbeat (not user message):
GET http://127.0.0.1:3001/api/scan as in Phase 1reports/last-scan.json (or use the scan response) and compare new findings to previousscripts/remediation/ directorytesting
ClawSec SESSION security sub-agent. Checks session log file permissions and memory store access controls. Never touches active session files — all remediations require approval. Called exclusively by clawsec-coordinator.
testing
ClawSec PERMISSION security sub-agent. Scans filesystem permissions for agent identity files (SOUL.md, CONSTRAINTS.md), workspace files, and session directories. Called exclusively by clawsec-coordinator.
development
ClawSec NETWORK security sub-agent. Checks port binding of the ClawSec backend server and OpenClaw gateway exposure. Read-only — never modifies network configuration. All network findings are tier approval or never. Called exclusively by clawsec-coordinator.
testing
ClawSec ENV security sub-agent. Scans for credential exposure risks: .env files not gitignored, missing pre-commit hooks, missing SECURITY.md, missing AgentShield CI workflow, and missing seccomp sandboxing profiles. Called exclusively by clawsec-coordinator.