Finding a pending confirmation
The run pauses inawaiting_input — the same state as a question. To tell them apart, read pending_confirmation from GET /v1/loom/threads:
summary is built for exactly this purpose — render it as the approval prompt rather than showing raw arguments. risk is the effective risk level after any agent-level overrides, and is a reasonable input to how prominent you make the confirmation.
If you use realtime, the write.confirmation_requested event carries the same tool_call_id, patch_ref, summary, and risk the moment the run pauses.
Approving
202. Patchwork performs the write server-side, records the result on the tool call, and resumes the model loop so the agent can report back. Poll the run or wait for run.completed.
Rejecting
detail is optional, recorded on the tool call, and passed to the model, so a short reason produces a better next turn than a bare rejection.
When an approved write fails
Approval is permission, not a guarantee. If the write is attempted and your endpoint errors, the run does not fail — the error is handed to the model so it can explain what happened, and the tool call is recorded with statusfailed.
Your POST /confirm still returns 202. Check the run’s outcome, or the trace, to see whether the write actually succeeded.
Do not post a message instead
While a confirmation is pending, posting a message to the thread is rejected:Errors
A confirmation can only be resolved once. A second call for the same
tool_call_id returns unknown_confirmation, because the call is no longer pending.