That real command trace shows why naive command-prefix allowlists fail even with a completely benign agent: prefix-matching git push * misses chained shell commands starting with cd and inline -c flags without anyone trying to bypass a rule.
Even wildcard patterns on bash strings are fragile because shell quoting, subshells, or scripts can still hide a push. For high-stakes boundaries like pushing branches or opening PRs, enforcing permissions at the credential or API-token scope—holding write tokens behind an approval proxy rather than inside the shell environment—is far harder to trip over accidentally.