Skip to main content

hibira-approvals

Human approvals for AI agents over Hibira realtime channels, for Python. When a LangGraph node needs a person's OK, the call waits in a live inbox; reviewers approve, edit or reject it, and the graph resumes with their answer.

It speaks the same protocol as the npm package @hibira-io/approvals, so its React and Vue inbox components work against a Python backend unchanged.

The inbox: requests on the left, the open one on the right

Install

pip install "hibira-approvals[pusher,fastapi]"

Use with LangGraph

import pusher
from langgraph.types import Command, interrupt

from hibira_approvals import Approvals
from hibira_approvals.langgraph import approval, approval_calls, resume_value

client = pusher.Pusher(app_id=..., key=..., secret=..., host="ws.hibira.io", ssl=True)


def refund_node(state):
    answer = interrupt(approval("refund_order", {"order": state["order"]}))
    if not answer["approved"]:
        return {"log": [f"skipped: {answer['reason']}"]}
    return {"log": [refund(answer["input"])]}  # the edited input when the reviewer changed it


async def resume(request):
    config = {"configurable": {"thread_id": request["metadata"]["thread_id"]}}
    await graph.ainvoke(Command(resume=resume_value(request)), config)


approvals = Approvals(client, scope="support", resume=resume)

paused = await graph.ainvoke({"order": 1042}, config)
calls, title = approval_calls(paused)  # parallel interrupts become one request
if calls:
    await approvals.request(calls, agent="Support agent", title=title, metadata={"thread_id": "t1"})

approvals.wait(id) polls until a request is decided, for workers that keep the graph waiting in place.

Routes for the inbox components

from fastapi import FastAPI
from hibira_approvals.fastapi import approvals_router

app = FastAPI()
app.include_router(
    approvals_router(approvals, get_user=current_user, can_review=lambda user, request: user["role"] == "admin"),
    prefix="/api/approvals",
)

get_user(request) returns {"id", "name", "avatar"} or None. The router also serves POST /auth for the Pusher channel authorization.

Requests live in memory by default; pass store= with async create, get, list and an atomic update(id, fn) over your database.

License

MIT

Metadata

Release files for hibira-approvals 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hibira-approvals 0.1.0
File Size Uploaded Provenance Actions
hibira_approvals-0.1.0.tar.gz 11.8 kB With provenance Details for hibira_approvals-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hibira-approvals 0.1.0
File Interpreter ABI Platform Actions
hibira_approvals-0.1.0-py3-none-any.whl Python 3 none any Details for hibira_approvals-0.1.0-py3-none-any.whl

Total release size: 22.9 kB

Release files / hibira_approvals-0.1.0.tar.gz

Download URL hibira_approvals-0.1.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a60663caf2b6735c838a3e74c199394a4714bf00d6ccd221e4a690215782d560
BLAKE2b-256 checksum
How to use checksums
f5d3128193268826d97321d8046c1eb4b293e74ee7bb866417113a8a3703556b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / hibira_approvals-0.1.0-py3-none-any.whl

Download URL hibira_approvals-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c49ec3fed3adfcba63dcb62cfccc424b6cd93f8b1ef720bd1372437c7f0a4ba0
BLAKE2b-256 checksum
How to use checksums
d80263b06b0b9f5105340c42e57e25b3d2d2358975126ddfbc032920df5e4ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for hibira-approvals 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hibira_approvals-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page