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 https://github.com/roee-hersh/hallpass/releases/latest/download/hallpass-client-python.tar.gz

That URL always gives the latest release. In a project, pin a version by replacing latest/download with download/v0.4.0, in requirements.txt too:

hallpass-client @ https://github.com/roee-hersh/hallpass/releases/download/v0.4.0/hallpass-client-python.tar.gz

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/agents.md.

Release files for hallpass-client 0.4.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 hallpass-client 0.4.0
File Size Uploaded
hallpass_client-0.4.0.tar.gz 12.4 kB Details

Built distribution (wheel)

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

Total release size: 24.8 kB

Release files / hallpass_client-0.4.0.tar.gz

Download URL hallpass_client-0.4.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f691eab97f2d732d69554cfcae7738508e7e15344ec525081d50cbaca35f0996
BLAKE2b-256 checksum
How to use checksums
2d151b1d57569868844f74ff86effc9061e0a937d7bf515e03e79827ec0d358c
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.0-py3-none-any.whl

Download URL hallpass_client-0.4.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a45300e856ec37aced245e1cd5e193b7f9d98a877de30f92c6902d918130e5f5
BLAKE2b-256 checksum
How to use checksums
36de8ddd1b8690259683245a7b54661af5b632806852464b9f264ac989381a49
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.0 This release

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