> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Copy focused PHP patterns for tools, approvals, streaming, and bounded runs.

## Approval-gated deployment

```php theme={null}
$deploy = new Tool(
    id: "deploy",
    description: "Deploy the selected release",
    requireApproval: true,
    execute: fn (array $input, $runtime) => $deployments->deploy($input)
);
```

Persist the returned run when it enters `waiting_for_human`, then continue it with a decision keyed by the pending call ID.

## Stream text

```php theme={null}
$stream = $agent->stream(input: $prompt, client: $client);
foreach ($stream->textStream() as $delta) { echo $delta; }
$result = $stream->getResult();
```

## Bound autonomous work

Combine step, token, cost, and duration conditions so an agent cannot exceed the application budget even when it keeps finding useful work.

See [tools](./agent-sdk-tools), [state and approval](./agent-sdk-state-and-approval), and [stop conditions](./agent-sdk-stop-conditions) for the complete contracts.
