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

# ask_for_input, handoff

> [!NOTE]
>
> This feature is in **preview**. The API may change before general availability. To try it out, contact [support@intunedhq.com](mailto:support@intunedhq.com) and we'll enable it for your workspace.

Pause the Run to ask for input or hand over the browser. A person, your own system or an agent can answer. See [Human in the loop](https://intunedhq.com/docs/main/02-features/human-in-the-loop.md) for how interactions are delivered and answered.

## ask\_for\_input

```python theme={null}
from intuned_runtime.interactions import ask_for_input

async def ask_for_input(
    prompt: str,
    *,
    schema: type[BaseModel] | None = None,
    url: str | None = None,
    headers: dict[str, str] | None = None,
    timeout: float | None = None,
    extend_run_timeout: bool = True,
) -> Any: ...
```

Asks a question and waits for the JSON answer.

**Parameters**

| Name | Type | Description |
| - | - | - |
| `prompt` | `str` | The question shown to whoever answers. |
| `schema` | `type[BaseModel]` | Optional. A Pydantic model the answer is validated into. Its JSON Schema is sent so whoever answers knows what to submit. |
| `url` | `str` | Optional. Public HTTPS URL that receives the interaction with its `inputUrl`. |
| `headers` | `dict[str, str]` | Optional. Headers sent with the delivery to `url`. |
| `timeout` | `float` | Optional. Seconds to wait. Default 15 minutes, max 60 minutes. |
| `extend_run_timeout` | `bool` | Optional. Keep the Run alive while waiting. Default `True`. |

**Returns**

An instance of `schema` when you pass one, otherwise the parsed JSON.

## handoff

```python theme={null}
from intuned_runtime.interactions import handoff

async def handoff(
    prompt: str | None = None,
    *,
    url: str | None = None,
    headers: dict[str, str] | None = None,
    timeout: float | None = None,
    extend_run_timeout: bool = True,
) -> None: ...
```

Hands over live control of the Run's browser. Returns when **Done** is pressed. Needs `headful` set to `true` in Intuned.json.

**Parameters**

| Name | Type | Description |
| - | - | - |
| `prompt` | `str` | Optional. Instructions shown on the handoff page. |
| `url` | `str` | Optional. Public HTTPS URL that receives the interaction with its `handoffUrl`. |
| `headers` | `dict[str, str]` | Optional. Headers sent with the delivery to `url`. |
| `timeout` | `float` | Optional. Seconds to wait. Default 10 minutes, max 30 minutes. |
| `extend_run_timeout` | `bool` | Optional. Keep the Run alive while waiting. Default `True`. |

**Returns**

`None`, once **Done** is pressed.

Cancelling the task that awaits either function stops the interaction.

## Errors

| Error | Raised when |
| - | - |
| `InteractionTimeoutError` | No one answered before `timeout`. |
| `InteractionCanceledError` | The interaction was canceled: **Cancel** on a handoff, the interaction's `cancelUrl`, or **Esc** in the terminal. |
| `InteractionDeliveryError` | `url` couldn't be reached after retries. |
| `InteractionInputValidationError` | The answer doesn't match `schema`. The answer is in its `input` attribute. |
| `HandoffActiveError` | `handoff` was called while another handoff is open in the Run. |
| `InteractionUnsupportedError` | Nobody can answer here: agent runs, non-interactive CLI runs, or `handoff` in a headless Run. |

All are exported from `intuned_runtime.interactions`.

## Related

* [Human in the loop](https://intunedhq.com/docs/main/02-features/human-in-the-loop.md) — How interactions are delivered and answered, the webhook payload, and best practices.
* [extend\_timeout](https://intunedhq.com/docs/main/05-references/runtime-sdk-python/extend-timeout.md) — Reset the timeout timer for the current attempt.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.