Hanzo
Hanzo Skills Reference

Hanzo Rust SDK

Full Rust infrastructure SDK with 14 active crates covering agent framework, MCP implementation, post-quantum cryptography, AI safety, and multi-backend proxy.

Overview

Hanzo Rust SDK is a full Rust infrastructure SDK — not just an API client. Contains 14 active crates covering agent framework, MCP implementation, post-quantum cryptography, AI safety (LLM I/O sanitization), and multi-backend proxy.

Quick reference

ItemValue
Repogithub.com/hanzoai/rust-sdk
Version1.1.12
Rust edition2021
MSRV1.85
LicenseMIT OR Apache-2.0
Active crates14
Disabled crates~21 (in development)

Active Crates

Core

CratePurpose
hanzo-configConfiguration management
hanzo-message-primitivesCore message schemas

Cryptography

CratePurpose
hanzo-pqcPost-quantum crypto (ML-KEM, ML-DSA)
hanzo-cryptoGeneral crypto primitives
hanzo-didW3C Decentralized Identifiers

AI Safety

CratePurpose
hanzo-guardLLM I/O sanitization — PII redaction, injection detection
hanzo-extractContent extraction with sanitization

Agent Framework

CratePurpose
hanzo-agentAgent framework core
hanzo-agent-proxyMulti-backend OpenAI-compatible proxy
hanzo-agentsSpecialized agents (architect, CTO, reviewer)

MCP Stack

CratePurpose
hanzo-mcp-coreMCP protocol types and serialization
hanzo-mcp-clientMCP client implementation
hanzo-mcp-serverMCP server implementation
hanzo-mcpUnified MCP interface

Disabled Crates (In Development)

~21 crates in various stages: hanzo-kbs, hanzo-identity, hanzo-libp2p, hanzo-compute, hanzo-database, hanzo-embedding, hanzo-llm, hanzo-hmm, hanzo-wasm, hanzo-mining, hanzo-marketplace, hanzo-baml, hanzo-db, hanzo-simulation, hanzo-sqlite.

Usage Examples

Post-Quantum Crypto

use hanzo_pqc::{ml_kem, ml_dsa};

// ML-KEM key encapsulation
let (ek, dk) = ml_kem::keygen();
let (ct, ss) = ml_kem::encapsulate(&ek);
let ss2 = ml_kem::decapsulate(&dk, &ct);
assert_eq!(ss, ss2);

// ML-DSA signatures
let (pk, sk) = ml_dsa::keygen();
let sig = ml_dsa::sign(&sk, message);
assert!(ml_dsa::verify(&pk, message, &sig));

AI Safety (Guard)

use hanzo_guard::{Guard, Policy};

let guard = Guard::new(Policy::default());

// Sanitize LLM input (detect injection)
let safe_input = guard.sanitize_input(user_message)?;

// Sanitize LLM output (redact PII)
let safe_output = guard.sanitize_output(llm_response)?;

Agent Proxy

use hanzo_agent_proxy::Proxy;

// Multi-backend proxy (OpenAI-compatible)
let proxy = Proxy::builder()
    .backend("openai", openai_config)
    .backend("anthropic", anthropic_config)
    .backend("local", ollama_config)
    .build();

proxy.serve("0.0.0.0:8080").await?;

MCP Server

use hanzo_mcp::{Server, Tool};

let server = Server::builder()
    .name("my-tools")
    .tool(Tool::new("search", search_handler))
    .tool(Tool::new("compute", compute_handler))
    .build();

server.serve_stdio().await?;
  • hanzo/hanzo-mcp.md — MCP protocol (TypeScript counterpart)
  • hanzo/hanzo-node.md — Rust AI agent node
  • hanzo/hanzo-evm.md — Rust EVM (reth fork)

How is this guide?

Last updated on

On this page