Optional predicate controlling whether to interrupt for a given tool call.
Receives a ToolCallRequest and returns True to interrupt or False to
auto-approve. The predicate is called during after_model before the tool
call is added to the batched human-in-the-loop request.
The request is constructed with tool=None and a new ToolRuntime. The
ToolRuntime copies context, store, stream_writer, execution_info,
and server_info from the node-level Runtime, while tool_call_id is
populated from the current tool call. The tools argument is not supplied,
so it uses its default empty list.
Example:
# Only interrupt delete_file calls targeting /etc
config = InterruptOnConfig(
allowed_decisions=["approve", "reject"],
when=lambda req: req.tool_call["args"].get("path", "").startswith("/etc"),
)