A 311 assistant must attach the current service-outage list to every resident message, and must block any message containing a full Social Security number before the model can see it. Which hook event handles both requirements?
Select an answer to reveal the explanation.
Short Explanation
UserPromptSubmit sits between the resident hitting send and the model reading anything. From there it can staple the outage list on, or refuse the message outright.
Full Explanation
Two requirements here look different but share a position in time: one adds material to each inbound message, the other must keep material from reaching the model at all. Both are properties of the moment between submission and processing, so the hook that owns that moment satisfies both.
UserPromptSubmit fires when the resident submits a message and before the prompt is processed. From there it can prepend the current service-outage list to that specific message—which also keeps the list fresh, since outages change through the day—and it can block a message containing a full Social Security number before any of it enters the model's context. Enforcing both in hook code makes them deterministic rather than dependent on model compliance.
PreToolUse governs tool invocations, so it fires on the wrong objects and too late to filter inbound resident text; SessionStart runs once at the beginning and has no visibility into individual messages, so it can neither screen them nor keep an outage list current across a long shift; PostToolUse acts after execution, meaning any redaction happens once the model has already processed the sensitive content, which fails the requirement outright.
Exam caveat: never sees it is a strong claim, and a detector that misses an unusual number format lets the content straight through, so the hook's matching logic is the real control surface. Operational check: submit a test message containing a formatted Social Security number and confirm no fragment of it appears in the context the model received, checking that transcript rather than the resident-facing view.