agent-safety
自主人工智能代理的出站安全——在输出离开机器之前对其进行扫描。 Git 预提交挂钩会自动阻止包含 API 密钥、令牌、PII 或机密的提交。与入站扫描仪(Skillvet、IronClaw)不同,这可以防止您意外发布的内容。在提交到 git 存储库、发布到 GitHub 或运行定期系统运行状况检查时使用。在 git 级别自动执行——而不是提示。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~compass-soul-agent-safetycURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~compass-soul-agent-safety/file -o compass-soul-agent-safety.md# Agent Safety Automated safety tools for autonomous AI agents. The principle: **don't rely on prompts for safety — automate enforcement.** All scripts are in this skill's `scripts/` directory. When OpenClaw loads this skill, resolve paths relative to this file's location. ## Pre-Publish Security Scan Scans files for secrets, PII, and internal paths before publishing. ```bash bash scripts/pre-publish-scan.sh <file-or-directory> ``` **Detects:** - API keys (AWS, GitHub, Anthropic, OpenAI, generic patterns) - Private keys (PEM blocks), Bearer tokens, hardcoded passwords - Email addresses, phone numbers, SSNs, credit card patterns - Physical addresses, name fields - Home directory paths, internal config paths **Exit 0** = clean. **Exit 1** = blocking issues found, do not publish. ## Git Pre-Commit Hook Install once per repo. Automatically scans staged files on every commit: ```bash bash scripts/install-hook.sh <repo-path> ``` - Scans staged content (what's being committed, not working tree) - Blocks commit if secrets or SSNs found - Flags PII for review - Only bypassed with explicit `git commit --no-verify` **Install this on every repo you work with.** It's the real guardrail. ## Health Check System monitoring for disk, workspace, security, and updates: ```bash bash scripts/health-check.sh ``` **Checks:** Disk usage, workspace size, memory file growth, OpenClaw version, macOS updates, firewall status, SIP status. Run periodically (every few heartbeats). Watch for warnings. ## Rules 1. Run pre-publish scan before ANY external publish action 2. Install pre-commit hook on EVERY repo you work with 3. Blocking issues (secrets, SSNs) must be fixed — no override 4. Review items (emails, paths) need human judgment 5. If a secret was ever committed, it's compromised — rotate immediately --- ## 中文说明 # Agent Safety 面向自主 AI 代理的自动化安全工具。核心原则:**不要依赖提示词来保障安全——把强制执行自动化。** 所有脚本都位于本技能的 `scripts/` 目录中。当 OpenClaw 加载该技能时,请相对于本文件所在位置解析路径。 ## 发布前安全扫描 在发布前扫描文件中的密钥、PII 和内部路径。 ```bash bash scripts/pre-publish-scan.sh <file-or-directory> ``` **检测内容:** - API 密钥(AWS、GitHub、Anthropic、OpenAI 以及通用模式) - 私钥(PEM 块)、Bearer 令牌、硬编码密码 - 电子邮件地址、电话号码、社会安全号码(SSN)、信用卡模式 - 实际地址、姓名字段 - 主目录路径、内部配置路径 **Exit 0** = 干净。**Exit 1** = 发现阻断性问题,请勿发布。 ## Git 预提交挂钩 每个仓库安装一次。在每次提交时自动扫描暂存文件: ```bash bash scripts/install-hook.sh <repo-path> ``` - 扫描暂存内容(即将被提交的内容,而非工作树) - 若发现密钥或 SSN 则阻止提交 - 标记 PII 以供审查 - 仅在显式使用 `git commit --no-verify` 时绕过 **请在你接触的每一个仓库上都安装它。** 它才是真正的防护栏。 ## 健康检查 针对磁盘、工作区、安全性和更新的系统监控: ```bash bash scripts/health-check.sh ``` **检查项:** 磁盘占用、工作区大小、记忆文件增长、OpenClaw 版本、macOS 更新、防火墙状态、SIP 状态。 定期运行(每隔几次心跳)。留意警告。 ## 规则 1. 在执行任何对外发布操作前运行发布前扫描 2. 在你接触的每一个仓库上安装预提交挂钩 3. 阻断性问题(密钥、SSN)必须修复——不可覆盖 4. 需审查的条目(电子邮件、路径)需要人工判断 5. 一旦某个密钥曾被提交,就视为已泄露——立即轮换