Foreman

The guard

A guard built for bypass mode

Foreman is meant to run without permission prompts, so the brake has to be real: it reads every Bash command and file edit before it runs, including the scripts a command calls.

What it refuses

  • Deletes outside the project, the home folder, the root.
  • Downloads piped into a shell, force pushes to the default branch, credential reads.
  • Edits to Foreman itself and its state, unless you say yes for that task.
  • Hidden ways to run code: tar -I, find -exec, git -c core.*, BASH_ENV, and scripts it reads line by line.
Guard refusals by ruleEvery block on record, all time. Most are Foreman protecting its own code and state.
corecore: 111111briefbrief: 8080state-directstate-direct: 3636pluginplugin: 2626rm-outsiderm-outside: 1515systemsystem: 1212pipe-shellpipe-shell: 88credentialscredentials: 44
Show the numbers
value
core111
brief80
state-direct36
plugin26
rm-outside15
system12
pipe-shell8
credentials4

It fails closed, and saves your work

If the guard crashes or times out, the call is blocked. Before git reset --hard, checkout -- . or clean -f, Foreman snapshots your uncommitted work; fm oops --apply brings it back. Every change to the guard is replayed against thousands of real commands to show what it would newly block or allow.

Hook time per event, p95Measured by bench_hooks.py; the dashed tick is each hook's budget.
PreToolUse:Bash:scriptPreToolUse:Bash:script: 274 ms274 msbudget 300 msPreToolUse:BashPreToolUse:Bash: 67.1 ms67.1 msbudget 150 msPreToolUse:EditPreToolUse:Edit: 56.5 ms56.5 msbudget 150 msPreToolUse:Bash:blockPreToolUse:Bash:block: 48.7 ms48.7 msbudget 150 ms
Show the numbers
valuebudget
PreToolUse:Bash:script274300
PreToolUse:Bash67.1150
PreToolUse:Edit56.5150
PreToolUse:Bash:block48.7150

Next: Permissions