HIP-1347: Event-Driven Agent Reliability
Abstract
This specification defines the execution isolation, event-driven lifecycle, reactivation observability, idempotent durable recovery, and evaluation harnesses for Research Bounties #31 through #40 across hanzoai/agents, hanzoai/mcp, hanzoai/cloud, hanzoai/ml, and hanzoai/visor.
Motivation
Event-driven autonomous agents must launch sandboxes, invoke MCP tools, recover from interrupts, defend against adversarial tool payloads, and turn trajectories into measurable improvements — without requiring permanently resident bot processes or leaking tenant credentials inside sandboxes. Benchmarking end-to-end reliability requires clean separation between sandbox reactivation latency and model inference TTFT alongside reproducible anti-leakage task suites.
Specification
The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are to be interpreted as in RFC 2119.
1. Event-Driven Contract & Credential Separation
- Disjoint Credentials: Workload/control-plane actors, per-run
ai:inferencekeys (blocked from knowledge/KMS paths), per-run MCP run tickets, sandbox lease tokens (without admin-mint), and per-environment worker secrets MUST remain cryptographically separate and scoped per trust boundary. - Non-Permanent Bot Execution: Bots and durable sessions MUST wake on cron/webhook/channel/user events, park disks cleanly at idle, and MUST NOT mandate permanently running agent daemon processes.
- Reactivation vs TTFT Telemetry: Traces MUST record session activation state (
cold,relocated,warm) andreactivation_msindependently fromgen_ai.latency.ttft_ms. - Idempotent Durable Tools: Retried or relocated durable activities and MCP tool calls MUST carry deterministic per-attempt
idempotency_keyidentifiers preventing duplicate external side effects.
2. Evaluation, Security & Lifecycle Bounties (Bounties #31–#40)
- Long-Horizon Coding-Agent Evaluation (Bounty #31 — Wave 1 #2,
hanzoai/agents): Run a reproducible subset of SWE-bench Pro V2 (September 2026 anti-leakage revision) onhanzoai/visor, comparing task resolution, wall time, model spend, and filesystem IO against plain NVMe. - Prompt-Injection Resistance (Bounty #32,
hanzoai/agents/hanzoai/mcp): Port AgentDojo-style tool-result and retrieved-content injection tests intohanzoai/mcpwith explicit authorization policies and measured attack-success rates. - Risky-Tool Simulation (Bounty #33,
hanzoai/agents/hanzoai/mcp): Simulate destructive or privacy-sensitive MCP tool invocations prior to live execution, reporting unsafe-action detection and false-block rates. - Unified Agent Execution Tracing (Bounty #34 — Wave 1 #5,
hanzoai/cloud): Correlate model calls, retrieval, MCP tools,vfsIO, sandbox reactivation, and billing under a unified task ID per OpenTelemetry GenAI semantic conventions, measuring tracing overhead and attribute completeness. - Durable Event-Driven Agent Workflow Replay (Bounty #35,
hanzoai/agents): Validate persisted checkpoints, idempotent activities, and crash recovery inside Hanzo's event-triggered lifecycle usinghanzoai/taskssemantics without introducing always-on worker daemons. - Learning from Agent Execution Traces (Bounty #36,
hanzoai/agents/hanzoai/ml): Convert succeeded and failed agent trajectories into RL/post-training datasets for eligible Zen checkpoints, reporting pass rate, reward-hacking checks, and training cost. - Automatic Prompt & Workflow Optimization (Bounty #37,
hanzoai/agents): Optimize selected programmatic workflows against executable held-out checks, reporting accuracy, token cost, and latency. - Agent-Computer Interface Optimization (Bounty #38,
hanzoai/mcp): Benchmark compact structured edit APIs and bounded shell outputs on tool-call count, patch validity, and completion rate. - Dual-Control Business-Agent Benchmark (Bounty #39,
hanzoai/agents/hanzoai/cloud): Verify human+agent concurrent state edits under randomized permissions and tool outcomes. - Computer-Workflow Benchmark on Visor (Bounty #40,
hanzoai/visor/hanzoai/agents): Evaluate reproducible OS/desktop task subsets inside supported sandboxes, measuring completion rate, cold-start time, CPU/RAM footprint, and teardown hygiene.
3. Research continuation profile
HIP-1403 research workflows MUST run independently of interactive agent sessions and provider subscription quotas. hanzod supervises the controller; HIP-1062 owns durable execution and HIP-1334 owns scientific evidence. Agents propose hypotheses or inspect authorized projections, not maintain campaign liveness. Recovery MUST reconcile leases, attempts, checkpoints and budget reservations before resuming; replay events idempotently, fence stale workers, record partial usage, and stop admissions at authorized limits. Exercise agent disconnect, quota exhaustion, controller and host restart, network partition and GPU preemption. No duplicate job or silent loss of failed evidence is permitted.
Rationale
Establishing deterministic idempotency keys, reactivation-split telemetry, and credential boundaries inside the core platform lets every agent benchmark run against production invariants rather than idealized single-tenant mocks.
Security Considerations
Hostile repository content or retrieved documents can attempt prompt injection, reference-solution leakage (#31), or sandbox credential harvesting. Disjoint credentials (§1.1), read-restricted ai:inference keys, and pre-execution risky-tool simulation (#33) confine blast radius to the sandboxed workspace.
References
- HIP-0119 — Hanzo Service Conventions
- HIP-1210 — Agents — Define, Run, Keep
- HIP-1213 — Tools — The Tool Plane
- HIP-1330 — Dev — The Agent Loop
- HIP-1343 — Visor — The Sandbox Runtime
hanzoai/agents,hanzoai/mcp,hanzoai/cloud,hanzoai/visor,hanzoai/ml
Copyright
Released under CC0 1.0 Universal Public Domain Dedication.