Home Recent Categories Tags Archives
Introducing Harness Native — The Nexa v2.0 Vision

Introducing Harness Native — The Nexa v2.0 Vision

Four months ago, we asked: what if agents were first-class citizens in a programming language? Nexa v1.x answered that question — agents, tools, protocols, and flows became keywords, not library wrappers.

Today, we’re asking a deeper question: what if agent safety was enforced by the compiler, not by runtime frameworks?

This is the vision behind Nexa v2.0 — the first Harness Native Programming Language.

The Problem: Every Agent Framework is a Library

Look at the landscape of agent development today:

  • LangChain/LangGraph: Python libraries. Context management, tool binding, and execution loops are all runtime conventions — nothing is enforced at compile time.
  • AutoGPT/BabyAGI: Python scripts. No context management at all — agents routinely hit token limits and degrade.
  • Claude Code/Devin: Products with built-in harnesses. Powerful, but the harness is proprietary and non-customizable.
  • NeMo Guardrails: A runtime interception layer. Catches violations after they happen, rather than preventing them at the language level.

The common thread: every solution implements agent safety as an afterthought — a runtime library, a configuration file, a guardrail that catches errors post-hoc. None of them make safety a language property.

The Insight: Agent = Model + Harness

Modern AI systems engineering has converged on a fundamental formula:

Agent = Model + Harness

The model provides probabilistic reasoning. The harness provides deterministic control — managing execution loops, context windows, tool execution, state persistence, lifecycle hooks, and evaluation.

We formalized the harness as a six-tuple H = (E, T, C, S, L, V):

ComponentNameResponsibility
EExecution LoopWhen and how to call the model
TTool RegistrySchema generation and safe execution
CContext ManagerWindow management and auto-eviction
SState StorePersistence, snapshots, branching
LLifecycle HooksFeed-forward guides + feedback sensors
VEvaluation InterfaceAcceptance criteria verification

The Innovation: Harness as Language Constructs

Instead of implementing the harness as a runtime library, we’re making each component a language-level keyword with compile-time verification:

// Nexa v2.0 — Harness Native
agent BugFixer(issue: string) {
    system `Fix: #{issue}`

    // Harness C: Context policy — compiler verifies eviction strategy
    context_policy {
        max_tokens: 100000,
        on_overflow: summarize_early_observations
    }

    // Harness L: Lifecycle hooks — compiler verifies hook signatures
    before_step { trace.log("starting", step_count); }
    after_step  { trace.log("completed", step_count); }

    // Harness E: Autonomous loop — compiler verifies exit condition exists
    autoloop max_steps: 50 exit_when: "issue is resolved" {
        // Harness E+L: AI-native error recovery
        try_agent {
            step();  // Reason → Act → Observe → Reflect
        } catch_correction(e: ToolError) {
            reflect `Tool failed: #{e.message}. Adjust and retry.`
        }
    }
}

This isn’t just syntax sugar. The Harness Validator — a new compiler stage — enforces 26 rules at compile time:

  • E-001: autoloop must have max_steps or exit_when — ERROR if missing
  • T-001: @tool functions must have a description — ERROR if missing
  • C-001: with_context must specify max_tokens — ERROR if missing
  • EC-001: try_agent must have at least one catch_correction — ERROR if missing

Just as Rust’s borrow checker eliminates memory bugs at compile time, Nexa’s Harness Validator eliminates agent safety gaps before a single line runs.

The Rust Analogy

DimensionRustNexa v2.0
ProblemMemory safetyAgent uncertainty
MechanismOwnership + borrow checkerHarness 6-tuple + Validator
EnforcementCompile-timeCompile-time + runtime
Escape hatchunsafe { }unharnessed { }

Rust proved that you can eliminate an entire class of bugs by making safety a language property. Nexa v2.0 aims to do the same for agent development.

The Road to v2.0

We’ve planned 9 milestones from M0 to M9:

  1. M0: Harness Validator + Parser extension — compile-time safety checks
  2. M1: Execution Engine + Context Manager — autoloop and with_context
  3. M2: Tool Registry + Lifecycle Hooks — @tool and before_step/after_step
  4. M3: State Store + Trace System — snapshot/fork and decision tree export
  5. M4: Evaluation Interface + LLM Router — verify and dynamic model routing
  6. M5: Actor System — spawn/pass/await for multi-agent orchestration
  7. M6: WASM Sandbox + Full Integration — secure tool execution
  8. M7: AVM Bytecode Backend — Rust-powered Agent Virtual Machine
  9. M8-M9: Release Candidate + Official Release

Each milestone is independently deliverable and tested. v1.x code continues to work with zero modifications via --harness=off.

Nexa v2.0 is the most ambitious rethinking of agent programming since the field began. We’re building a language where safety isn’t a library you import — it’s a property the compiler guarantees.


— Owen, May 2026