SafeClaw Security Checker
Perform security compliance checks on MCP/LLM application configurations.
Usage
When the user invokes this skill, run security checks on their configuration.
Basic Command
CODEBLOCK0
Arguments
- -
config_path: Path to the configuration file to check (JSON/YAML/TOML) - If no path provided, use
--auto to auto-discover config:
CODEBLOCK1
Execution Flow
- 1. Determine config path:
- If user provides a path, use it
- If user wants auto-discovery, use
--auto
- If unsure, ask the user
- 2. Run the check:
CODEBLOCK2
- 3. Parse JSON output: The output has this structure:
CODEBLOCK3
- 4. Report findings:
- Show summary: X passed, Y attention items, Z high-risk
- List high-risk items FIRST with remediation steps
- List attention items with suggestions
- If all passed, congratulate the user
Exit Codes
- -
0: All checks passed (safe) - INLINECODE4 : Attention items found
- INLINECODE5 : High-risk items found
Example Config
Use {baseDir}/example-config.json as a reference template for users who need a starting point.
Categories Checked
| Category | Description |
|---|
| 配置与密钥 | Secrets in config, hardcoded credentials |
| 权限 |
File permissions, access controls |
| 网络暴露 | Network bindings, CORS, exposed ports |
| 插件安全 | MCP server security, plugin sources |
| 日志与审计 | Logging configuration, audit trails |
| 版本信息 | Version exposure, update status |
| OpenClaw安全 | OpenClaw-specific deployment security |
Example Invocation
User: "/safeclaw check my config at ./config/mcp.json"
Response:
- 1. Run: INLINECODE7
- Parse results and present findings in a clear, actionable format
Tips
- - Always use
--format json for machine-readable output - The skill runs from the skill directory, so use
{baseDir}/../../ to reach project root - If the config file doesn't exist, suggest using the template at INLINECODE10
SafeClaw 安全检查器
对 MCP/LLM 应用配置执行安全合规检查。
使用方法
当用户调用此技能时,对其配置运行安全检查。
基本命令
bash
cd {baseDir}/../../ && uv run python main.py check --config --format json
参数
- - config_path:要检查的配置文件路径(JSON/YAML/TOML)
- 如果未提供路径,使用 --auto 自动发现配置:
bash
cd {baseDir}/../../ && uv run python main.py check --auto --format json
执行流程
- 1. 确定配置路径:
- 如果用户提供路径,则使用该路径
- 如果用户希望自动发现,则使用 --auto
- 如果不确定,询问用户
- 2. 运行检查:
bash
cd {baseDir}/../../ && uv run python main.py check --config
--format json
- 3. 解析 JSON 输出:输出结构如下:
json
{
summary: {
overall_status: 安全|注意|高危,
total: 10,
passed: 7,
failed: 3,
bylevel: {safe: 7, attention: 2, highrisk: 1}
},
failed_results: [
{
name: 检查项名称,
category: 安全类别,
level: 高危|注意,
message: 问题描述,
risk_description: 风险说明,
remediation: 整改建议,
fix_commands: [修复命令]
}
]
}
- 4. 报告发现:
- 显示摘要:X 项通过,Y 项需要注意,Z 项高危
- 首先列出高危项及整改步骤
- 列出需要注意的项及建议
- 如果全部通过,恭喜用户
退出码
- - 0:所有检查通过(安全)
- 1:发现需要注意的项
- 2:发现高危项
示例配置
使用 {baseDir}/example-config.json 作为需要起点的用户的参考模板。
检查类别
文件权限、访问控制 |
| 网络暴露 | 网络绑定、CORS、暴露端口 |
| 插件安全 | MCP 服务器安全、插件来源 |
| 日志与审计 | 日志配置、审计追踪 |
| 版本信息 | 版本暴露、更新状态 |
| OpenClaw 安全 | OpenClaw 特定部署安全 |
调用示例
用户:/safeclaw check my config at ./config/mcp.json
响应:
- 1. 运行:cd {baseDir}/../../ && uv run python main.py check --config ./config/mcp.json --format json
- 解析结果并以清晰、可操作的形式呈现发现
提示
- - 始终使用 --format json 以获得机器可读的输出
- 该技能从技能目录运行,因此使用 {baseDir}/../../ 到达项目根目录
- 如果配置文件不存在,建议使用 {baseDir}/templates/minimal-config.json 中的模板