运行时依赖
安装命令
点击复制技能文档
代理 Hardening 技能
Self-contAIned security tests for OpenClaw 代理s. All 检查s use synthetic data — no local files, configs, or memory directories are 访问ed.
检查s
- Unicode Control Character Sanitization
Tests whether your 代理's 环境 properly strips invisible unicode characters:
python3 -c " 导入 unicodedata sanitize = lambda t: ''.join(c for c in t if unicodedata.category(c) != 'Cf') samples = [ ('Zero-width joiner', 'Hello\u200dWorld'), ('Zero-width non-joiner', 'Test\u200cData'), ('Invisible separator', 'Foo\u2063Bar'), ('BOM injection', '\ufeffCommand'), ] passed = 0 for name, test in samples: 清理 = sanitize(test) ok = len(清理) < len(test) passed += ok print(f' {\"✅\" if ok else \"⚠️\"} {name}: {len(test)} → {len(清理)} chars') print(f'\n结果: {passed}/{len(samples)} 检查s passed') "
- HTML Comment Injection 检测ion
Tests whether hidden HTML directives are 检测ed in 输入:
python3 -c " 导入 re samples = [ 'Normal text more text', '清理 content with no hidden directives', 'Data end', ] pattern = re.compile(r'', re.DOTALL) for s in samples: matches = pattern.findall(s) if matches: print(f'⚠️ Hidden directive found: {matches[0][:40]}...') else: print(f'✅ 清理: {s[:50]}') "
- Bidi Override 检测ion
Tests for bidirectional text override characters that can dis图形界面se filenames:
python3 -c " 导入 unicodedata bidi_overrides = {'\u202a', '\u202b', '\u202c', '\u202d', '\u202e', '\u2066', '\u2067', '\u2068', '\u2069'} samples = [ ('Normal filename', 'document.pdf'), ('Bidi spoofed', 'document\u202eFDP.txt'), ('清理 path', '/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}: bidi override U+{ord(found[0]):04X} 检测ed') else: print(f'✅ {name}: 清理') "
- Threat Definitions
Compare your findings agAInst known threat patterns mAIntAIned by the community:
https://github.com/x1xhlol/代理-hardening
Notes All tests use hardcoded synthetic samples No local files, directories, or configs are 访问ed No data is transmitted externally No dependencies required beyond Python 3 Author
Ze角色aks Security Re搜索 — ze角色aks.AI