Loading...
#!/bin/bash
git log -50
cat docs/*.md#!/bin/bash
prompt=$(jq -r '.prompt')
if echo "$prompt" | grep -qE 'sk-[A-Za-z0-9]{20,}|AKIA[0-9A-Z]{16}'; then
echo "Prompt blocked: it looks like it contains an API key." >&2
exit 2
fi
echo "Current branch: $(git branch --show-current)"The hook adds one short line of context and blocks prompts with keys, instead of dumping long logs into every request.
Yes, it runs each time the user sends a prompt, so anything it adds is paid for in tokens on every request.
Yes. It can stop the prompt before it reaches the model and show the user why, for example when it contains a secret.
Small, changing facts like the current branch, ticket ID or date. Stable rules belong in the instructions file instead.