﻿# Pydantic AI tool approval can carry reviewed argument overrides

Pydantic AI deferred approvals correlate to tool-call IDs and can replace arguments through ToolApproved.override_args; review must cover the arguments actually executed.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-pydantic-ai-approved-argument-override/
Language: en

## Preserve the proposed action for review

A research agent proposes updating a shared annotation file, but a person must review the destination and content first. Pydantic AI's [deferred-tool guide](https://pydantic.dev/docs/ai/tools-toolsets/deferred-tools/) can end the run with approval requests containing tool name, validated arguments and tool-call identity. Persist that proposal with its conversation state. Asking the model to recreate the action after review can produce a different destination or payload.

## Distinguish permission from reviewed editing

The [tool API](https://pydantic.dev/docs/ai/api/pydantic-ai/tools/) defines `ToolApproved` with optional `override_args`. A reviewer can therefore approve an adjusted action rather than merely accept the original arguments. Display and retain the effective arguments that the tool will receive. An approval label beside the original proposal is misleading when the application silently supplies a different destination or changed content through the override.

## Return decisions under the original call identity

Approval results map to the tool-call identifiers emitted by the preceding run. A denial can carry a message for the model through `ToolDenied`. Keep those identifiers intact when decisions arrive asynchronously or a review screen contains several calls. Do not match solely by tool name: repeated invocations of the same update tool can refer to different files and require different reviewer decisions.

## Continue from the pending conversation

The [history guide](https://pydantic.dev/docs/ai/core-concepts/message-history/) explains deferred results at the current conversation frontier. Resume using the original history or conversation together with correlated results. The continuation resolves pending work; it should not be treated as a new unconnected instruction asking the model to guess what was previously approved. [Task contracts](/journal/learn-codex-task-contract/) can identify the expected revised artifact and the conditions under which the update is acceptable.

## Keep application authorization inside the execution boundary

Approval guards the model's behavior, while a tool must still enforce the caller's authority over the target resource. The deferred-tool documentation explicitly warns about client-submitted approvals and stateless endpoints. [Tool observations](/journal/learn-codex-tool-observation/) should link the reviewed proposal, effective arguments, decision and actual write result. This gives a concrete record of what a person reviewed without turning an approval object into evidence that every client-supplied target is authorized.
