You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Owner question: model guard: turn on "only managed hooks" so other hooks cannot change a checked call? #298
Recommendation: yes, turn on "only managed hooks" on each machine that runs the model guard, after moving the hooks you still want into the managed settings. Until then, the guard can be got around.
The question
PR #275 installs the model guard (a Claude Code hook that refuses model picks outside your policy) into Claude Code's managed settings. Only root can change that folder, and every Claude Code session reads it. That closes the hole the security review found: an agent could edit its own settings file and take the hook out.
One gap is left. Claude Code runs every matching hook at the same time, and a hook in a user or project settings file can change a call's input after the guard has checked it. An agent that can write its own settings file could add such a hook and change the model of a call that the guard already passed.
Claude Code's managed setting "allowManagedHooksOnly": true closes that gap: then only hooks in the managed settings run. But it also stops every hook in your own and your projects' Claude Code settings (for example the guard hooks and status hooks you use today), unless they are moved into the managed settings first.
Options
(Recommended) Turn it on, after moving the hooks you want to keep into the managed settings. The guard then cannot be got around this way. Cost: the hooks you still want live in a root-owned file, so changing them needs root.
Leave it off and accept the gap. Set "allowOtherHooks": true in the model-guard section of the machine file. The guard's self-check then stops reporting it. An agent that edits its own settings can still get around the guard.
What happens until you decide
The kit does not change this setting itself. Its self-check (model-guard --self-check) reports allowManagedHooksOnly is not true until you pick one of the two options. Everything else in the PR works either way.
changed the title [-]Model guard: turn on "only managed hooks" so other hooks cannot change a checked call?[/-][+]Owner question: model guard: turn on "only managed hooks" so other hooks cannot change a checked call?[/+]on Nov 29, 2026
Status on main dac2690: the repository side of option 1 is done. model-guard --self-check reports allowManagedHooksOnly is not true until it is set, unless allowOtherHooks allows other hooks (settings_problems in fork-kit/model-guard/lib/model_guard.py, with tests in guard.test.py and install.test.py). README step 4 describes the change. The agent-guards hooks already install into managed settings (managed-settings.d/agent-guards.json), so they keep running after the switch.
What is left is a root step on each machine, and no code can do it: move any user or project hooks you still need into managed settings, set "allowManagedHooksOnly": true, then run the self-check. A minors sweep has nothing to fix here.
Activity
scuttletoby commentedon Nov 22, 2026
Owner decision (in chat, 2026-11-22): option 1. Allow only root-owned hooks, after moving the hooks we use there.
Posted by the orchestrator from the owner's chat answer.
🤖 Generated with Claude Code
[-]Model guard: turn on "only managed hooks" so other hooks cannot change a checked call?[/-][+]Owner question: model guard: turn on "only managed hooks" so other hooks cannot change a checked call?[/+]scuttletoby commentedon Nov 30, 2026
Status on main dac2690: the repository side of option 1 is done.
model-guard --self-checkreportsallowManagedHooksOnly is not trueuntil it is set, unlessallowOtherHooksallows other hooks (settings_problemsinfork-kit/model-guard/lib/model_guard.py, with tests inguard.test.pyandinstall.test.py). README step 4 describes the change. The agent-guards hooks already install into managed settings (managed-settings.d/agent-guards.json), so they keep running after the switch.What is left is a root step on each machine, and no code can do it: move any user or project hooks you still need into managed settings, set
"allowManagedHooksOnly": true, then run the self-check. A minors sweep has nothing to fix here.🤖 Generated with Claude Code