Files
stack/agents/filbert/work/slice1-probes/claude-gate-noexec.sh
T
jason.woltjeandClaude Opus 5.5 771fc3d270 docs(slice1): row 34 S0 harness probe matrix (filbert)
Pi 0.85.1 and Claude Code 2.1.289 (Agent SDK 0.3.289), 34 cases against a
scripted local model in a loopback-only network namespace. MATRIX.md has
the command, outcome, model-visible message and fail-closed column per
case, and one rely-on line per case. Evidence under evidence/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 22:25:41 -05:00

15 lines
832 B
Bash

#!/usr/bin/env bash
# Row S0 probe gate for Claude Code: a PreToolUse command hook. $1 picks the
# behaviour. Each invocation is logged to $GATE_LOG with the hook input.
mode=${1:-block}
input=$(cat)
printf '%s mode=%s input=%s\n' "$(date -u +%FT%T.%3NZ)" "$mode" "$input" >> "${GATE_LOG:-/dev/null}"
case "$mode" in
block) echo "PROBE-GATE: write is blocked by policy (exit 2)" >&2; exit 2 ;;
deny-json) printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"PROBE-GATE: write is denied by policy (JSON)"}}\n'; exit 0 ;;
crash) echo "PROBE-GATE crashed (exit 1)" >&2; exit 1 ;;
crash3) echo "PROBE-GATE crashed (exit 3)" >&2; exit 3 ;;
hang) sleep 60; echo "PROBE-GATE: blocked after sleeping" >&2; exit 2 ;;
*) echo "unknown mode $mode" >&2; exit 1 ;;
esac