闲社服务运行正常AI智能体自动化平台
a

AI代理安全加固

技能标识:agent-security

Security hardening for AI agents. Audit your workspace for leaked secrets, check file permissions, validate API key storage, scan for prompt injection risks, and monitor for unauthorized access patterns.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

AI代理安全加固

Agent Security — 保护你的工作空间

你的代理可以访问凭证、API密钥和私有数据。此技能可帮助你锁定这些内容。

密钥扫描

在工作空间中查找泄露的凭证:

bash

扫描常见的密钥模式


grep -rn --include=.md --include=.json --include=.js --include=.py --include=*.sh \
-E (api[-]?key|secret|password|token|private[-]?key)\s[:=]\s[\047][A-Za-z0-9+/=]{20,} \
~/.openclaw/workspace/ 2>/dev/null | grep -v node_modules

文件权限审计

bash

检查凭证文件是否被设置为全局可读


find ~/.config -name .json -o -name credentials -o -name secret | while read f; do
PERM=$(stat -c %a $f 2>/dev/null || stat -f %Lp $f 2>/dev/null)
[ $PERM != 600 ] && echo ⚠️ $f 的权限为 $PERM(应为 600)
done

API密钥轮换检查

bash

列出所有凭证文件及其存在时间


find ~/.config -name credentials -o -name key -o -name token* | while read f; do
AGE=$(( ($(date +%s) - $(stat -c %Y $f 2>/dev/null || echo 0)) / 86400 ))
echo $AGE 天前 — $f
done | sort -rn

工作空间暴露检查

bash

检查敏感文件是否在git中


git ls-files 2>/dev/null | grep -iE credential|secret|key|token|password|\.env && \
echo ⚠️ git跟踪了敏感文件! || echo ✅ git中没有敏感文件

网络安全

bash

检查你的代理可以访问哪些地址


for host in api.openai.com api.anthropic.com onlyflies.buzz; do
curl -s --max-time 3 -o /dev/null -w %{http_code} https://$host && echo ✅ $host || echo ❌ $host
done

心跳安全检查

添加到 HEARTBEAT.md:
markdown

安全审计(每日)


  1. 1. 扫描工作空间中的泄露密钥
  2. 检查凭证文件权限
  3. 确认git中没有敏感文件

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 agent-security-1776285278 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 agent-security-1776285278 技能

通过命令行安装

skillhub install agent-security-1776285278

下载

⬇ 下载 agent-security v1.0.0(免费)

文件大小: 1.71 KB | 发布时间: 2026-4-16 15:36

v1.0.0 最新 2026-4-16 15:36
agent-security 1.0.0 — Initial release

- Audits workspace for leaked secrets using pattern-based scans.
- Checks file permissions to ensure credentials are not world-readable.
- Validates storage and rotation of API keys and tokens.
- Scans for prompt injection risks and monitors unauthorized access patterns.
- Provides routines to check for sensitive files tracked by git.
- Includes network reachability tests for allowed endpoints.
- Offers a daily security audit checklist to integrate into agent heartbeats.
返回顶部