Repository navigation
Commit d6684f6
fix(security): require_approval + offline now raises DaemonNotFoundError (fail-closed)
Previously, require_approval policy with no daemon or API key degraded silently
to auto-approve with a suppressible RuntimeWarning. This contradicts the policy
name and creates a false sense of security — an operator who configured
require_approval would not expect their agents to self-approve when governance
infra is unreachable.
Change: _offline_audit raises DaemonNotFoundError when policy == "require_approval".
Operators must fix connectivity (start daemon or set NODE9_API_KEY) rather than
silently proceeding without governance.
Also:
- Update docstring to reflect fail-closed behavior for require_approval
- Remove misleading comment from bearer token test
- Add test_saas_malformed_response_raises: missing 'approved' key must not auto-approve
- Add test_saas_run_id_defaults_to_empty_string: run_id absent → "" in payload
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f44cff1 commit d6684f6
2 files changed
Lines changed: 45 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
140 | 136 | | |
141 | 137 | | |
142 | 138 | | |
| |||
281 | 277 | | |
282 | 278 | | |
283 | 279 | | |
284 | | - | |
285 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
286 | 283 | | |
287 | 284 | | |
288 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
327 | | - | |
328 | | - | |
| 330 | + | |
329 | 331 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 332 | | |
335 | 333 | | |
336 | 334 | | |
| |||
379 | 377 | | |
380 | 378 | | |
381 | 379 | | |
382 | | - | |
383 | 380 | | |
384 | 381 | | |
385 | 382 | | |
| |||
395 | 392 | | |
396 | 393 | | |
397 | 394 | | |
398 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
399 | 426 | | |
400 | 427 | | |
401 | 428 | | |
| |||
0 commit comments