Something went wrong. Try again.
A mental bridge between a hacker and their LLM(s) of choice.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031#!/usr/bin/env sh# Runs every case in scripts/guard-cases.txt (`allow<TAB>command` or# `deny<TAB>command`, one per line; blank lines and `#` comments skipped)# through scripts/guard-bash.sh, prints each mismatch, and exits 1 if any.set -u
here=$(dirname "$0")CLAUDE_PROJECT_DIR=$(cd "$here/.." && pwd)export CLAUDE_PROJECT_DIR
tab=$(printf '\t')cases=0failures=0
while IFS="$tab" read -r want cmd; do case "$want" in '' | '#'*) continue ;; esac cases=$((cases + 1)) jq -n --arg c "$cmd" '{tool_input: {command: $c}}' | sh "$here/guard-bash.sh" >/dev/null 2>&1 code=$? case "$want:$code" in allow:0 | deny:2) ;; *) echo "MISMATCH: expected $want, got exit $code: $cmd" failures=$((failures + 1)) ;; esacdone <"$here/guard-cases.txt"
echo "$cases cases, $failures mismatches"[ "$failures" -eq 0 ]