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.0.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.0-py3-none-win_arm64.whl (8.3 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

hawcx_haap-0.1.0-py3-none-manylinux2014_x86_64.whl (11.4 MB view details)

Uploaded Python 3

hawcx_haap-0.1.0-py3-none-manylinux2014_aarch64.whl (11.0 MB view details)

Uploaded Python 3

hawcx_haap-0.1.0-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.0.tar.gz.

File metadata

  • Download URL: hawcx_haap-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 b25445b4101361079f3bf9912caf5d7eca636baab679fb7069e9ac5e6e428cba
MD5 a6a2364e1108c20b9a8910b76c3b84fa
BLAKE2b-256 09352084053ee8c6a726cb595a4843d36ab9af0908b318ffc21036274ef7814f

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0.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.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: hawcx_haap-0.1.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for hawcx_haap-0.1.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 f8297931873c18bb019b70cee9a611e94c2d4f2335fa5bec24f16475b01c276e
MD5 7b619d78f9db631565b25e3660426b5f
BLAKE2b-256 181890e5f753b8ad96582aab3fd7254ea8997f30990d0b1dd0c3b925f21b9c5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0-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.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: hawcx_haap-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 8.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

Hashes for hawcx_haap-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2356c50b6a5c0674e1a021213c5bb97cc439323147a4bd443de9fcdeb8915138
MD5 25c325c4872d561f983f1071a87b94b7
BLAKE2b-256 ba7bcdc9958a8e61e3eaa25d1c610faa20925a9a4a0c216b392e31aac1299151

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0-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.0-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1ca7504b4edb51b9c39a1f9a118b590241bd8dcfef5be7eff988694b130d14a
MD5 9c91dafbcc7c70ee8e2070caeb1ab52d
BLAKE2b-256 d17abfd8b1278b6064123914f7fc6d8b32ade5988bb0b11b95eb01654f9bc7b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0-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.0-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2ffe49b786832a5496383f8f4e42baea33659954b26708344a8ed1c75959a46d
MD5 eb9fd4f787181ef824c66d95949767e5
BLAKE2b-256 06be76759e7854b02b48758a9027e31585b5eef32133da7dcb20df4c39e44aa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0-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.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hawcx_haap-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45116185e9d14c34ad0438b1717f6623b6320c7d9b1a88a9e46c205d1820b9b4
MD5 fc6b7d0aa77a677d2350b053c4abd775
BLAKE2b-256 23eb35e6f0b0e93c660595177f4e2faddf7df204d84d855851d8fa7afcc81a53

See more details on using hashes here.

Provenance

The following attestation bundles were made for hawcx_haap-0.1.0-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