An agent wired with a patch set to Always ask cannot perform that write on its own. It pauses and waits for a human.
This example assumes a connection and a write patch wired with Always ask. See Confirmations for the semantics.
1. Detect the pause
A run that stops shows awaiting_input, which is also what a question looks like. The thread list distinguishes them:
With realtime, the same payload arrives as write.confirmation_requested the moment the run pauses, and you skip the polling entirely.
2. Render the prompt
summary exists so you never have to render raw arguments:
Let risk drive how much friction you add. A low write can be a single button; a critical one deserves a typed confirmation.
3. Decide
On approve, Patchwork performs the write itself and resumes the model loop. On reject, nothing runs and the model is told — a short reason gets you a far better next turn than a bare refusal.
4. Confirm it actually happened
A 202 from the confirm call means your decision was accepted, not that the write succeeded. If an approved write fails, the run keeps going so the agent can explain, and the tool call is recorded as failed. Read the run, or the trace, before telling a user the money moved.
Check the tool call in the trace when you need certainty:
Do not post a message instead
While a decision is pending, posting to the thread is refused with 422 awaiting_confirmation. The gate is the only way through.