Skip to content

AgentWire v0.2.0 — Cryptographic Auth, Two-Phase Budgets & TCP RPC

Choose a tag to compare

@alok-108 alok-108 released this 23 Nov 13:53
· 12 commits to main since this release

AgentWire v0.2.0 — Cryptographic Auth, Two-Phase Budgets & Networked TCP RPC

AgentWire is a compact, cryptographically verifiable binary wire protocol (AW01) and deterministic policy runtime for multi-agent AI systems built with Rust + PyO3.

Highlights

  • HMAC-SHA256 Frame Authentication & Replay Protection (agentwire-core, agentwire-validator):
    • Constant-time HMAC-SHA256 signing (sign_ast / verify_frame) over canonical headers, replay nonce, timestamp_ms, and typed AST body.
    • Zero-trust receiver validation: sender GUARD_VERIFIED flags are advisory only and never trusted by receivers.
    • Replay nonce cache (REPLAY_DETECTED) and clock-skew freshness window (EXPIRED_TIMESTAMP).
  • Two-Phase Budget Accounting (Reserve -> Settle / Release):
    • PolicyEngine reserves declared max budgets on frame acceptance, settles actual downstream token/cost spend via settle_usage (returning unused budget to the session pool), and refunds 100% via release_reservation on error or timeout.
    • Mutex-backed thread safety verified under 8-thread concurrent sessions.
  • Cross-Process TCP RPC Transport (agentwire.transport):
    • Length-prefixed binary TCP AgentWireRpcServer & AgentWireRpcClient with (trace_id, span_id) correlation, timeouts, exponential-backoff retries, independent receiver-side HMAC + policy enforcement, and CrewAIWire.register_remote_role.
  • Apples-to-Apples Benchmarks (1,000 hops, tiktoken:cl100k_base):
    • Wire Bytes (exact same AST struct): -68.3% vs. compact JSON and -60.7% vs. RFC 8949 CBOR (unsigned 115.2 B); -57.4% vs. compact JSON even with 32-byte HMAC-SHA256 + nonce/timestamp (155.1 B).
    • LLM Context Tokens (separated from wire bytes): -15.3% vs. minimal compact AST JSON (62.2 -> 52.8 tok/hop) and -83.1% vs. verbose framework envelopes (312.2 -> 52.8 tok/hop).
    • Full Authenticated Rust Pipeline: 24.55 µs mean (97.70 µs p99); forged rogue MUTATE blocked in 4.00 µs, replay blocked in 1.80 µs.
  • Fuzzing & Robustness:
    • Rust proptest property-based roundtrip and arbitrary-byte fuzzing (13 Rust tests passing, 0 warnings) + 27 Python unit, adversarial, 500-case FFI fuzz, concurrency, and TCP RPC tests.

Quick Install

  • Pre-built wheel (Windows x64, Python 3.12):
    pip install agentwire-0.2.0-cp312-cp312-win_amd64.whl
  • Build from source (Linux / macOS / Windows, Python 3.10–3.13 + Rust):
    git clone https://github.com/alok-108/agentwire.git
    cd agentwire
    uv venv .venv && uv pip install --python .venv/bin/python maturin pytest tiktoken
    .venv/bin/maturin develop --release