Skip to main content

hallpass-client

The Python client for hallpass: before your AI agent acts for a user, ask the system that owns the resource whether that user may do it.

pip install hallpass-client

It is on PyPI, and every hallpass release also carries it as a download. Its version matches the hallpass release, so pin the one you run, e.g. hallpass-client==0.4.0.

It needs a running hallpass service. The client has no dependencies beyond the standard library.

from contextvars import ContextVar
from hallpass_client import Hallpass, guarded

hp = Hallpass()  # HALLPASS_URL and HALLPASS_API_KEY from the environment
current_user: ContextVar[str] = ContextVar("current_user")

@tool  # LangChain, Strands, MCP, the Claude Agent SDK...
@guarded(hp, "jira-main", "DELETE_ISSUES", "issue:{key}", user=current_user, fresh=True)
def delete_issue(key: str) -> str:
    jira.delete_issue(key)  # the agent's own credential, only after hallpass said allow
    return f"deleted {key}"

current_user.set(request.user.email)  # from your auth, per request or session
  • The model never picks the user. It comes from user=: a string, a zero-argument callable, or a ContextVar your application sets. A user key in the tool's arguments is ignored.
  • It fails closed. deny, unknown and hallpass being unreachable all raise PermissionDenied before the body runs. Pass deny= to return a message to the model instead.
  • One package covers every framework. guarded handles plain functions, async def, and the Claude Agent SDK's async def f(args: dict) handler shape.

Without a decorator:

d = hp.check("dana@example.com", "jira-main", "DELETE_ISSUES", "issue:PAY-123")
d.decision, d.reason        # "deny", "denied: ..."
hp.require(...)             # raises PermissionDenied unless allow

Framework examples: examples/agent. The guide: docs/guides/agent-tools.md.

Release files for hallpass-client 0.4.1

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

Source distribution (sdist)

Source distribution for hallpass-client 0.4.1
File Size Uploaded
hallpass_client-0.4.1.tar.gz 12.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hallpass-client 0.4.1
File Interpreter ABI Platform
hallpass_client-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / hallpass_client-0.4.1.tar.gz

Download URL hallpass_client-0.4.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1ade8c0a24506c7e9b7e4bdeb025979a69a3d1f3c5067418226a37d643e6fd7d
BLAKE2b-256 checksum
How to use checksums
138ed907cd6a698858283fee8655ab2c947d581af085cb0107d0a778c49b7f36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release files / hallpass_client-0.4.1-py3-none-any.whl

Download URL hallpass_client-0.4.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be9b51c155d2b870ae77f0b02254d656c30c11793383bdbde7fb733e4998ac3d
BLAKE2b-256 checksum
How to use checksums
cbf26af6363c5d3242d2b53e6b56292987343eca593b40a9f64a1ed1e68383b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

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