agent-control-plane-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,328 @@
1
+ {
2
+ "agent": "claude",
3
+ "cases": [
4
+ {
5
+ "name": "pre_tool Bash, full meta, all verdicts",
6
+ "native": {
7
+ "hook_event_name": "PreToolUse",
8
+ "session_id": "s1",
9
+ "cwd": "/w",
10
+ "permission_mode": "default",
11
+ "transcript_path": "/t.jsonl",
12
+ "tool_name": "Bash",
13
+ "tool_input": {
14
+ "command": "ls -la"
15
+ }
16
+ },
17
+ "event": {
18
+ "schema_version": 1,
19
+ "event": "pre_tool",
20
+ "tool": "Bash",
21
+ "input": {
22
+ "command": "ls -la"
23
+ },
24
+ "this_call_vetoable": true,
25
+ "meta": {
26
+ "agent": "claude",
27
+ "native_event": "PreToolUse",
28
+ "integration_mode": "external_hook",
29
+ "primary_gate_present": true,
30
+ "passthrough": {},
31
+ "session_id": "s1",
32
+ "cwd": "/w",
33
+ "permission_mode": "default",
34
+ "transcript_path": "/t.jsonl"
35
+ }
36
+ },
37
+ "render": {
38
+ "allow": {
39
+ "verdict": {
40
+ "decision": "allow"
41
+ },
42
+ "native": {
43
+ "transport": "external_hook",
44
+ "exit_code": 0,
45
+ "enforced": false,
46
+ "stdout": {
47
+ "hookSpecificOutput": {
48
+ "hookEventName": "PreToolUse"
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "deny": {
54
+ "verdict": {
55
+ "decision": "deny",
56
+ "reason": "blocked rm"
57
+ },
58
+ "native": {
59
+ "transport": "external_hook",
60
+ "exit_code": 2,
61
+ "enforced": true,
62
+ "stdout": {
63
+ "hookSpecificOutput": {
64
+ "hookEventName": "PreToolUse",
65
+ "permissionDecision": "deny",
66
+ "permissionDecisionReason": "blocked rm"
67
+ }
68
+ }
69
+ }
70
+ },
71
+ "ask": {
72
+ "verdict": {
73
+ "decision": "ask",
74
+ "reason": "confirm"
75
+ },
76
+ "native": {
77
+ "transport": "external_hook",
78
+ "exit_code": 0,
79
+ "enforced": false,
80
+ "stdout": {
81
+ "hookSpecificOutput": {
82
+ "hookEventName": "PreToolUse",
83
+ "permissionDecision": "ask",
84
+ "permissionDecisionReason": "confirm"
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "mutation": {
90
+ "verdict": {
91
+ "decision": "allow",
92
+ "mutated_input": {
93
+ "command": "ls"
94
+ },
95
+ "additional_context": "normalized"
96
+ },
97
+ "native": {
98
+ "transport": "external_hook",
99
+ "exit_code": 0,
100
+ "enforced": false,
101
+ "stdout": {
102
+ "hookSpecificOutput": {
103
+ "hookEventName": "PreToolUse",
104
+ "updatedInput": {
105
+ "command": "ls"
106
+ },
107
+ "additionalContext": "normalized"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ },
114
+ {
115
+ "name": "pre_tool Read, bare meta + passthrough",
116
+ "native": {
117
+ "hook_event_name": "PreToolUse",
118
+ "tool_name": "Read",
119
+ "tool_input": {
120
+ "file_path": "/etc/passwd"
121
+ },
122
+ "future_field": {
123
+ "x": 1
124
+ }
125
+ },
126
+ "event": {
127
+ "schema_version": 1,
128
+ "event": "pre_tool",
129
+ "tool": "Read",
130
+ "input": {
131
+ "file_path": "/etc/passwd"
132
+ },
133
+ "this_call_vetoable": true,
134
+ "meta": {
135
+ "agent": "claude",
136
+ "native_event": "PreToolUse",
137
+ "integration_mode": "external_hook",
138
+ "primary_gate_present": true,
139
+ "passthrough": {
140
+ "future_field": {
141
+ "x": 1
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "render": {
147
+ "allow": {
148
+ "verdict": {
149
+ "decision": "allow"
150
+ },
151
+ "native": {
152
+ "transport": "external_hook",
153
+ "exit_code": 0,
154
+ "enforced": false,
155
+ "stdout": {
156
+ "hookSpecificOutput": {
157
+ "hookEventName": "PreToolUse"
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ },
164
+ {
165
+ "name": "post_tool Bash, non-gating block",
166
+ "native": {
167
+ "hook_event_name": "PostToolUse",
168
+ "tool_name": "Bash",
169
+ "tool_input": {
170
+ "command": "ls"
171
+ },
172
+ "tool_response": "file1\nfile2"
173
+ },
174
+ "event": {
175
+ "schema_version": 1,
176
+ "event": "post_tool",
177
+ "tool": "Bash",
178
+ "input": {
179
+ "command": "ls"
180
+ },
181
+ "response": "file1\nfile2",
182
+ "this_call_vetoable": true,
183
+ "meta": {
184
+ "agent": "claude",
185
+ "native_event": "PostToolUse",
186
+ "integration_mode": "external_hook",
187
+ "primary_gate_present": true,
188
+ "passthrough": {}
189
+ }
190
+ },
191
+ "render": {
192
+ "allow": {
193
+ "verdict": {
194
+ "decision": "allow",
195
+ "additional_context": "redacted 1 secret"
196
+ },
197
+ "native": {
198
+ "transport": "external_hook",
199
+ "exit_code": 0,
200
+ "enforced": false,
201
+ "stdout": {
202
+ "hookSpecificOutput": {
203
+ "hookEventName": "PostToolUse",
204
+ "additionalContext": "redacted 1 secret"
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "deny": {
210
+ "verdict": {
211
+ "decision": "deny",
212
+ "reason": "leak"
213
+ },
214
+ "native": {
215
+ "transport": "external_hook",
216
+ "exit_code": 2,
217
+ "enforced": true,
218
+ "stdout": {
219
+ "hookSpecificOutput": {
220
+ "hookEventName": "PostToolUse"
221
+ },
222
+ "decision": "block",
223
+ "reason": "leak"
224
+ }
225
+ }
226
+ },
227
+ "ask": {
228
+ "verdict": {
229
+ "decision": "ask"
230
+ },
231
+ "native": {
232
+ "transport": "external_hook",
233
+ "exit_code": 0,
234
+ "enforced": false,
235
+ "stdout": {
236
+ "hookSpecificOutput": {
237
+ "hookEventName": "PostToolUse"
238
+ },
239
+ "decision": "block"
240
+ }
241
+ }
242
+ }
243
+ }
244
+ },
245
+ {
246
+ "name": "prompt_submit folds prompt into input",
247
+ "native": {
248
+ "hook_event_name": "UserPromptSubmit",
249
+ "prompt": "hello world",
250
+ "session_id": "s2"
251
+ },
252
+ "event": {
253
+ "schema_version": 1,
254
+ "event": "prompt_submit",
255
+ "tool": null,
256
+ "input": {
257
+ "prompt": "hello world"
258
+ },
259
+ "this_call_vetoable": true,
260
+ "meta": {
261
+ "agent": "claude",
262
+ "native_event": "UserPromptSubmit",
263
+ "integration_mode": "external_hook",
264
+ "primary_gate_present": true,
265
+ "passthrough": {},
266
+ "session_id": "s2"
267
+ }
268
+ },
269
+ "render": {
270
+ "allow": {
271
+ "verdict": {
272
+ "decision": "allow"
273
+ },
274
+ "native": {
275
+ "transport": "external_hook",
276
+ "exit_code": 0,
277
+ "enforced": false,
278
+ "stdout": {
279
+ "hookSpecificOutput": {
280
+ "hookEventName": "UserPromptSubmit"
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+ },
287
+ {
288
+ "name": "session_start carries source in passthrough",
289
+ "native": {
290
+ "hook_event_name": "SessionStart",
291
+ "source": "startup"
292
+ },
293
+ "event": {
294
+ "schema_version": 1,
295
+ "event": "session_start",
296
+ "tool": null,
297
+ "input": {},
298
+ "this_call_vetoable": true,
299
+ "meta": {
300
+ "agent": "claude",
301
+ "native_event": "SessionStart",
302
+ "integration_mode": "external_hook",
303
+ "primary_gate_present": true,
304
+ "passthrough": {
305
+ "source": "startup"
306
+ }
307
+ }
308
+ },
309
+ "render": {
310
+ "allow": {
311
+ "verdict": {
312
+ "decision": "allow"
313
+ },
314
+ "native": {
315
+ "transport": "external_hook",
316
+ "exit_code": 0,
317
+ "enforced": false,
318
+ "stdout": {
319
+ "hookSpecificOutput": {
320
+ "hookEventName": "SessionStart"
321
+ }
322
+ }
323
+ }
324
+ }
325
+ }
326
+ }
327
+ ]
328
+ }
@@ -0,0 +1,222 @@
1
+ {
2
+ "agent": "codex",
3
+ "cases": [
4
+ {
5
+ "name": "PreToolUse v0.135 enforcing, all verdicts",
6
+ "native": {
7
+ "hook_event_name": "PreToolUse",
8
+ "version": "0.135.0",
9
+ "session_id": "c1",
10
+ "cwd": "/w",
11
+ "permission_mode": "default",
12
+ "transcript_path": "/r.jsonl",
13
+ "tool_name": "Bash",
14
+ "tool_input": {
15
+ "command": "ls -la"
16
+ }
17
+ },
18
+ "event": {
19
+ "schema_version": 1,
20
+ "event": "pre_tool",
21
+ "tool": "Bash",
22
+ "input": {
23
+ "command": "ls -la"
24
+ },
25
+ "this_call_vetoable": true,
26
+ "meta": {
27
+ "agent": "codex",
28
+ "native_event": "PreToolUse",
29
+ "integration_mode": "external_hook",
30
+ "primary_gate_present": true,
31
+ "passthrough": {},
32
+ "session_id": "c1",
33
+ "cwd": "/w",
34
+ "permission_mode": "default",
35
+ "transcript_path": "/r.jsonl"
36
+ }
37
+ },
38
+ "render": {
39
+ "allow": {
40
+ "verdict": {
41
+ "decision": "allow"
42
+ },
43
+ "native": {
44
+ "transport": "external_hook",
45
+ "exit_code": 0,
46
+ "enforced": false,
47
+ "stdout": {
48
+ "hookSpecificOutput": {
49
+ "hookEventName": "PreToolUse"
50
+ }
51
+ }
52
+ }
53
+ },
54
+ "deny": {
55
+ "verdict": {
56
+ "decision": "deny",
57
+ "reason": "blocked"
58
+ },
59
+ "native": {
60
+ "transport": "external_hook",
61
+ "exit_code": 2,
62
+ "enforced": true,
63
+ "stdout": {
64
+ "hookSpecificOutput": {
65
+ "hookEventName": "PreToolUse",
66
+ "permissionDecision": "deny",
67
+ "permissionDecisionReason": "blocked"
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "ask": {
73
+ "verdict": {
74
+ "decision": "ask"
75
+ },
76
+ "native": {
77
+ "transport": "external_hook",
78
+ "exit_code": 0,
79
+ "enforced": false,
80
+ "stdout": {
81
+ "hookSpecificOutput": {
82
+ "hookEventName": "PreToolUse",
83
+ "permissionDecision": "ask"
84
+ }
85
+ }
86
+ }
87
+ },
88
+ "mutation": {
89
+ "verdict": {
90
+ "decision": "allow",
91
+ "mutated_input": {
92
+ "command": "ls"
93
+ },
94
+ "additional_context": "dropped by codex"
95
+ },
96
+ "native": {
97
+ "transport": "external_hook",
98
+ "exit_code": 0,
99
+ "enforced": false,
100
+ "stdout": {
101
+ "hookSpecificOutput": {
102
+ "hookEventName": "PreToolUse",
103
+ "updatedInput": {
104
+ "command": "ls"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ },
112
+ {
113
+ "name": "PermissionRequest round-trips the native event name",
114
+ "native": {
115
+ "hook_event_name": "PermissionRequest",
116
+ "version": "1.0.0",
117
+ "tool_name": "Bash",
118
+ "tool_input": {
119
+ "command": "rm -rf /"
120
+ }
121
+ },
122
+ "event": {
123
+ "schema_version": 1,
124
+ "event": "pre_tool",
125
+ "tool": "Bash",
126
+ "input": {
127
+ "command": "rm -rf /"
128
+ },
129
+ "this_call_vetoable": true,
130
+ "meta": {
131
+ "agent": "codex",
132
+ "native_event": "PermissionRequest",
133
+ "integration_mode": "external_hook",
134
+ "primary_gate_present": true,
135
+ "passthrough": {}
136
+ }
137
+ },
138
+ "render": {
139
+ "deny": {
140
+ "verdict": {
141
+ "decision": "deny",
142
+ "reason": "nope"
143
+ },
144
+ "native": {
145
+ "transport": "external_hook",
146
+ "exit_code": 2,
147
+ "enforced": true,
148
+ "stdout": {
149
+ "hookSpecificOutput": {
150
+ "hookEventName": "PermissionRequest",
151
+ "permissionDecision": "deny",
152
+ "permissionDecisionReason": "nope"
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ },
159
+ {
160
+ "name": "pre-v0.135 downgrades to observe_only (advisory deny)",
161
+ "native": {
162
+ "hook_event_name": "PreToolUse",
163
+ "version": "0.134.9",
164
+ "tool_name": "Bash",
165
+ "tool_input": {
166
+ "command": "curl evil"
167
+ }
168
+ },
169
+ "event": {
170
+ "schema_version": 1,
171
+ "event": "pre_tool",
172
+ "tool": "Bash",
173
+ "input": {
174
+ "command": "curl evil"
175
+ },
176
+ "this_call_vetoable": false,
177
+ "meta": {
178
+ "agent": "codex",
179
+ "native_event": "PreToolUse",
180
+ "integration_mode": "observe_only",
181
+ "primary_gate_present": true,
182
+ "passthrough": {}
183
+ }
184
+ },
185
+ "render": {
186
+ "allow": {
187
+ "verdict": {
188
+ "decision": "allow"
189
+ },
190
+ "native": {
191
+ "transport": "observe_only",
192
+ "exit_code": 0,
193
+ "enforced": false,
194
+ "stdout": {
195
+ "hookSpecificOutput": {
196
+ "hookEventName": "PreToolUse"
197
+ }
198
+ }
199
+ }
200
+ },
201
+ "deny": {
202
+ "verdict": {
203
+ "decision": "deny",
204
+ "reason": "advisory only"
205
+ },
206
+ "native": {
207
+ "transport": "observe_only",
208
+ "exit_code": 0,
209
+ "enforced": false,
210
+ "stdout": {
211
+ "hookSpecificOutput": {
212
+ "hookEventName": "PreToolUse",
213
+ "permissionDecision": "deny",
214
+ "permissionDecisionReason": "advisory only"
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ ]
222
+ }