# ENFORCE=1 python -m unittest -v test_gate # date: 2026-11-29T11:10:11Z # python 3.14.4, jsonschema 4.26.0 test_absolute_path (test_gate.T.test_absolute_path) ... {"ts": "2026-11-29T11:10:11Z", "tool": "read_note", "arguments": {"path": "/etc/passwd"}, "decision": "deny", "rule": "R3-path-outside-root"} ok test_extra_argument (test_gate.T.test_extra_argument) ... {"ts": "2026-11-29T11:10:11Z", "tool": "send_email", "arguments": {"to": "ana@example.com", "subject": "s", "body": "b", "bcc": "x@evil.test"}, "decision": "deny", "rule": "R2-schema:additionalProperties"} ok test_in_policy_email_works (test_gate.T.test_in_policy_email_works) ... {"ts": "2026-11-29T11:10:11Z", "tool": "send_email", "arguments": {"to": "ana@example.com", "subject": "hi", "body": "ok"}, "decision": "allow", "rule": "-"} ok test_in_policy_read_works (test_gate.T.test_in_policy_read_works) ... {"ts": "2026-11-29T11:10:11Z", "tool": "read_note", "arguments": {"path": "standup.txt"}, "decision": "allow", "rule": "-"} ok test_lookalike_domain (test_gate.T.test_lookalike_domain) ... {"ts": "2026-11-29T11:10:11Z", "tool": "send_email", "arguments": {"to": "a@example.com.evil.test", "subject": "s", "body": "b"}, "decision": "deny", "rule": "R4-recipient-domain"} ok test_oversize_body (test_gate.T.test_oversize_body) ... {"ts": "2026-11-29T11:10:11Z", "tool": "send_email", "arguments": {"_truncated": 20053}, "decision": "deny", "rule": "R2-schema:maxLength"} ok test_path_traversal (test_gate.T.test_path_traversal) ... {"ts": "2026-11-29T11:10:11Z", "tool": "read_note", "arguments": {"path": "../secret.txt"}, "decision": "deny", "rule": "R3-path-outside-root"} ok test_recipient_outside_domain (test_gate.T.test_recipient_outside_domain) ... {"ts": "2026-11-29T11:10:11Z", "tool": "send_email", "arguments": {"to": "attacker@evil.test", "subject": "s", "body": "b"}, "decision": "deny", "rule": "R4-recipient-domain"} ok test_symlink_escape (test_gate.T.test_symlink_escape) ... {"ts": "2026-11-29T11:10:11Z", "tool": "read_note", "arguments": {"path": "link.txt"}, "decision": "deny", "rule": "R3-path-outside-root"} ok test_unregistered_delete (test_gate.T.test_unregistered_delete) ... {"ts": "2026-11-29T11:10:11Z", "tool": "delete_note", "arguments": {"path": "victim.txt"}, "decision": "deny", "rule": "R1-unknown-tool"} ok ---------------------------------------------------------------------- Ran 10 tests in 0.004s OK