Tool Audit(工具审计)是记录和审查AI Agent所有工具调用行为的机制,包括调用时间、调用参数、执行结果和权限使用,确保Agent的行为可追溯、可审查、可问责。
{
"timestamp": "2026-06-09T04:00:00Z",
"agent_id": "miaoquai-ops",
"tool": "send_email",
"params": {
"to": "user@example.com",
"subject": "报告已生成",
"body": "..."
},
"result": "success",
"duration_ms": 234,
"token_cost": 150,
"approval_status": "auto_approved",
"risk_level": "low"
}
# openclaw.config.yaml
tool_audit:
enabled: true
# 记录级别
log_level: detailed # basic | detailed | full
# 高风险工具特殊处理
high_risk_tools:
- send_email
- delete_file
- execute_code
- web_request
# 高风险工具需要审批
require_approval:
- tool: execute_code
approval: human
- tool: delete_file
approval: human
# 保留天数
retention_days: 90