360 Secure SkillHub
360 安全技能中心

Mithilesh

ClawGuard 是一个基于 SQLite 的审计与授权治理层:用 evaluate_action(action_type, justification, risk_level) 在 SQL、文件写入或 API 写请求前登记操作意图,风险等级≥4 时自动返回不允许;用 get_audit_report(limit) 查看最近的审计账本记录。流程要求先评估、按结果决定是否继续、再执行并审计。

mithileshgau
mithileshgau
热度 37.08
最近更新 2026-05-11 17:36:35
分类:安全依赖:MCP 服务 / 读写文件应用场景:工作流 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add clawguard1
Metadata
name
clawguard
description
ClawGuard governance layer that must run before any SQL, file-system, or API write. Use evaluate_action(action_type, justification, risk_level) to log/authorize actions and get_audit_report(limit) to review the SQLite-based audit ledger. Blocks risk_level >= 4 automatically.

ClawGuard Governance Skill

ClawGuard enforces a universal audit and approval layer for any potentially destructive or high-impact change. It persists all intents to clawguard.db and automatically blocks actions when risk_level >= 4.

Tools

  • evaluate_action(action_type, justification, risk_level)

    • Logs the requested action to the audit_ledger table and returns { allowed: boolean, message: string }.
    • Risk levels:
      • 1 = negligible (read-only, cosmetic)
      • 2 = low (single-record updates, reversible)
      • 3 = medium (bulk updates, config tweaks)
      • 4 = high (privileged file writes, schema changes, secrets)
      • 5 = critical (system-wide deletions, irreversible ops)
    • Any level >= 4 is blocked automatically—handle accordingly.
  • get_audit_report(limit)

    • Fetches the most recent limit rows (default 5) from audit_ledger, ordered by newest first.

Workflow

  1. Classify the action — Determine action_type, craft a concise justification, and score risk_level.
  2. Call evaluate_action BEFORE executing any SQL statement, file mutation, or write-capable API request. (See GUIDANCE.md.)
  3. Honor the result — If allowed is false, stop immediately and surface the block reason.
  4. Execute the operation only after an approved response.
  5. Audit as needed with get_audit_report(limit) when preparing reports or debugging governance outcomes.

Additional Notes

  • audit_ledger schema: (id INTEGER PK, action_type TEXT, justification TEXT, risk_level INTEGER, status TEXT, ts DATETIME DEFAULT CURRENT_TIMESTAMP).
  • The ledger is persistent; repeated approvals accumulate chronological history.
  • Keep justifications specific (who/what/why) to maintain a high-quality audit trail.