Skip to content

v0.106.0 — human-in-the-loop tool approval

Choose a tag to compare

@wishborn wishborn released this 07 Jul 01:28

Client-executed tools + human-in-the-loop approval (fork issue #4, phase 1)

Clean-room reimplementation of upstream prism-php#932 (the most-requested upstream feature, prism-php#921), wired end-to-end for Anthropic and OpenAI Text + Structured:

  • Tool::clientExecuted() — the tool is sent to the model but executed by your application: the request loop stops and pending tool calls come back on the response; resume by appending a ToolResultMessage with your results.
  • Tool::requiresApproval(bool|Closure) — execution pauses for an approval decision. Pending calls surface as ToolApprovalRequests (server-generated ids) on the assistant message and step; resume with ToolApprovalResponses. Deny-by-default: unanswered or denied requests produce denial results, never execution.
  • ToolApprovalRequestEvent stream event type + broadcast mapping (ToolApprovalRequestBroadcast) for realtime approval UIs.
  • Providers not yet wired keep their exact previous behavior (legacy callTools path untouched). Streaming emission + remaining providers tracked in fork issue #4.
  • Ports the upstream PR's unit suite (39 tests).

Security

  • Replicate generated-image auto-download hardened (closes #5): https-only, host allowlist (replicate.delivery default, configurable), 30s timeout, 25MB cap — per the v0.105.0 release audit.

Suite: 1866 passing, PHPStan clean.