hanzo-protocol
Core protocol types for Hanzo AI agents.
Overview
This crate defines the fundamental types used throughout the Hanzo AI ecosystem, including:
- AskForApproval - Human-in-the-loop approval policies
- SandboxPolicy - Filesystem and execution sandboxing
- Protocol messages - Internal communication types
- Configuration - Agent configuration schemas
Installation
[]
= "0.6"
Key Types
AskForApproval
Controls when the agent pauses to request human confirmation:
use AskForApproval;
let policy = OnRequest; // Model decides when to ask
match policy
| Policy | Description |
|---|---|
Never |
Full autonomy - never ask |
OnFailure |
Ask only when operations fail |
OnRequest |
Model decides based on risk assessment |
UnlessTrusted |
Ask unless operation is known-safe |
SandboxPolicy
Controls what operations are physically allowed:
use SandboxPolicy;
let policy = WorkspaceWrite ;
match policy
| Policy | Filesystem | Network | Processes |
|---|---|---|---|
DangerFullAccess |
Full | Full | Full |
WorkspaceWrite |
Read all, write workspace | Configurable | Allowed |
ReadOnly |
Read only | Blocked | Limited |
Modules
| Module | Description |
|---|---|
config_types |
Configuration schemas |
protocol |
Core protocol definitions |
models |
Data models |
mcp_protocol |
MCP-specific types |
responses |
Response structures |
tool_config |
Tool configuration |
Example: Agent Configuration
use ;
let config = AgentConfig ;
TypeScript Bindings
This crate uses ts-rs to generate TypeScript type definitions:
# Generates TypeScript bindings in ./bindings/
Related Crates
hanzo-mcp-types- MCP type definitionshanzo-mcp-client- Async MCP clienthanzo-zap- Zero-copy Agent Protocol
License
MIT License - Copyright 2025 Hanzo AI Inc.