Prove parity cell: approvals are single-use and action-bound on Codex
Your AI's guard dog to stop it from going rogue.
Brought to you by:
doberman
Originally created by: fu351
Proven on Claude Code, ◻ on Codex. The guarantee: an approval for one action id must never authorize a different action, even if a buggy or compromised auth provider returns "approved."
What to do
tests/unit/test_hosthook_auth_challenge.py::test_approval_is_bound_to_the_action_id. It monkeypatches doberman.auth.challenge.run_auth_challenge to return AuthResult(approved=True, action_id="some-other-action") (approved, but for the WRONG action) and asserts the hook still denies.tests/unit/test_hosthook_codex.py. Reuse the AUTH-tier action from test_auth_runs_dobermans_own_challenge in the same file (a Write to .github/workflows/ci.yml is DEFAULT_SENSITIVE → AUTH): set codex.AUTH_PROMPTER to an approving fake, monkeypatch doberman.auth.challenge.run_auth_challenge to the same mismatched-action_id stub, call codex.evaluate_pre(payload), and assert permissionDecision == "deny".@pytest.mark.guarantee("auth-action-bound", host="codex")doberman.auth.challenge / hookio.resolve_auth), confirm the test goes red, revert. Note "mutation-checked" in the PR.python -m tools.parity.generate_parity.Same shared challenge mechanism Claude Code already proves. This closes the Codex column on it.
Originally posted by: blackcoderx
Working on this — adding the Codex sibling of
test_approval_is_bound_to_the_action_idintests/unit/test_hosthook_codex.py.Ticket changed by: fu351