Skip to main content

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-supervisor pipeline (Authenticator + TQS-precompute + TQS-jit + Assembler + External Identity Broker + Supervisor — per HAAP CS v7.2.0 §45.2) must be running locally, installed from the hx_agentic_sdk release.
  • 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]
  • 0x00IpcHandshake (binary; see crates/haap-ipc/src/handshake.rs)
  • 0x52ToolCallRequest (JSON)
  • 0x53ToolCallResponse (JSON; body is base64)
  • 0x54RequestRejected (JSON: {request_id, reason})
  • 0x61ClarificationAnswer (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=...) and agent.invoke_for(...) validate against the allowlist before any IPC bytes are written. Out-of-list principals raise HawcxError synchronously 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:

  1. Source the allowlist from operator-controlled config — never derive from LLM output, request bodies, MCP tool arguments, or any input a model can influence.
  2. 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.
  3. The previous code that accepted acting_for_user from any caller (without an allowlist) is deprecated. See ../CHANGELOG.md for 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, LangChain Tool) are deferred to a Priority 2a follow-up.
  • Windows Named Pipe support uses ctypes against kernel32; 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hawcx_haap-0.1.0a13.tar.gz (34.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hawcx_haap-0.1.0a13-py3-none-win_arm64.whl (8.3 MB view details)

Uploaded Python 3Windows ARM64

hawcx_haap-0.1.0a13-py3-none-win_amd64.whl (8.9 MB view details)

Uploaded Python 3Windows x86-64

hawcx_haap-0.1.0a13-py3-none-macosx_11_0_arm64.whl (9.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file hawcx_haap-0.1.0a13.tar.gz.

File metadata

  • Download URL: hawcx_haap-0.1.0a13.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hawcx_haap-0.1.0a13.tar.gz
Algorithm Hash digest
SHA256 9dfc78dce0f2c07f266a0870aad1210a689884e08f3e75268e34297f423f5337
MD5 3504050f544deda1e7eaa4dde636ff96
BLAKE2b-256 d5ff9a03912220d4ed1e02cfadd0fcecb81fb29ecd0eb77d4d0d7cd82c39d71e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0a13.tar.gz:

Publisher: release-python.yml on hawcx/hawcx_agentic_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hawcx_haap-0.1.0a13-py3-none-win_arm64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0a13-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 780e59da971d6f66daebd0678dfb072a581152b62525dc46268e1a2a84792513
MD5 ff8be4cb2e5991c34afbf21477d67739
BLAKE2b-256 1364a84bcdc581652f048f9c9eb8a2fdcc0fcf3d5bbd14909eb06bfdd3041afb

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0a13-py3-none-win_arm64.whl:

Publisher: release-python.yml on hawcx/hawcx_agentic_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hawcx_haap-0.1.0a13-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0a13-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 eb19b1320dabb0e610fa43022c621ded0cd020af391639477d21964c2fd7b29a
MD5 d574d0e23190be3fd76d6b82e434214b
BLAKE2b-256 9aaa666aa69343aedb7dc8dd505430835d097ec59c02b7b80a1e2dd7341b4260

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0a13-py3-none-win_amd64.whl:

Publisher: release-python.yml on hawcx/hawcx_agentic_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hawcx_haap-0.1.0a13-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0a13-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d6cf87c1ddca2d833aa40474ff346881eb1b7032ce97d5791ff9a4ae22814f8
MD5 df00e34b732514e639aa94f04806cdfa
BLAKE2b-256 2869b477a3dad0e3544803ce35694d1627efeef42d22e11a5bea35e211b9e0c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0a13-py3-none-manylinux2014_x86_64.whl:

Publisher: release-python.yml on hawcx/hawcx_agentic_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hawcx_haap-0.1.0a13-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0a13-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 53677a4020df9f4947b9931799e66b8ec8cbae031d229388a9090bec105cd8ae
MD5 c5dff2be4852112c8c5900dd7876036c
BLAKE2b-256 85ce39c7abb9fa44024c112e4d51f7197c9cc92b00b647ba1d17f36b4f810f18

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0a13-py3-none-manylinux2014_aarch64.whl:

Publisher: release-python.yml on hawcx/hawcx_agentic_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hawcx_haap-0.1.0a13-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0a13-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8959447dcac42e0c0c2f4e90b0ae91039c45135b7c07fd16b16613bb107fbf8e
MD5 486d5c397f901375a10d6bb90b7d4021
BLAKE2b-256 3396adee3572bd989f1cde88ed7c40e2dc0fbd991faf792adf92ef9ca1102e61

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0a13-py3-none-macosx_11_0_arm64.whl:

Publisher: release-python.yml on hawcx/hawcx_agentic_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page