Skip to content

Commit b0625b4

Browse files
committed
docs: align safety response examples with report schema
1 parent 0a9594b commit b0625b4

1 file changed

Lines changed: 21 additions & 35 deletions

File tree

examples/tool_safety/DESIGN.md

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,16 @@ deny: 阻断
7878

7979
```json
8080
{
81-
"blocked": false,
82-
"categories": [
83-
"safe"
84-
],
81+
"scan_id": "manifest:030:safe_bash.sh",
82+
"timestamp": "1970-01-01T00:00:00+00:00",
8583
"decision": "allow",
86-
"elapsed_ms": 0.0,
87-
"expected_decision": "allow",
84+
"risk_level": "none",
8885
"findings": [],
86+
"tool_name": "safe_bash.sh",
8987
"language": "bash",
90-
"required_rule_ids": [],
91-
"risk_level": "none",
92-
"sample": "examples/tool_safety/samples/safe_bash.sh",
88+
"elapsed_ms": 0.0,
9389
"sanitized": false,
94-
"scan_id": "manifest:030:safe_bash.sh",
90+
"blocked": false,
9591
"summary": "No safety rules matched; execution is allowed by the current static policy.",
9692
"telemetry_attributes": {
9793
"tool.safety.blocked": false,
@@ -102,23 +98,18 @@ deny: 阻断
10298
"tool.safety.sanitized": false,
10399
"tool.safety.scan_id": "manifest:030:safe_bash.sh",
104100
"tool.safety.tool_name": "safe_bash.sh"
105-
},
106-
"timestamp": "1970-01-01T00:00:00+00:00",
107-
"tool_name": "safe_bash.sh"
101+
}
108102
}
109103
```
110104

111105
### needs_human_review response
112106

113107
```json
114108
{
115-
"blocked": false,
116-
"categories": [
117-
"process_execution"
118-
],
109+
"scan_id": "manifest:036:subprocess_call.py",
110+
"timestamp": "1970-01-01T00:00:00+00:00",
119111
"decision": "needs_human_review",
120-
"elapsed_ms": 0.0,
121-
"expected_decision": "needs_human_review",
112+
"risk_level": "medium",
122113
"findings": [
123114
{
124115
"column": 0,
@@ -133,14 +124,11 @@ deny: 阻断
133124
"rule_id": "PY_PROCESS_EXECUTION_REVIEW"
134125
}
135126
],
127+
"tool_name": "subprocess_call.py",
136128
"language": "python",
137-
"required_rule_ids": [
138-
"PY_PROCESS_EXECUTION_REVIEW"
139-
],
140-
"risk_level": "medium",
141-
"sample": "examples/tool_safety/samples/subprocess_call.py",
129+
"elapsed_ms": 0.0,
142130
"sanitized": false,
143-
"scan_id": "manifest:036:subprocess_call.py",
131+
"blocked": false,
144132
"summary": "Decision needs_human_review with medium risk from rules: PY_PROCESS_EXECUTION_REVIEW.",
145133
"telemetry_attributes": {
146134
"tool.safety.blocked": false,
@@ -151,19 +139,18 @@ deny: 阻断
151139
"tool.safety.sanitized": false,
152140
"tool.safety.scan_id": "manifest:036:subprocess_call.py",
153141
"tool.safety.tool_name": "subprocess_call.py"
154-
},
155-
"timestamp": "1970-01-01T00:00:00+00:00",
156-
"tool_name": "subprocess_call.py"
142+
}
157143
}
158144
```
159145

160146
### deny response
161147

162148
```json
163149
{
164-
"blocked": true,
150+
"scan_id": "1b0bc4f6-a01e-49c6-833a-1cac1909daee",
151+
"timestamp": "2026-07-02T07:07:08.956049+00:00",
165152
"decision": "deny",
166-
"elapsed_ms": 1.054,
153+
"risk_level": "critical",
167154
"findings": [
168155
{
169156
"column": null,
@@ -207,10 +194,11 @@ deny: 阻断
207194
"rule_id": "BASH_SHELL_FEATURE_REVIEW"
208195
}
209196
],
197+
"tool_name": "example_bash_tool",
210198
"language": "bash",
211-
"risk_level": "critical",
199+
"elapsed_ms": 1.054,
212200
"sanitized": false,
213-
"scan_id": "1b0bc4f6-a01e-49c6-833a-1cac1909daee",
201+
"blocked": true,
214202
"summary": "Decision deny with critical risk from rules: FILE_SECRET_PATH_ACCESS, NETWORK_NON_WHITELIST_DOMAIN, BASH_SHELL_FEATURE_REVIEW.",
215203
"telemetry_attributes": {
216204
"tool.safety.blocked": true,
@@ -221,9 +209,7 @@ deny: 阻断
221209
"tool.safety.sanitized": false,
222210
"tool.safety.scan_id": "1b0bc4f6-a01e-49c6-833a-1cac1909daee",
223211
"tool.safety.tool_name": "example_bash_tool"
224-
},
225-
"timestamp": "2026-07-02T07:07:08.956049+00:00",
226-
"tool_name": "example_bash_tool"
212+
}
227213
}
228214
```
229215

0 commit comments

Comments
 (0)