Prerequisites
- Python 3.10 or higher
- PostgreSQL with pgvector (setup instructions below)
- OpenAI API key
Code
hitl_confirmation.py
Testing the Example
Once the server is running, test the HITL flow:tools value. Non-admin users receive 403 if a required approval is still pending.
Approval Status API
Poll a single approval record:approval_id. Store that ID and poll for status changes. Admins with the approvals:write scope can continue once the approval is resolved.