Skip to lesson
Exit
Block a risky command with a hook1 / 3

2 min lesson

Choose the hook event and failure mode

Choose the hook event and failure mode for one command that must be checked before execution.

Step 1 of 3

A hook can decide at the tool boundary, but the guard is trustworthy only after its allow, deny and failure paths are tested.

Decide before the shell runs

Interactive diagram. Step through it with the Next and Previous controls below, or Tab to a region to read its detail.

diagram: flow

The hook receives the command, then returns allow or deny.