AI EngineeringAdvanced18 min

Harness engineering

Everything around the model that makes an agent reliable: tools, sandboxes, prompts, evals and telemetry.

See it on the map

When an agent misbehaves, the fix is usually in the harness, not the model. The harness is the tool set and its descriptions, the permission and sandbox model, the system prompt and context files, the evals that catch regressions, and the telemetry that shows what happened.

Safety lives here. Run risky actions in a sandbox with least privilege, gate destructive operations behind approval, and make permissions explicit rather than implied by prompt text. A model asked nicely not to delete files is not a control. A read-only mount is.

Instrument everything: every model call, tool call, token count, latency and outcome, tied together by a run id. You cannot improve an agent you cannot replay, and replays are how you turn a bad run into a new eval case.

Key points

  • Reliability is mostly a harness property.
  • Enforce permissions in code and sandboxes, not in prompts.
  • Trace every step with a run id so failures can be replayed.
  • Turn each bad run into a regression eval.

Answer these out loud

  1. 1Design the permission model for an agent that can run shell commands on a customer's repository.
  2. 2What would you log to reproduce an agent failure from last Tuesday?

Use this from an agent

Any MCP client, including Grok, can read this lesson. See how to connect.

REST
curl https://engineeros-delta.vercel.app/api/v1/topics/harness-engineering