Nexa v2.1.0 is Here — Production Hardening for Nexa Code
After months of research, design, and engineering, Nexa v2.0.0 is officially released and available on GitHub. This isn't just another framework update — it's the realization of a fundamentally new approach to agent programming: Harness Native.
The Big Idea: Safety is a Language Property
Every AI agent today — from Claude Code to Codex CLI — manages its execution loop, tool binding, context paging, state persistence, lifecycle hooks, and output verification as runtime conventions. That is: code that could be skipped, bypassed, or simply forgotten by the LLM.
Nexa v2.0 changes this at the programming language level. The Harness six-tuple H=(E,T,C,S,L,V) is not a framework. It's not middleware. It's syntax — enforced by the compiler before a single line of agent code ever runs:
| Dimension | Primitive | What it Does | Tests |
|---|---|---|---|
| E | autoloop |
Autonomous ReAct loop with max_steps, exit_when, timeout | 52 |
| T | @tool |
Zero-cost tool binding → OpenAI function calling schema | 53 |
| C | with_context |
Importance-weighted context paging with token budgets | 52 |
| S | snapshot/restore |
COW state snapshots, fork/merge for Tree-of-Thoughts | 45 |
| L | before_step/reflect |
Lifecycle hooks + self-reflection injection | 53 |
| V | verify |
Compile-time + runtime output verification | 59 |
| Actor | spawn/pass/await |
Multi-agent orchestration as language primitives | 18 |
| WASM | sandbox | Full Harness inside WASM sandbox with permission model | 15 |
296 new tests for v2.0 alone, plus 1500+ from v1.x = 1800+ total.
Get Started in 30 Seconds
git clone https://github.com/Nexa-Language/Nexa.git
cd Nexa
pip install -e .
export API_KEY="<provider-api-key>"
# Your first Harness Native agent
nexa run examples/v2.0/01_autoloop.nx --harness=warn
A Complete Agent in One File
Here's a Harness Agent using all six dimensions — E, T, C, S, L, V — in a single flow:
@tool("Execute a shell command safely")
fn shell_exec(command: string): string {
python! """return "Command executed safely""""
}
agent WellHarnessedAgent {
prompt: "You are a well-harnessed autonomous agent"
}
flow main {
autoloop max_steps: 10, exit_when: "resolved", timeout: 300 {
with_context max_tokens: 50000 {
snap = snapshot();
try_agent {
result = WellHarnessedAgent.run("Analyze and respond");
verify result satisfies string;
} catch_correction(e: ToolError) {
restore(snap);
reflect "Error occurred. Adjusting strategy.";
}
}
}
}
Nexa Code — The First Harness Native AI Assistant
Alongside v2.0, we're releasing Nexa Code — an interactive AI programming assistant written entirely in Nexa syntax. It uses all six Harness dimensions and features a multi-agent architecture (Planner → Coder → Reviewer → Tester) with 15+ tools.
nexa run examples/Nexa-Code/main.nx --harness=warn
╔════════════════════════════════════════════════╗
║ Nexa Code v2.0.0 ║
║ The First Harness Native AI Coding Agent ║
╚════════════════════════════════════════════════╝
nexa-code> Read VERSION and tell me the version
> [CodeAssistant]: This project is version 2.0.0.
Read more in our companion post: Introducing Nexa Code.
AVM Rust: Clean Build
The Rust-based Agent Virtual Machine (AVM) backend is now 0 errors, 0 warnings:
- 17 compilation errors fixed in
avm/src/runtime/jobs.rs - 21 warnings eliminated across 8 files
- Security: wasmtime v20→v21 (9 CVEs), pyo3 v0.21→v0.24 (1 CVE)
v1.x Compatibility
All v1.x code runs unchanged. v2.0 Harness features are opt-in via the --harness=warn flag. You can add Harness primitives incrementally to existing agents.
What's Next: v2.1
The v2.1 milestone (in development) focuses on Production Hardening for Nexa Code:
- Streaming: Agent-level
stream: truefor real-time output - Structured Output:
output_format: "json"with schema constraint - Tool Call Control:
max_tool_callsandtool_call_strategy - Spawn Pipeline:
task |>> spawn [Agent1, Agent2]
These features will enable Nexa Code to run without any python! escape hatches — pure Nexa syntax, compiler-enforced safety.