One force push, refused in each agent's own format.
git push --force origin main, sent by six agents to one hook file. Each agent's PreToolUse payload from fixtures/agent-matrix on stdin, one temp HOME.
The command in each agent's tool call
$ git push --force origin main
- Denied: how each agent got it
- Claude Code "permissionDecision":"deny"
- Codex CLI "permissionDecision":"deny"
- Gemini CLI "decision":"deny"
- Cursor "permission":"deny"
- GitHub Copilot CLI "permissionDecision":"deny"
- Kiro CLI exit 2, reason on stderr
- Allowed
git statusall 6: exit 0, no output
Every reason names the rule that matched: Matched rule: git-push-force
Each agent's payload and reply, as captured
Claude Code
payload {"session_id":"claude-session","transcript_path":"~/transcript.jsonl","cwd":"~/project","permission_mode":"default","hook_event_name":"PreToolUse","tool_name":"Bash","tool_use_id":"toolu_1","tool_input":{"command":"git push --force origin main"}} $ node hooks/gateguard.mjs {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Destructive command requested: git push --force origin main\n\n 1. List ALL files/data this command will modify or delete\n 2. Write a one-line rollback procedure\n 3. Quote the user's current instruction verbatim\n\nMatched rule: git-push-force\nDestructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal."}} (stderr empty, exit 0)
Codex CLI
payload {"session_id":"codex-session","transcript_path":null,"cwd":"~/project","hook_event_name":"PreToolUse","model":"gpt-5.5","permission_mode":"default","turn_id":"turn-1","tool_name":"Bash","tool_use_id":"call_1","tool_input":{"command":"git push --force origin main"}} $ node hooks/gateguard.mjs --agent codex {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Destructive command requested: git push --force origin main\n\n 1. List ALL files/data this command will modify or delete\n 2. Write a one-line rollback procedure\n 3. Quote the user's current instruction verbatim\n\nMatched rule: git-push-force\nDestructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal."}} (stderr empty, exit 0)
Gemini CLI
payload {"session_id":"gemini-session","transcript_path":"~/gemini-session.json","cwd":"~/project","hook_event_name":"BeforeTool","timestamp":"2026-11-21T11:08:00.000Z","tool_name":"run_shell_command","tool_input":{"command":"git push --force origin main","description":"run","dir_path":"."}} $ node hooks/gateguard.mjs --agent gemini {"decision":"deny","reason":"Destructive command requested: git push --force origin main\n\n 1. List ALL files/data this command will modify or delete\n 2. Write a one-line rollback procedure\n 3. Quote the user's current instruction verbatim\n\nMatched rule: git-push-force\nDestructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal."} (stderr empty, exit 0)
Cursor
payload {"conversation_id":"cursor-conv","generation_id":"gen-1","model":"claude-opus-4-7-thinking-max","hook_event_name":"preToolUse","cursor_version":"3.20.17","workspace_roots":["~/project"],"user_email":"[email protected]","transcript_path":"~/cursor-transcript.jsonl","tool_name":"Shell","tool_input":{"command":"git push --force origin main","cwd":"~/project"},"tool_use_id":"abc123","cwd":"~/project","agent_message":"Running a command"} $ node hooks/gateguard.mjs --agent cursor {"permission":"deny","user_message":"Destructive command requested: git push --force origin main\n\n 1. List ALL files/data this command will modify or delete\n 2. Write a one-line rollback procedure\n 3. Quote the user's current instruction verbatim\n\nMatched rule: git-push-force\nDestructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal.","agent_message":"Destructive command requested: git push --force origin main\n\n 1. List ALL files/data this command will modify or delete\n 2. Write a one-line rollback procedure\n 3. Quote the user's current instruction verbatim\n\nMatched rule: git-push-force\nDestructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal."} (stderr empty, exit 0)
GitHub Copilot CLI
payload {"sessionId":"copilot-session","timestamp":1763712000000,"cwd":"~/project","toolName":"bash","toolArgs":"{\"command\":\"git push --force origin main\"}"} $ node hooks/gateguard.mjs --agent copilot {"permissionDecision":"deny","permissionDecisionReason":"Destructive command requested: git push --force origin main\n\n 1. List ALL files/data this command will modify or delete\n 2. Write a one-line rollback procedure\n 3. Quote the user's current instruction verbatim\n\nMatched rule: git-push-force\nDestructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal."} (stderr empty, exit 0)
Kiro CLI
payload {"hook_event_name":"PreToolUse","cwd":"~/project","session_id":"kiro-session","tool_name":"execute_bash","tool_input":{"command":"git push --force origin main"}} $ node hooks/gateguard.mjs --agent kiro (stdout empty) stderr: Destructive command requested: git push --force origin main 1. List ALL files/data this command will modify or delete 2. Write a one-line rollback procedure 3. Quote the user's current instruction verbatim Matched rule: git-push-force Destructive Bash gates EVERY call — clearance is not cached. This command stays blocked. Review its effects and rollback with the user. If the user chooses to proceed, they can run it in their own terminal. (exit 2)
