HaltState Sentinel SDK
Private reads and buffered replies
Use PrivateFlowClient or AsyncPrivateFlowClient on your application server.
Call authorize_read before fetching a private record and authorize_reply
with a distinct operation ID and the immutable bytes you will send. Proceed at
each gate only on decision == "ALLOW" and may_proceed is True. Replayed receipts
are evidence only. Follow the setup and integration guide.
Compliance & policy checks for AI agents. Perform pre-action checks, approvals, and post-action reporting with minimal code.
Canonical public base URL: https://haltstate.ai
Canonical governance namespace: /api/haltstate/sentinel/*
Current SDKs default to https://haltstate.ai and target /api/haltstate/sentinel/* first. They still fall back to legacy /api/sentinel/* aliases when needed.
Installation
pip install haltstate-sdk
Quickstart (sync)
from haltstate import HaltStateClient
client = HaltStateClient(
tenant_id="your_tenant_id",
api_key="hs_xyz",
base_url="https://haltstate.ai",
fail_open=False,
)
decision = client.check(
action="payment.process",
params={"amount": 5000, "currency": "USD"},
agent_id="payment-bot-01",
)
if decision.allowed:
process_payment(...)
client.report(decision, status="success", result={"transaction_id": "tx_123"}, action="payment.process", agent_id="payment-bot-01")
elif decision.requires_approval:
print(f"Approval required: {decision.reason}")
else:
print(f"Action denied: {decision.reason}")
Backward Compatibility
Existing code using janus imports continues to work:
from janus import JanusClient # Still works!
Guard Pattern
For actions requiring human approval, use the idempotent guard pattern:
from haltstate import AsyncHaltStateClient, ApprovalPending, ActionDenied
async def process_high_value_payment(invoice_id: str, amount: float):
client = AsyncHaltStateClient(
tenant_id="acme",
api_key="hs_xxx",
base_url="https://haltstate.ai",
)
try:
async with client.guard(
action="payment.process",
agent_id="payment-bot",
params={"invoice_id": invoice_id, "amount": amount},
idempotency_key=f"payment-{invoice_id}", # Retry-safe
timeout_seconds=300
) as permit:
# Only executes after human approval
result = await execute_payment(amount)
print(f"Approved by {permit.approver} at {permit.approved_at}")
return result
except ApprovalPending:
print("Awaiting human approval...")
return {"status": "pending"}
except ActionDenied as e:
print(f"Rejected by {e.rejected_by}: {e.reason}")
raise
Key features:
- Idempotency keys: Same key = same approval request, safe for retries
- Process restart safety: Approved actions can be executed after restart
- Audit trail: Full record of who approved and when
Decorators
from haltstate import HaltStateClient, haltstate_guard
client = HaltStateClient(tenant_id="acme", api_key="hs_xxx", base_url="https://haltstate.ai")
@haltstate_guard(client, action="email.send", agent_id="email-bot")
def send_email(to, subject, body):
return mailer.send(to, subject, body)
Async
from haltstate import AsyncHaltStateClient
async def main():
async with AsyncHaltStateClient(tenant_id="acme", api_key="hs_xxx", base_url="https://haltstate.ai") as client:
res = await client.check("database.drop", params={"table": "users"})
if res.allowed:
await client.report(res, status="success", action="database.drop", agent_id="ops-bot")
Exceptions
from haltstate import (
HaltStateError, # Base error
HaltStateAuthError, # Invalid API key
HaltStateConnectionError, # Network/timeout
ApprovalPending, # Awaiting approval (guard pattern)
ActionDenied, # Human rejected (guard pattern)
ActionExpired, # Approval expired (guard pattern)
)
Docs
Start with the Python SDK guide. The documentation index also covers:
- Quickstart - 5-minute setup
- Guard Pattern - HITL approval flow
- API Reference - All methods
- Error Handling - Exception handling
- SB-53 Compliance - Regulatory mapping
Legacy Sentinel-prefixed routes remain supported as compatibility aliases, but new integrations should target the HaltState-branded public contract.
Migration from janus-sdk
If upgrading from janus-sdk:
# Old (still works)
from janus import JanusClient, janus_guard
# New
from haltstate import HaltStateClient, haltstate_guard
Both import styles work - no code changes required for existing users.
License
MIT
Metadata
Release files for haltstate-sdk 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| haltstate_sdk-0.7.2.tar.gz | 22.6 kB | Without provenance | Details for haltstate_sdk-0.7.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| haltstate_sdk-0.7.2-py3-none-any.whl | Python 3 | none | any | Details for haltstate_sdk-0.7.2-py3-none-any.whl |
Total release size: 45.2 kB
Release files / haltstate_sdk-0.7.2.tar.gz
| Download URL | haltstate_sdk-0.7.2.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
692e5b52d2415b0d9d797bbed7280000883759af382f826c06659778a93211f4
|
|
BLAKE2b-256 checksum How to use checksums |
53113f0b80401e5aefd153e4674a721ecc64e5e5a6aab61b1eb3ac94bd3079e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / haltstate_sdk-0.7.2-py3-none-any.whl
| Download URL | haltstate_sdk-0.7.2-py3-none-any.whl |
|---|---|
| Size | 22.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5ed7ef962ff61e51567977a3ba31d6b1f995cb17f3089ad87a03c65873256aa
|
|
BLAKE2b-256 checksum How to use checksums |
a0c408940c9b73d91921320409167b15ee63389ef2795995e2e7b1c509587f12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for haltstate-sdk 0.7.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.