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.3.tar.gz (34.2 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.3-py3-none-win_arm64.whl (8.5 MB view details)

Uploaded Python 3Windows ARM64

hawcx_haap-0.1.3-py3-none-win_amd64.whl (9.1 MB view details)

Uploaded Python 3Windows x86-64

hawcx_haap-0.1.3-py3-none-manylinux2014_x86_64.whl (11.7 MB view details)

Uploaded Python 3

hawcx_haap-0.1.3-py3-none-manylinux2014_aarch64.whl (11.3 MB view details)

Uploaded Python 3

hawcx_haap-0.1.3-py3-none-macosx_11_0_arm64.whl (10.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file hawcx_haap-0.1.3.tar.gz.

File metadata

  • Download URL: hawcx_haap-0.1.3.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

Hashes for hawcx_haap-0.1.3.tar.gz
Algorithm Hash digest
SHA256 61190230bdec80c18da805df15ac623298b0e4473d0002f06ffdf70cae0e2e29
MD5 7f9fadd848f67f27085fa84edc2176f5
BLAKE2b-256 dae66388086bbff31d66f6136d018a5fdcd21174c712286c1178133b3a68be5d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hawcx_haap-0.1.3-py3-none-win_arm64.whl
  • Upload date:
  • Size: 8.5 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.3-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 9a1dabdc03db148c4cdcc50ead1d0f6e73d36dddef15a54d28886f4a86d85640
MD5 4b52adb3da12f0bb2dc976b6e50215c2
BLAKE2b-256 ce5d2e878ccb664d823fe5f5e9ba84cc8ed124ae4faf7a20c7eb042472a21623

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hawcx_haap-0.1.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 9.1 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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8f0a7f7d0bb1fcf9da7830550aa6f04a49f6b3aeb4af0182b0214142c64ba6f0
MD5 7bee16b80411943a6e7b955b0ccda0a9
BLAKE2b-256 7482255542e027a4ef3c20a0d8e7bc45ca8ca2f80a95187974ba0801172c7730

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hawcx_haap-0.1.3-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67534ada7b2838c2bdfe9f48b17d8d4f902140eb5ee30d2cc8ac0e61c262d320
MD5 0ccc5c0c75abe0b04806f419bc398de8
BLAKE2b-256 168a3f8a021835bea23e2274bbed5acba08cf86afed9612f6ce7a64232c5ab15

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hawcx_haap-0.1.3-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d9a5f42ce4c3c4d2e3591ed3a4c191ada6fb7ba9e577a9d569bf63f5c0c0e32e
MD5 f86648885edecadce4fb0e1e38ad7de2
BLAKE2b-256 dcddfb6e4dd5d03dd57fb245580b5d0f0dfdedd912202ab79c94ac696ebe1db6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hawcx_haap-0.1.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95f4bb7a49504e5a15faf60f82a0f150b4533edca20b6948315eadc5cc0eb4aa
MD5 1e1012ce3fce1bf213b84569d89e3171
BLAKE2b-256 fd56061e0a1cb8c391914356e74d19e5b8d0445649d596ed30b63ba9fcd2f9d5

See more details on using hashes here.

Provenance

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