v1.5.0 — Multi-agent enforcement: agent-mode + 5 new rules
Added
- Agent-mode detection (
src/agent-detection.ts). Process is in agent mode when GIT_GUARDRAILS_AGENT_MODE=1 OR GIT_AUTHOR_EMAIL/GIT_COMMITTER_EMAIL matches ^ops-agent@.
agentOnly? flag on DangerousRule — rules can now apply only when agent mode is detected.
git checkout --ours/--theirs <path> blocked (universal). Picks one side of a conflict, discards the other.
git merge -X ours/theirs (and --strategy=ours, -s ours) blocked (universal). Same rationale.
git config user.name/user.email at default scope blocked (universal). --global/--system allowed; --unset always allowed. Closes the worktree-shared-config identity-pollution trap (2026-05-04 incident in rubber repo).
git push <ref>:develop (and :main/:master/:production) blocked in agent mode. Closes the bypass-protection push pattern (2026-05-06 incident).
git push --no-verify blocked in agent mode. Hook chain is part of the only review layer for unattended runs.
Install
curl -fsSL https://raw.githubusercontent.com/josiahbryan/git-guardrails/main/scripts/install-remote.sh | bash