HTTP client for the AEGIS HITL Reliability Layer — exactly-once human-in-the-loop approvals for AI agents
Project description
aegis-idempotency
Note: The final distribution name on PyPI will be confirmed before publishing. The package import name is
aegis_hitlregardless of the distribution name.
HTTP client for the AEGIS HITL Reliability Layer — exactly-once human-in-the-loop approvals for AI agents.
Installation
pip install aegis-idempotency
Quick Start
import asyncio
from aegis_hitl import AegisClient
async def main():
async with AegisClient(
base_url="http://localhost:8000",
tenant_id="my-tenant",
thread_id="my-thread",
) as client:
# Approve a pending agent action
response = await client.approve("idempotency-key-001")
print(response.status_code) # 202
asyncio.run(main())
API Reference
AegisClient(base_url, *, tenant_id, thread_id, timeout, client)
| Parameter | Type | Default | Description |
|---|---|---|---|
base_url |
str |
"http://localhost:8000" |
AEGIS server URL |
tenant_id |
str | None |
None |
Default tenant; override per call |
thread_id |
str | None |
None |
Default thread; override per call |
timeout |
float |
10.0 |
Request timeout in seconds |
client |
httpx.AsyncClient | None |
None |
Inject an existing httpx client |
Must be used as an async context manager (async with).
Methods
| Method | Endpoint | Description |
|---|---|---|
approve(idempotency_key, *, tenant_id, thread_id, payload) |
POST /hitl/approve |
Approve a pending action |
reject(idempotency_key, *, tenant_id, thread_id, payload) |
POST /hitl/reject |
Reject a pending action |
execute(action, idempotency_key, ...) |
POST /hitl/{action} |
Generic approve/reject dispatcher |
get_status(request_id) |
GET /hitl/status/{id} |
Query action status |
Response Status Codes
| Code | Meaning |
|---|---|
202 |
Action processed successfully |
409 |
Duplicate request (idempotency key already used) |
500 |
Internal server error |
Publishing
To publish to PyPI (when ready):
python -m build
twine check dist/*
twine upload dist/* # requires PyPI account and token
Warning: Confirm the distribution name availability on PyPI before uploading.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aegis_idempotency-0.1.0.tar.gz.
File metadata
- Download URL: aegis_idempotency-0.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a144f81f873d5f9880ef0a002ae4af4563fe21be145afa35eed1393d0cb3e70c
|
|
| MD5 |
752d59d969473fa4eb4259007d2129f5
|
|
| BLAKE2b-256 |
4841436c0aa89ed81eb7301b7a1a3d9f1020e4fea1835fcc7453d4b3bb094435
|
File details
Details for the file aegis_idempotency-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aegis_idempotency-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b544872919b6ad84c617488f5f743e85eb80aaf56b57175a1bc6ba5019d85d04
|
|
| MD5 |
b77dee40b20b92665f2c5ad85ca5c6a3
|
|
| BLAKE2b-256 |
4576ed1a8b701a78a41f63f7e61c32254a200c34faf339a67bfa60d745d6cc71
|