开发者
API 参考
3 个端点,JSON 响应,无需认证。
Base URL
https://clawsafe.dev POST
/api/scan 提交 AI 技能进行安全扫描。支持 URL 和文件上传两种方式。
方式一:URL 扫描
curl -X POST https://clawsafe.dev/api/scan \
-H "Content-Type: application/json" \
-d '{"url": "https://github.com/user/skill-repo"}' 方式二:文件上传
curl -X POST https://clawsafe.dev/api/scan \
-F "[email protected]" 响应
{
"verdict": "恶意",
"verdictLevel": "malicious",
"riskScore": { "score": 85, "breakdown": [...] },
"summary": "发现反向shell payload...",
"findings": [...],
"extraction": { "iocs": [...], "files": [...] },
"reportId": "vtKznl4"
} 参数
| 参数 | 类型 | 说明 |
|---|---|---|
url | string | GitHub / ClawHub / .zip 直链 |
file | file | ZIP 或 TAR.GZ 文件,最大 10MB |
force | boolean | 跳过缓存,强制重新扫描 |
GET
/api/report/:id 获取扫描报告的完整 JSON。支持短 ID 和内容哈希两种查询方式。
请求
curl https://clawsafe.dev/api/report/vtKznl4 响应
{
"data": {
"id": "vtKznl4",
"type": "scan-report",
"attributes": {
"verdict": "恶意",
"verdictLevel": "malicious",
"riskScore": { "score": 100 },
"findings": [...],
"extraction": { ... }
}
}
} GET
/api/stats 获取平台统计数据。
请求
curl https://clawsafe.dev/api/stats 响应
{
"data": {
"totalScans": 18,
"maliciousBlocked": 7,
"byVerdict": [
{ "verdict_level": "malicious", "count": 7 },
{ "verdict_level": "trusted", "count": 11 }
],
"recentScans": [
{
"id": "vtKznl4",
"skill_name": "math-calculator",
"verdict_level": "malicious",
"trust_score": 0,
"created_at": 1775147958361
}
]
}
}