Nexu releases harness-engineering-guide for AI agent runtimes

An open guide to building AI agent harnesses, covering tool execution, memory management, and multi-agent orchestration with practical Python examples.

cpaua3 min198
Nexu releases harness-engineering-guide for AI agent runtimes

Nexu has published the nexu-io/harness-engineering-guidegithub.com/nexu-io/harness-engineering-guide, an open-source repository providing concepts and tutorials for building AI agent runtimes. The guide defines a harness as the runtime wrapper that transforms a bare language model into an autonomous agent capable of perceiving environments and taking multi-step actions. It provides the necessary infrastructure for executing tools, managing memory, and enforcing safety boundaries that models cannot handle independently.

Components of the agentic loop and tool systems

The guide breaks down the think-act-observe cycle, including loop detection, parallel tool calls, and streaming. It details tool system implementation through registries, the MCP protocol, and both static and dynamic loading patterns.

Memory management is addressed via two-tier systems combining daily logs with long-term storage. The material includes strategies for context assembly and session management using AGENTS.md and MEMORY.md patterns to handle token budgeting and compression.

Infrastructure for sandboxing and security

To ensure safety, the guide covers the implementation of trust boundaries and permission models. It suggests using Docker and Firecracker for network isolation and filesystem restrictions to create secure sandboxes.

The repository describes a classifier-based permissions system that uses model-based classifiers to reduce approval fatigue. This approach employs a two-layer defense and four threat models to protect against prompt injection.

Patterns for multi-agent orchestration and scaling

The material outlines several orchestration patterns, such as pipeline, fan-out, and supervisor models. It describes a Leader-Worker pattern for sub-agents that utilizes file-based communication and session isolation for parallel execution.

One documented case study involves 16 parallel Claude instances coordinating via git to build a 100K-line C compiler. This process used a Ralph-loop and GCC-as-oracle bisection for coordination. Such complex setups often require specific token limit management to maintain stability.

Long-running agent design and evaluation

For agents operating over extended periods, the guide proposes a generator-evaluator architecture inspired by GANs to combat self-evaluation bias. It also introduces a two-phase harness consisting of an initializer and a coding agent to maintain a clean state via JSON feature lists.

The guide includes a side-by-side implementation comparison of several tools, including Codex, Claude Code, OpenClaw, Cline, Aider, and Cursor. It also notes that resource configuration swings can affect benchmark scores by 6 percentage points, necessitating floor and ceiling enforcement strategies.

Related reading

Sources

nexu-io/harness-engineering-guidegithub.com/nexu-io/harness-engineering-guide
Share

Author

cpaua

VibeCode blog admin. Writing about vibe coding, AI and open source.

Related news

Comments

To leave a comment, log in
Loading...

Weekly digest

The best of vibe coding, AI agents and open source — once a week, no spam.