# awrite_approval_mode

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/approval_mode/awrite_approval_mode)

Persist approval mode through an agent's remote store client.

## Signature

```python
awrite_approval_mode(
    agent: object,
    thread_id: str,
    *,
    mode: ApprovalMode | str | None = None,
    auto_approve: bool | None = None,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `agent` | `object` | Yes | Agent object. Remote agents expose `aput_store_item`. |
| `thread_id` | `str` | Yes | LangGraph thread id for the active session. |
| `mode` | `ApprovalMode \| str \| None` | No | Explicit approval mode. (default: `None`) |
| `auto_approve` | `bool \| None` | No | Compatibility input for the previous Boolean API. (default: `None`) |

## Returns

`str | None`

Store key written, or `None` when the agent has no store writer.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/7794b61a6e76230e8c7a49bdce808b3728305914/libs/code/deepagents_code/approval_mode.py#L212)