Building a reliable AI agent is not primarily a model-tuning problem. Prompts, tool definitions, routing rules, memory systems, skills, control flow, and other surrounding code all shape production behavior. A generic benchmark score rarely explains why an agent chose the wrong tool, followed the wrong workflow branch, missed relevant context, or completed a task without meeting a domain-specific requirement.
NVIDIA's NeMo team describes a concrete optimization loop that addresses this. The cycle has four steps: analyze recorded agent traces to identify recurring failures, create custom evaluations that reproduce the problem, change one part of the harness, and measure the result on both development and held-out tasks. The authors call the harness—the code, configuration, and execution logic wrapping the model—the optimization surface.
The first step uses NeMo Compass, a tool that analyzes stored agent traces and evaluation evidence to find recurring problems, identify evaluation gaps, and prioritize improvements. Rather than inspecting each run manually, Compass reduces a large trace corpus to a structured backlog of issues with supporting trace IDs. In the article's primary example, the team pointed Compass at 42 recorded traces from a fictional enterprise assistant, along with an ETHOS.md file defining expected behavior. Compass identified that in multiple runs, the agent called a send_message tool without user confirmation—a violation of the stated rules.
The second step creates a test that reproduces the problem. NeMo Eval Author provides coding agent skills and workflows for building custom evaluations in Harbor or NeMo Gym formats. The team instructed a coding agent with the Compass findings, raw traces, the ETHOS.md file, and access to the agent repository. The coding agent produced four Harbor evaluations with tasks like "draft a response," each with a verifier that checks whether the agent called send_message without human confirmation and marks that run as a failure.
The third step changes one part of the harness. Here, the team modified the Hermes agent's SOUL.md file—a system prompt equivalent. The new instructions establish that requests to write, draft, compose, or suggest a message authorize preparation only; the agent must provide the draft for review and stop before sending. A token returned by a preparation tool is a technical capability to execute an action, not the user's consent to that action.
The fourth step measures the result. The team reran the evaluation tasks created in step two. Two tasks were labeled "held out"—withheld from the coding agent that proposed the harness change—to assess whether improvements generalize beyond the development tasks. Results: development tasks went from 3/6 passes to 6/6, held-out tasks from 4/6 to 6/6, and tool calls dropped from 10 to 6 (development) and 28 to 15 (held out). The authors emphasize accepting changes only when both development and held-out sets improve.
After a successful change, the loop repeats. Running Compass again on the updated agent's traces no longer reported the sending-without-confirmation finding. Instead, it surfaced a new issue: for some queries, the agent found the answer but failed to ground its response in the retrieved evidence. That becomes the next round's target.