Laravel AI SDK: Human-in-the-Loop Tool Approval | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Laravel AI SDK Adds Human-in-the-Loop Tool Approval        On this page       1. [  Laravel AI SDK v0.10.0 Brings Human-in-the-Loop Control to Agents ](#laravel-ai-sdk-v0100-brings-human-in-the-loop-control-to-agents)
2. [  Marking a Tool as Approvable ](#marking-a-tool-as-approvable)
3. [  Handling Pending Approvals ](#handling-pending-approvals)
4. [  Key Details to Know Before Upgrading ](#key-details-to-know-before-upgrading)
5. [  Breaking Changes in v0.10.0 ](#breaking-changes-in-v0100)
6. [  Takeaways ](#takeaways)

  ![Laravel AI SDK Adds Human-in-the-Loop Tool Approval](https://cdn.msaied.com/490/5b325ae6bad97a0aa3ab3648b55e994e.png)

 [  Laravel ](https://msaied.com/articles?category=laravel) [  AI ](https://msaied.com/articles?category=ai)  #Laravel AI SDK   #HITL   #AI Agents   #Laracon US 2026   #Tool Approval  

 Laravel AI SDK Adds Human-in-the-Loop Tool Approval 
=====================================================

     30 Jul 2026      3 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   Laravel AI SDK v0.10.0 Brings Human-in-the-Loop Control to Agents  ](#laravel-ai-sdk-v0100-brings-human-in-the-loop-control-to-agents)
2. [  02   Marking a Tool as Approvable  ](#marking-a-tool-as-approvable)
3. [  03   Handling Pending Approvals  ](#handling-pending-approvals)
4. [  04   Key Details to Know Before Upgrading  ](#key-details-to-know-before-upgrading)
5. [  05   Breaking Changes in v0.10.0  ](#breaking-changes-in-v0100)
6. [  06   Takeaways  ](#takeaways)

 Laravel AI SDK v0.10.0 Brings Human-in-the-Loop Control to Agents
-----------------------------------------------------------------

Announced at Laracon US 2026 in Boston and shipped on July 21, [Laravel AI SDK v0.10.0](https://github.com/laravel/ai/releases/tag/v0.10.0) introduces a **human-in-the-loop (HITL) API** for AI agents. Before this release, an agent that started executing tools ran straight through to completion with no way to intervene. That is acceptable for read-only operations, but it is a serious concern when a tool can delete a file, issue a refund, or send an email to a customer.

The new API lets you intercept specific tool calls, pause the agent, and require a human decision — approve, reject, or modify the arguments — before execution resumes.

Marking a Tool as Approvable
----------------------------

Approval is opt-in per tool. Implement the `Approvable` contract and add the `InteractsWithApprovals` trait:

```php
use Laravel\Ai\Concerns\InteractsWithApprovals;
use Laravel\Ai\Contracts\Approvable;
use Laravel\Ai\Contracts\Tool;

class IssueRefund implements Approvable, Tool
{
    use InteractsWithApprovals;

    public function handle(Request $request): Stringable|string
    {
        $order = Order::findOrFail($request['order_id']);
        $order->refund($request['amount']);
        return "Refunded {$request['amount']} on order {$order->id}.";
    }
}

```

When blanket approval is too broad, define a `needsApproval` method that inspects the incoming arguments and returns a boolean or an `Approval` instance with a reason:

```php
use Laravel\Ai\Approvals\Approval;

protected function needsApproval(Request $request): Approval|bool
{
    return $request['amount'] forUser($user)
    ->prompt('Refund the damaged headphones on order 4192.');

if ($response->hasPendingApprovals()) {
    foreach ($response->pendingApprovals as $approval) {
        // $approval->id, ->tool, ->arguments, ->reason
    }
}

```

To resume, continue the conversation and pass a `Decisions` instance keyed by tool call ID:

```php
use Laravel\Ai\Approvals\Decision;
use Laravel\Ai\Approvals\Decisions;

$response = (new SupportAgent)
    ->continue($conversationId, as: $user)
    ->prompt(Decisions::from([
        'call_abc' => Decision::approve(),
        'call_ghi' => Decision::reject('Outside the return window.'),
    ]));

```

Every pending call must receive a decision, or an `ApprovalMismatchException` is thrown. Use `approveRemaining()` or `rejectRemaining()` to set a bulk default for any calls not explicitly addressed.

Key Details to Know Before Upgrading
------------------------------------

- The agent must implement `Conversational` with persisted history (via `RemembersConversations`) — there is nothing to resume otherwise.
- HITL works with `prompt`, `stream`, `queue`, `broadcast`, `broadcastNow`, and `broadcastOnQueue`.
- During streaming, a pause arrives as a `tool_approval_request` event; queued agents dispatch a `ToolApprovalRequested` event.
- Pauses are **per call, not per step** — tools in the same step that do not require approval run immediately. Keep side effects idempotent using `$request->toolCallId()`.
- If generation fails after an approval result has already been stored, resume with a plain text prompt rather than resubmitting decisions.

### Breaking Changes in v0.10.0

- A new nullable `approval_state` column is added to the conversation messages table.
- Custom `ConversationStore` implementations must add a `storeApprovalResults()` method.

Takeaways
---------

- Approval is opt-in per tool via the `Approvable` contract and `InteractsWithApprovals` trait.
- `needsApproval()` lets you apply conditional logic based on tool arguments.
- Pending approvals are surfaced on the response and resumed via a `Decisions` instance.
- Streaming, broadcasting, and queued agents all support the HITL pause/resume flow.
- Upgrading requires a migration for the new `approval_state` column and a `storeApprovalResults()` method on custom stores.

Full documentation is available in the [Laravel AI SDK docs](https://laravel.com/docs/13.x/ai-sdk#human-tool-approval). Source: [Laravel News](https://laravel-news.com/laravel-ai-sdk-adds-human-in-the-loop-tool-approval)

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flaravel-ai-sdk-adds-human-in-the-loop-tool-approval&text=Laravel+AI+SDK+Adds+Human-in-the-Loop+Tool+Approval) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flaravel-ai-sdk-adds-human-in-the-loop-tool-approval) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  Does every tool call require human approval when using the HITL API?        No. Approval is opt-in per tool. You can make approval unconditional, apply conditional logic via a `needsApproval()` method that inspects the arguments, or override the requirement at the agent level with `withoutApproval()` and `requireApproval()`. 

      Q02  What happens if I do not provide a decision for every pending tool call?        An `ApprovalMismatchException` is thrown. You must supply a decision for every pending call, or use `approveRemaining()` / `rejectRemaining()` to set a default for any calls not explicitly addressed. 

      Q03  What are the breaking changes when upgrading to Laravel AI SDK v0.10.0?        Two breaking changes: a new nullable `approval_state` column is added to the conversation messages table (requiring a migration), and any custom `ConversationStore` implementation must add a `storeApprovalResults()` method. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals](https://cdn.msaied.com/493/a1d6434093b945e8a3291eb09c09e768.png) Pest PHP Testing PHP 8.4 

### Pest 5 Released: Test Impact Analysis, Agent Verification, and Evals

Pest v5 lands with the TIA engine that cut Laravel Cloud's 19,000-test suite from 3 minutes to 5 seconds, plus...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 31 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/pest-5-released-test-impact-analysis-agent-verification-and-evals) [ ![Job Batching, Chaining, and Rate-Limited Middleware in Laravel Queues](https://cdn.msaied.com/489/89d47dc6b618d5435f9d7f333b75e922.png) laravel queues jobs 

### Job Batching, Chaining, and Rate-Limited Middleware in Laravel Queues

Go beyond basic dispatch: learn how to compose Laravel job batches with callbacks, chain dependent jobs safely...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 30 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/job-batching-chaining-and-rate-limited-middleware-in-laravel-queues-3) [ ![Laravel Observers vs. Model Events: Choosing the Right Hook for Domain Side-Effects](https://cdn.msaied.com/488/451564d0a43aa33809619fa299027222.png) laravel eloquent domain-events 

### Laravel Observers vs. Model Events: Choosing the Right Hook for Domain Side-Effects

Model events and observers look similar but behave differently under bulk operations, transactions, and test i...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 30 Jul 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-observers-vs-model-events-choosing-the-right-hook-for-domain-side-effects) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
