Use case · Pydantic AI
Human-in-the-loop approvals for Pydantic AI agents
Pydantic AI gives you typed agents and tools; Seal adds the human gate on the risky ones. Call gate.require() inside a tool function and the agent waits for approval before acting, with a tamper-evident audit trail for every decision.
@agent.tool
async def transfer(ctx, amount: int, to: str):
await gate.require("payments.transfer", { amount, to })Where it fits
- ›Gate a typed tool that performs an irreversible action
- ›Require approval above a policy threshold
- ›Keep a verifiable record of each approved action
Frequently asked questions
How do I add human-in-the-loop to a Pydantic AI agent?+
Call gate.require() at the top of a tool function decorated with @agent.tool. The tool blocks until a human approves, then runs — or fails closed on reject or timeout — while Pydantic AI's typing and validation stay unchanged.
Does Seal validate the tool payload?+
Seal parses the payload it receives with its own schema at the border and fails closed on anything malformed, complementing Pydantic's model validation on the agent side.