Skip to content

firewall: fail closed on missing/unknown labels; no built-in receipt key - #6

Merged
SMC17 merged 1 commit into
mainfrom
fix/firewall-fail-closed-and-key
Nov 20, 2026
Merged

SMC17 merged 1 commit into
mainfrom
fix/firewall-fail-closed-and-key

Conversation

@SMC17

@SMC17 SMC17 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Fixes #3 and #4.

  • X-Sink and X-Taint are now required. Missing, unknown or empty labels return 400 deny_unlabelled; before, they were allowed.
  • The CLI reads the receipt key from --key-file or AGENTFORK_RECEIPT_KEY (64 hex characters) and exits 2 without one. The hardcoded key is removed.
  • Receipts in the response and the audit log now include prev_chain_hash and chain_hash.
  • The Python firewall() takes key_hex=.

Verified on Zig 0.16.0, M2 Max:

  • zig build test: 7/7.
  • The binary exits 2 with no key.
  • With a key: unlabelled → 400, UNTRUSTED_WEB at shell_exec → 403, USER_INTENT → 200. The audit log chain links correctly.
  • Python wrapper: allow / 403 / 400, and it raises without a key.

README and llms.txt updated to match.

🤖 Generated with Claude Code

- X-Sink / X-Taint are required. A missing, unknown or empty label returns
  400 deny_unlabelled instead of defaulting to an allowed read or to user intent.
- The CLI reads the receipt key (64 hex) from --key-file or
  AGENTFORK_RECEIPT_KEY and exits 2 without one. The hardcoded 0x5A key is gone.
- Receipts in the response and the audit log carry prev_chain_hash and chain_hash.
- Python firewall() takes key_hex=.
- Tests: three refused-label requests; key loading rejects missing/malformed keys.

Fixes #3, fixes #4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SMC17

SMC17 commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Gate report: PASS

PR head main
commit f8cfdd1 54bb92e
gate pass pass
tests passed 7 6
tests failed 0 0
tests skipped 0 0
  • zig build test --summary all exit 0

Run with python3 ops/pr_gate.py agentfork 6 from SMC17/SMC17 (8 s for the PR head).

@SMC17
SMC17 merged commit 8a049c9 into main Nov 20, 2026
1 check failed
@SMC17
SMC17 deleted the fix/firewall-fail-closed-and-key branch November 20, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI firewall signs receipts with a hardcoded key

1 participant