Customer SDK for the Hawcx Agent Authentication Protocol (HAAP). Connects to a customer-deployed haap-supervisor and proxies tool calls through the Assembler per CS v7.2.5 Profile E.
Project description
hawcx-haap
Customer SDK for the Hawcx Agent Authentication Protocol (HAAP Canonical Specification v7.2.0, Profile E). Pure-Python, no native build.
Status: alpha (0.1.0a1). Public API may change. End-to-end testing against the real binary pipeline is pending alpha-2 closure of the RSV cascade adapter; the SDK is currently validated against a mock Assembler.
What it does
HawcxAgent connects to a customer-deployed haap-supervisor's
Assembler-agent socket and proxies Profile E tool calls. The supervisor and
its child processes are installed separately (via the hx_agentic_sdk release
tarball or Docker image); this SDK is just the language-side client.
Per CS §39, all cryptographic operations happen in the Assembler / TQS / Authenticator processes. The Python process never holds session keys or token material — process isolation is enforced by OS boundaries (Unix Domain Sockets on Linux/macOS, Named Pipes with DACL on Windows per CS §39.12).
Install
pip install hawcx-haap
Single pure-Python wheel; supports Python 3.10–3.13 on Linux, macOS, and Windows.
Prerequisites
- The
haap-supervisorpipeline (Authenticator + TQS-precompute + TQS-jit + Assembler + External Identity Broker + Supervisor — per HAAP CS v7.2.0 §45.2) must be running locally, installed from thehx_agentic_sdkrelease. - The agent identity must be pre-provisioned via the Hawcx Admin Console (Console → CAA → Authenticator flow per CS §4.6.3).
Quickstart
from hawcx_haap import HawcxAgent
with HawcxAgent.connect("/var/run/haap/research-u1/agent-assembler-0.sock") as agent:
response = agent.invoke(
target_rs_url="https://api.example.com/search",
http_method="POST",
headers={"Content-Type": "application/json"},
tool="search",
action=["read"],
body=b'{"query": "agents"}',
)
print(response.http_status, response.body[:200])
If you want the SDK to derive the socket path from an agent id:
with HawcxAgent.connect_by_agent_id("research-u1") as agent:
...
This uses the conventional path
{XDG_RUNTIME_DIR or /tmp}/hawcx/{agent_id}/agent-assembler-0.sock on Unix
and \\.\pipe\haap-{agent_id}-agent-assembler-0 on Windows.
API
HawcxAgent.connect(endpoint, *, timeout_secs=5.0) -> HawcxAgent
Open the agent IPC socket at endpoint and complete the version handshake.
HawcxAgent.connect_by_agent_id(agent_id, *, index=0, ipc_dir=None, timeout_secs=5.0)
Resolve the conventional path, then connect.
.invoke(...) -> ToolCallResponse
| Argument | Type | Notes |
|---|---|---|
target_rs_url |
str |
RS endpoint URL (required) |
http_method |
str |
Default "POST" |
headers |
dict[str, str] | None |
Extra HTTP headers |
tool |
str |
Tool / endpoint identifier |
action |
Iterable[str] | None |
Permitted operations (CS §39.7) |
resource |
str |
Default "*" |
constraints |
dict | None |
TBAC constraints |
body |
bytes | None |
Request body (maps to plaintext_request_body) |
claimed_intent_hash |
str | None |
For §39.4 intent verification |
tool_arguments |
Any |
Structured arguments |
content_type |
str | None |
Request content type |
transport |
TokenTransport | None |
HTTP_HEADER (default) or MCP_META |
request_id |
str | None |
Defaults to req-<uuid4-hex16> |
Returns ToolCallResponse(request_id, http_status, headers, body). The body
field is the decrypted RS response (bytes).
Raises RequestRejected(request_id, reason) if the Assembler rejects.
TokenTransport
class TokenTransport(str, Enum):
HTTP_HEADER = "http_header" # Authorization: HAAP <b64>
MCP_META = "mcp_meta" # MCP params._meta["haap/tbac"].token
Per CS v7.2.0 §34. Default per-call selector is omitted on the wire → the
Assembler uses HttpHeader.
Wire protocol
The SDK speaks the same wire as the in-process Rust crates:
[msg_len: u32 BE][msg_type: u8][payload: msg_len-1 bytes]
0x00—IpcHandshake(binary; seecrates/haap-ipc/src/handshake.rs)0x52—ToolCallRequest(JSON)0x53—ToolCallResponse(JSON;bodyis base64)0x54—RequestRejected(JSON:{request_id, reason})0x61—ClarificationAnswer(JSON; Profile E first hop)
Reference: crates/haap-ipc/src/messages/assembler.rs in hx_labs.
Threat model — runtime principal
HawcxAgent supports per-call principal switching via the
acting_for_user field, which the Assembler projects into
scope_json.user_principal_id on the minted token (CS v6.9.0
line 163). This lets one supervisor pipeline serve multiple end-users
without re-enrolling the agent identity per user.
acting_for_user is sensitive: a value that came from an LLM (or
any input the model can influence) MUST NOT be allowed to silently
switch the effective user. As of 0.1.0a2 (H-3 hardening 2026-05-20):
HawcxAgent.connect(endpoint, principal_allowlist=[...])is required. The allowlist is a closed set of permitted principal IDs sourced from operator config.agent.invoke(acting_for_user=...)andagent.invoke_for(...)validate against the allowlist before any IPC bytes are written. Out-of-list principals raiseHawcxErrorsynchronously with a redacted SHA-256 fingerprint instead of echoing the rejected principal back in plaintext.- Pass
principal_allowlist=[]to forbid runtime principal switching entirely.
Operator obligations:
- Source the allowlist from operator-controlled config — never derive from LLM output, request bodies, MCP tool arguments, or any input a model can influence.
- If the principal axis spans more than ~100 users, fan out to per-user agents rather than one agent with a wide allowlist; the Cedar policy on the gateway should still gate per-user access, but reducing the SDK-side allowlist closes the blast radius of a compromised supervisor.
- The previous code that accepted
acting_for_userfrom any caller (without an allowlist) is deprecated. See../CHANGELOG.mdfor the migration recipe.
Limitations / known gaps
- End-to-end verification against real binaries is pending alpha-2 closure of the RSV cascade adapter. Tests use a mock Assembler over a Unix socket.
- Framework adapters (CrewAI
BaseTool, LangChainTool) are deferred to a Priority 2a follow-up. - Windows Named Pipe support uses
ctypesagainstkernel32; pytest fixtures exercise the Unix path only. Windows is exercised via unit tests of the framing layer.
License
Hawcx Proprietary License. See LICENSE.
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 Distributions
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 hawcx_haap-0.1.0a14.tar.gz.
File metadata
- Download URL: hawcx_haap-0.1.0a14.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a48f9ac049fea73f5394514409ddaf99834c72d73ecf7203772268170c98644
|
|
| MD5 |
bf52d80b4969f420b6075e22f05308b5
|
|
| BLAKE2b-256 |
d24b34913e8075de1462da893377e00690b7912a937306e9befbea9d4345a0a1
|
Provenance
The following attestation bundles were made for hawcx_haap-0.1.0a14.tar.gz:
Publisher:
release-python.yml on hawcx/hawcx_agentic_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hawcx_haap-0.1.0a14.tar.gz -
Subject digest:
2a48f9ac049fea73f5394514409ddaf99834c72d73ecf7203772268170c98644 - Sigstore transparency entry: 1705005246
- Sigstore integration time:
-
Permalink:
hawcx/hawcx_agentic_sdk@f00ac13662f13112becd9cafa018d562cec3fe3e -
Branch / Tag:
refs/heads/fix/release-python-arm64-win-assert - Owner: https://github.com/hawcx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@f00ac13662f13112becd9cafa018d562cec3fe3e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hawcx_haap-0.1.0a14-py3-none-win_arm64.whl.
File metadata
- Download URL: hawcx_haap-0.1.0a14-py3-none-win_arm64.whl
- Upload date:
- Size: 10.2 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bf98afc1a3cbcbef2c5c2e32eb407f9511b03267b92b87edf2238109be3d663
|
|
| MD5 |
2253ecebb92feabf10aee2c5c4bb851f
|
|
| BLAKE2b-256 |
00761826ce66d0e5ff5e4cdc4adb94003d1e0d25dcdd27e6e6b227c4e9dc49dc
|
Provenance
The following attestation bundles were made for hawcx_haap-0.1.0a14-py3-none-win_arm64.whl:
Publisher:
release-python.yml on hawcx/hawcx_agentic_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hawcx_haap-0.1.0a14-py3-none-win_arm64.whl -
Subject digest:
5bf98afc1a3cbcbef2c5c2e32eb407f9511b03267b92b87edf2238109be3d663 - Sigstore transparency entry: 1705005269
- Sigstore integration time:
-
Permalink:
hawcx/hawcx_agentic_sdk@f00ac13662f13112becd9cafa018d562cec3fe3e -
Branch / Tag:
refs/heads/fix/release-python-arm64-win-assert - Owner: https://github.com/hawcx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@f00ac13662f13112becd9cafa018d562cec3fe3e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hawcx_haap-0.1.0a14-py3-none-win_amd64.whl.
File metadata
- Download URL: hawcx_haap-0.1.0a14-py3-none-win_amd64.whl
- Upload date:
- Size: 10.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3103c49604d753f98e1f29b4fe34ca2a08ad9e042167aa6b1430896b42d03b67
|
|
| MD5 |
bd8babd3eda589371698dae4a88bdc95
|
|
| BLAKE2b-256 |
dc8afbeeedc5e8e766db92d47c9c5211a2910c217ae9305d39b76ec8dfefa46a
|
Provenance
The following attestation bundles were made for hawcx_haap-0.1.0a14-py3-none-win_amd64.whl:
Publisher:
release-python.yml on hawcx/hawcx_agentic_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hawcx_haap-0.1.0a14-py3-none-win_amd64.whl -
Subject digest:
3103c49604d753f98e1f29b4fe34ca2a08ad9e042167aa6b1430896b42d03b67 - Sigstore transparency entry: 1705005352
- Sigstore integration time:
-
Permalink:
hawcx/hawcx_agentic_sdk@f00ac13662f13112becd9cafa018d562cec3fe3e -
Branch / Tag:
refs/heads/fix/release-python-arm64-win-assert - Owner: https://github.com/hawcx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@f00ac13662f13112becd9cafa018d562cec3fe3e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hawcx_haap-0.1.0a14-py3-none-manylinux2014_x86_64.whl.
File metadata
- Download URL: hawcx_haap-0.1.0a14-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 13.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b251c1a2a1c03a0e66350eba03135a35be40cfd6cf52d5fe4a569dfd20b2f2c
|
|
| MD5 |
93a4d1ee20032e13bb661dab148178d7
|
|
| BLAKE2b-256 |
1d32400b3f14f7e020a9cee7678221acb3dafce8b7f715488f27b9f4d865c637
|
Provenance
The following attestation bundles were made for hawcx_haap-0.1.0a14-py3-none-manylinux2014_x86_64.whl:
Publisher:
release-python.yml on hawcx/hawcx_agentic_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hawcx_haap-0.1.0a14-py3-none-manylinux2014_x86_64.whl -
Subject digest:
2b251c1a2a1c03a0e66350eba03135a35be40cfd6cf52d5fe4a569dfd20b2f2c - Sigstore transparency entry: 1705005387
- Sigstore integration time:
-
Permalink:
hawcx/hawcx_agentic_sdk@f00ac13662f13112becd9cafa018d562cec3fe3e -
Branch / Tag:
refs/heads/fix/release-python-arm64-win-assert - Owner: https://github.com/hawcx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@f00ac13662f13112becd9cafa018d562cec3fe3e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hawcx_haap-0.1.0a14-py3-none-manylinux2014_aarch64.whl.
File metadata
- Download URL: hawcx_haap-0.1.0a14-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 13.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e9bc8804bf76aaa9c54a25e7adf3a44a55ac0a376392db48437a07e54b1009e
|
|
| MD5 |
fb2b295ca048665cedf972e32356b085
|
|
| BLAKE2b-256 |
36a4ef4765feb3a0355346ce5db69f26136f915dd429bb25c84998dfd7db6260
|
Provenance
The following attestation bundles were made for hawcx_haap-0.1.0a14-py3-none-manylinux2014_aarch64.whl:
Publisher:
release-python.yml on hawcx/hawcx_agentic_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hawcx_haap-0.1.0a14-py3-none-manylinux2014_aarch64.whl -
Subject digest:
8e9bc8804bf76aaa9c54a25e7adf3a44a55ac0a376392db48437a07e54b1009e - Sigstore transparency entry: 1705005423
- Sigstore integration time:
-
Permalink:
hawcx/hawcx_agentic_sdk@f00ac13662f13112becd9cafa018d562cec3fe3e -
Branch / Tag:
refs/heads/fix/release-python-arm64-win-assert - Owner: https://github.com/hawcx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@f00ac13662f13112becd9cafa018d562cec3fe3e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hawcx_haap-0.1.0a14-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: hawcx_haap-0.1.0a14-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 12.1 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b6bffc61312807997f661eadea82ef4ec0adc562633f5b28deb2ecc462aef2d
|
|
| MD5 |
95dab948c3092b79421b18327c1ca48f
|
|
| BLAKE2b-256 |
7b2003a239113daa358371a60d420eb732a4833da990f9f40f5a2f1a94386b50
|
Provenance
The following attestation bundles were made for hawcx_haap-0.1.0a14-py3-none-macosx_11_0_arm64.whl:
Publisher:
release-python.yml on hawcx/hawcx_agentic_sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hawcx_haap-0.1.0a14-py3-none-macosx_11_0_arm64.whl -
Subject digest:
5b6bffc61312807997f661eadea82ef4ec0adc562633f5b28deb2ecc462aef2d - Sigstore transparency entry: 1705005313
- Sigstore integration time:
-
Permalink:
hawcx/hawcx_agentic_sdk@f00ac13662f13112becd9cafa018d562cec3fe3e -
Branch / Tag:
refs/heads/fix/release-python-arm64-win-assert - Owner: https://github.com/hawcx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@f00ac13662f13112becd9cafa018d562cec3fe3e -
Trigger Event:
workflow_dispatch
-
Statement type: