Command replay (a class of call, not one reported incident)
Stop an agent trying to force push over git history
What happens
Force push to a feature branch. The call below tries to force push over git history. The agent sends it through its Bash tool, and it involves Git.
The call
git push --force origin feature
Tool: Bash. The replay uses placeholder tokens and hosts only.
Fix it without us
Add a branch ruleset on the server that blocks force pushes, or set receive.denyNonFastForwards on a server you run yourself. A ruleset can be skipped by its bypass actors and by administrators unless you enforce it for them, so the agent's token must not belong to either.
What KYA does
Replay result: Stopped. In the replay test, the local hook denies the call and names the rule.
Rule git-force-push, first stopped in version 0.33.0.
The hook is local and advisory. It fails open: if kya breaks or times out, the call goes ahead.
Install
For Claude Code, the host this replay ran on:
/plugin marketplace add The-Pixel-Boys/shield-kya
/plugin install kya@shield-kya
For any host:
npm i -g @shield-agent/kya@latest && kya start