Examples: approval¶
Human review, durable stores, resume once. Back to the Examples gallery. Files here: 11.
| File | Shows | Install | Run | Docs |
|---|---|---|---|---|
examples/approval.py |
Approval: a conditional confirm rule, in-process ports, and the deferred round trip. | pip install agent-adapter |
python examples/approval.py |
Approval (human in the loop) |
examples/approval_memory.py |
Approval memory: past decisions as advice, a proposed rule, and a person who accepts it. | pip install agent-adapter |
python examples/approval_memory.py |
Approval memory |
examples/approval_stores.py |
Durable approval stores: park a call in SQLite, decide it, resume it in another process. | pip install agent-adapter; optional: pip install "agent-adapter[redis]" |
python examples/approval_stores.py |
Approval stores |
examples/approval_stores_sql.py |
Database approval stores: park a call in SQL (or DynamoDB), decide it, resume it once. | pip install "agent-adapter[sqlalchemy]"; optional: pip install "agent-adapter[dynamodb]" |
python examples/approval_stores_sql.py |
Database approval stores |
examples/audit_log.py |
Audit log: a signed record of a ticket desk's approvals and blocks, verified and exported. | pip install agent-adapter |
python examples/audit_log.py |
Audit log |
examples/audit_ship.py |
Ship audit records elsewhere: a museum's ticket approvals sent to a collector, then checked. | pip install agent-adapter |
python examples/audit_ship.py |
Audit log in production |
examples/guardrails.py |
Guardrails: block, redact or approve personal data and secrets in tool calls and replies. | pip install agent-adapter |
python examples/guardrails.py |
Guardrails |
examples/guide_migrate_approval.py |
Migration: from a hand-rolled "needs approval" dict to confirm= and DeferredApproval. | pip install agent-adapter |
python examples/guide_migrate_approval.py |
From a hand-rolled approval flow |
examples/hello_approval.py |
Human approval in a few lines: park a call in SQLite, resume it by its approval id. | pip install agent-adapter |
python examples/hello_approval.py |
Resume a parked call |
examples/howto_hitl.py |
Human in the loop: pause a call for review, resume it, edit it, deny it, use it once. | pip install agent-adapter |
python examples/howto_hitl.py |
Human in the loop |
examples/policy_shop.py |
Policy file: one file sets access, approvals, guards and budgets for every surface. | pip install agent-adapter |
python examples/policy_shop.py |
Policy file |