# ENFORCE=0 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": "allow", "rule": "enforcement-off"} FAIL 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": "allow", "rule": "enforcement-off"} FAIL 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": "enforcement-off"} 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": "enforcement-off"} 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": "allow", "rule": "enforcement-off"} FAIL test_oversize_body (test_gate.T.test_oversize_body) ... {"ts": "2026-11-29T11:10:11Z", "tool": "send_email", "arguments": {"_truncated": 20053}, "decision": "allow", "rule": "enforcement-off"} FAIL test_path_traversal (test_gate.T.test_path_traversal) ... {"ts": "2026-11-29T11:10:11Z", "tool": "read_note", "arguments": {"path": "../secret.txt"}, "decision": "allow", "rule": "enforcement-off"} FAIL 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": "allow", "rule": "enforcement-off"} FAIL test_symlink_escape (test_gate.T.test_symlink_escape) ... {"ts": "2026-11-29T11:10:11Z", "tool": "read_note", "arguments": {"path": "link.txt"}, "decision": "allow", "rule": "enforcement-off"} FAIL test_unregistered_delete (test_gate.T.test_unregistered_delete) ... {"ts": "2026-11-29T11:10:11Z", "tool": "delete_note", "arguments": {"path": "victim.txt"}, "decision": "allow", "rule": "enforcement-off"} FAIL ====================================================================== FAIL: test_absolute_path (test_gate.T.test_absolute_path) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 22, in test_absolute_path r = gate.call_tool("read_note", {"path": "/etc/passwd"}); self.denied(r) ~~~~~~~~~~~^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ====================================================================== FAIL: test_extra_argument (test_gate.T.test_extra_argument) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 41, in test_extra_argument r = gate.call_tool("send_email", {"to": "ana@example.com", "subject": "s", "body": "b", "bcc": "x@evil.test"}); self.denied(r) ~~~~~~~~~~~^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 13, in denied self.assertIn("denied by policy", r["error"]) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'denied by policy' not found in "TypeError: send_email() got an unexpected keyword argument 'bcc'" ====================================================================== FAIL: test_lookalike_domain (test_gate.T.test_lookalike_domain) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 33, in test_lookalike_domain self.denied(gate.call_tool("send_email", {"to": "a@example.com.evil.test", "subject": "s", "body": "b"})) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ====================================================================== FAIL: test_oversize_body (test_gate.T.test_oversize_body) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 38, in test_oversize_body r = gate.call_tool("send_email", {"to": "ana@example.com", "subject": "s", "body": "A" * 20000}); self.denied(r) ~~~~~~~~~~~^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ====================================================================== FAIL: test_path_traversal (test_gate.T.test_path_traversal) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 20, in test_path_traversal r = gate.call_tool("read_note", {"path": "../secret.txt"}); self.denied(r) ~~~~~~~~~~~^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ====================================================================== FAIL: test_recipient_outside_domain (test_gate.T.test_recipient_outside_domain) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 30, in test_recipient_outside_domain r = gate.call_tool("send_email", {"to": "attacker@evil.test", "subject": "s", "body": "b"}); self.denied(r) ~~~~~~~~~~~^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ====================================================================== FAIL: test_symlink_escape (test_gate.T.test_symlink_escape) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 27, in test_symlink_escape try: self.denied(gate.call_tool("read_note", {"path": "link.txt"})) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ====================================================================== FAIL: test_unregistered_delete (test_gate.T.test_unregistered_delete) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 35, in test_unregistered_delete r = gate.call_tool("delete_note", {"path": "victim.txt"}); self.denied(r) ~~~~~~~~~~~^^^ File "/home/runner/work/comparison-kit/comparison-kit/work/agent-security-two/sites/howtosecureaiagents/runs/tool-allowlist-argument-validation/test_gate.py", line 12, in denied self.assertFalse(r["ok"], "the out-of-policy call executed instead of being denied") ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: True is not false : the out-of-policy call executed instead of being denied ---------------------------------------------------------------------- Ran 10 tests in 0.012s FAILED (failures=8)