AI Agent - Aug 4, 2026

Train Agents in Codex and OpenClaw Harnesses with Orchard

Quick answer

Orchard addresses a train-deploy mismatch: many open training stacks use a simplified agent loop even though the deployed agent runs inside a stateful, multi-process harness. Microsoft describes training rollouts in systems such as Codex, OpenClaw, and ZeroClaw by:

  1. launching each rollout in an Orchard Env container;
  2. running the real harness inside that environment;
  3. using a lightweight proxy to record the harness’s model calls;
  4. reconstructing those calls as samples for the training system.

This aligns data collection with the harness’s actual context and tool behavior. It does not make the model, harness, or tools interchangeable.

Keep four layers separate

LayerExamplesWhat must be pinned
Modelopen-weight policy or teachercheckpoint, tokenizer, inference settings
HarnessCodex, OpenClaw, ZeroClaw, ReACTversion, prompt, context policy, tool protocol
EnvironmentOrchard Env containerimage, resources, network, credentials, lifecycle
TrainerSFT or RL stackcode revision, sampler, reward, optimizer, seeds

The Orchard repository currently says every sandbox includes codex, claude, pi, opencode, and hermes on PATH. The Microsoft Research introduction discusses training demonstrations across Codex, OpenClaw, and ZeroClaw. Do not assume every named harness is built into every image or release; verify the current repository and image.

A controlled comparison

To test whether real-harness training helps:

  1. define one frozen task and environment set;
  2. run the same model in the simplified training loop and target harness;
  3. compare tool schemas, context construction, retries, and stopping behavior;
  4. train on the target harness while holding the reward and task set fixed;
  5. evaluate both in the target harness on an untouched holdout;
  6. report compute, attempts, failures, and human-reviewed outcomes;
  7. test a second harness to measure transfer instead of assuming it.

Proxy capture can include prompts, tool arguments, outputs, repository content, or personal data. Apply data minimization, access control, retention, redaction, and deletion requirements before recording trajectories.

Deployment boundary

Harness-aligned training may reduce behavioral mismatch, but production still needs scoped tool permissions, explicit confirmation for sensitive actions, idempotency, rollback, observability, and human takeover. A successful rollout is not proof that the action was authorized.

Read the Orchard Env guide for isolation and the Claw guide for assistant-specific authority. The SWE guide covers code-agent evaluation.

Frequently asked questions

Why train an agent inside its deployment harness?

A harness controls multi-turn context, tools, retries, and external connections. Training in a simplified imitation can create a mismatch between the trajectories learned during training and the system used during evaluation or deployment.

How does Orchard collect training data from a real harness?

Microsoft describes a lightweight proxy that records the harness’s own model calls while Orchard Env runs each rollout in a separate container, allowing those calls to be reconstructed as training samples.

Does Orchard make Codex or OpenClaw safe to deploy?

No. Harness-aligned training does not replace model evaluation, tool permissions, data controls, user confirmation, monitoring, or deployment approval.

Official sources

Source check: August 4, 2026. Verify current harness inclusion, licenses, model-call capture, trainer compatibility, image contents, credentials, and retention before collecting trajectories.