← Table of Contents · Page 257 of 868

LIFECYCLE HOOKS

Part 11 of 11

CHECK YOUR UNDERSTANDING • Why are hooks more reliable than instructions to the model? ◦ Answer: Hooks are ordinary code that runs every time, while the model may forget or misunderstand a request. • What is the difference between a deny-list and an allow-list? ◦ Answer: A deny-list blocks known bad patterns, while an allow-list permits only approved actions and blocks the rest. • When should an approval hook be used? ◦ Answer: For risky or irreversible actions such as moving money or deleting production data. • Why must continuation hooks have a cap? ◦ Answer: Without a cap they could cause endless loops and wasted budget. • What should a safety hook do if it crashes? ◦ Answer: Fail safe by blocking the action instead of allowing it.
Advertisement
Read Aloud:
0:00 / 0:00