返回顶部
a

agent-hardening代理加固测试

Test your agent's input sanitization against common injection attacks. Runs self-contained checks using synthetic test data only — no local files are accessed.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.2
安全检测
已通过
1,075
下载量
免费
免费
4
收藏
概述
安装方式
版本历史

agent-hardening

技能名称: agent-hardening

Agent 加固技能

面向 OpenClaw 代理的独立安全测试。所有检查均使用合成数据——不访问任何本地文件、配置或内存目录。

检查项

1. Unicode 控制字符净化

测试代理环境是否正确过滤不可见 Unicode 字符: bash python3 -c import unicodedata sanitize = lambda t: .join(c for c in t if unicodedata.category(c) != Cf) samples = [ (零宽连字, Hello\u200dWorld), (零宽不连字, Test\u200cData), (不可见分隔符, Foo\u2063Bar), (BOM 注入, \ufeffCommand), ] passed = 0 for name, test in samples: clean = sanitize(test) ok = len(clean) < len(test) passed += ok print(f {\✅\ if ok else \⚠️\} {name}: {len(test)} → {len(clean)} 字符) print(f\n结果: {passed}/{len(samples)} 项检查通过)

2. HTML 注释注入检测

测试输入中是否检测到隐藏的 HTML 指令: bash python3 -c import re samples = [ 普通文本 更多文本, 无隐藏指令的干净内容, 数据 结束, ] pattern = re.compile(r, re.DOTALL) for s in samples: matches = pattern.findall(s) if matches: print(f⚠️ 发现隐藏指令: {matches[0][:40]}...) else: print(f✅ 干净: {s[:50]})

3. 双向文本覆盖检测

测试是否存在可伪装文件名的双向文本覆盖字符: bash python3 -c import unicodedata bidi_overrides = {\u202a, \u202b, \u202c, \u202d, \u202e, \u2066, \u2067, \u2068, \u2069} samples = [ (正常文件名, document.pdf), (双向伪造, document\u202eFDP.txt), (干净路径, /home/user/notes.md), ] for name, test in samples: found = [c for c in test if c in bidi_overrides] if found: print(f⚠️ {name}: 检测到双向覆盖 U+{ord(found[0]):04X}) else: print(f✅ {name}: 干净)

4. 威胁定义

将您的发现与社区维护的已知威胁模式进行对比:

https://github.com/x1xhlol/agent-hardening

备注

  • - 所有测试均使用硬编码的合成样本
  • 不访问任何本地文件、目录或配置
  • 不传输任何外部数据
  • 除 Python 3 外无需其他依赖

作者

ZeroLeaks 安全研究 — zeroleaks.ai

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 agent-hardening-1776419934 技能

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

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

通过命令行安装

skillhub install agent-hardening-1776419934

下载

⬇ 下载 agent-hardening v1.1.2(免费)

文件大小: 1.93 KB | 发布时间: 2026-4-17 18:19

v1.1.2 最新 2026-4-17 18:19
Added back threat definitions reference. All checks remain self-contained with synthetic data.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部