Contents
- 01The Builder's Starting Line
- 02Your Computer, Explained
- 03How Software Fits Together
- 04Start With the Work
- 05Build Your First Useful Tool
- 06Make Changes Safely
- 07Prompts Are Specifications
- 08Models Are Components
- 09Give Agents Jobs, Not Vibes
- 10Tools, APIs, and the Harness
- 11Truth Before Intelligence
- 12Patterns for Real Systems
- 13Approval Is a Feature
- 14Receipts or It Didn’t Happen
- 15Operate and Debug the Loop
- 16Design Your Own OS
- 17Make It Ready for Real Life
- 18Build and Evolve Your OS
Tools, APIs, and the Harness
The model supplies capability; the harness turns it into controlled work.
Model plus operating environment
An agent is not just a model with a long prompt. It is a model operating inside an environment that assembles instructions, retrieves context, exposes tools, manages sessions, enforces permissions, coordinates workers, captures events, and decides when the run stops. That surrounding environment is the harness.
This distinction matters because many apparent intelligence failures are environmental. The model edited the wrong project because the workspace map was unclear. It repeated a tool call because the run had no idempotency record. It lost the goal because context compaction removed the acceptance criteria. Changing the model may hide the symptom without repairing the system.
“A model can suggest an action. The harness decides what it sees, what it can do, what happens next, and what gets recorded.”
The harness stack
A practical harness has layers for workspace identity, instruction assembly, model configuration, context management, tool access, execution state, memory, delegation, approvals, verification, and telemetry. Each layer should have an owner, interface, and failure signal.
Keep stable workspace facts—canonical repositories, schemas, policies, and commands—discoverable without pasting everything into every run. Keep full transcripts available for audit while giving the active worker a refined working context. Restrict tools before their definitions reach the model whenever possible.
- Workspace: projects, files, schemas, commands, and local conventions.
- Instruction: stable policy plus task-specific specification.
- Context: retrieval, ranking, compaction, and provenance.
- Capability: models, tools, skills, credentials, and sandboxes.
- Control: state, budgets, approvals, retries, and stopping conditions.
- Evidence: events, traces, evaluations, artifacts, and receipts.
Tools, skills, and meta-tools
A tool performs an action. A skill packages instructions and supporting resources for a recurring class of work. A meta-tool discovers, selects, composes, or creates other capabilities. These abstractions increase leverage and risk at the same time: a skill can make good practice repeatable, while a tool-discovery system can expose power the original task never needed.
Prefer small, typed, meaningful operations over a single universal executor. Make tool descriptions concrete enough for correct selection. Return structured results and error classes. Separate read from write. Scope credentials by service, account, operation, and duration. When a skill changes behavior, version it and evaluate it like any other production dependency.
Case file
why a capable coding model edited the wrong project
A coding agent receives a clear feature request and produces a convincing change. The build passes, but the application Nik uses does not change. Investigation shows that several similar checkouts exist and the worker selected a noncanonical workspace.
The team first considers a stronger model, but the failure is not reasoning ability. The harness never resolved project identity before exposing file tools. It had no canonical repository map in workspace context and no receipt tying the build to the installed surface.
The repair moves identity resolution ahead of execution, restricts file tools to the resolved checkout, adds branch and revision to every task packet, and requires proof at the surface named in the request. Future models inherit the same safe environment.
Decisions made
- 01Classify the defect as workspace and verification failure, not model failure.
- 02Resolve canonical project identity before exposing mutation tools.
- 03Bind task, run, artifact, and receipt to repository and revision.
- 04Make the requested user surface part of the harness exit condition.
The harness converts organizational knowledge and safety rules into defaults the worker does not need to rediscover on every run.
Guide before; sense after
A harness acts like a control system. Guides shape behavior before action: instructions, templates, schemas, policies, examples, plans, types, and permission filters. Sensors observe what happened: tool results, tests, validators, logs, graders, budgets, timeouts, and environmental checks.
Both can be deterministic or model-assisted. A schema validator is a deterministic sensor. A reviewer agent assessing whether a draft answers the brief is inferential. Use deterministic mechanisms for invariants and model judgment for semantics. The loop becomes reliable when observations can change the next action or stop the run.
Choose the right harness category
Start with the smallest environment that already solves the infrastructure you do not want to own. An IDE assistant helps with local, supervised changes. A coding harness such as Codex or Claude Code adds repository navigation, tools, and execution loops. An agent framework such as an Agents SDK, ADK, or graph runtime helps build a product workflow. A workspace manager coordinates multiple projects or workers. A persistent personal runtime adds long-lived state, scheduling, and local integrations.
A framework gives primitives; a harness supplies operating defaults. A raw library may offer freedom but leave you responsible for sessions, permissions, retries, observability, and recovery. Choose from the time horizon, number of workers, security boundary, integration needs, and trajectory volume—not from the length of the feature list.
Engineer the harness from failures
When a run fails, classify the first broken layer: task definition, prompt, model, context, tool, state, permission, orchestration, verification, or delivery. Capture the trajectory and the environment version. Repair the owning layer so the class of error becomes harder to repeat.
Prompt patches are appropriate for instruction failures. Missing repository identity belongs in workspace context. Repeated destructive commands need idempotency and policy. Lost work needs persisted state. Fake completion needs stronger receipts. Harness engineering is the discipline of turning observed failures into improved defaults.
Failure mode: tool proliferation
More tools can reduce reliability. Large inventories consume context, create ambiguous choices, widen the attack surface, and make permission review difficult. Multiple uncoordinated agent windows can create the appearance of parallel progress while producing conflicting artifacts and hidden integration work.
Load capabilities progressively. Expose the smallest set required for the current task, retrieve specialized tools when needed, and record why each was selected. Parallelize only work with separate ownership and a defined integration step.
Across the business
What this looks like in other departments
The engineering principle stays the same; the workflow, risk, and proof change with the domain.
Finance
A controlled spreadsheet harness
Give the agent typed workbook operations, read-only source systems, policy context, calculation checks, approval before writes, and a saved reconciliation receipt.
People & HR
A privacy-aware case harness
Filter employee context by role, constrain tools to the relevant record and operation, log access, and keep sensitive actions behind named approvers.
Marketing
A content production harness
Assemble brand rules and approved claims, route to research and drafting skills, require link and rights checks, and pause before publishing.
Software teams
A repository harness
Provide the canonical checkout, project instructions, code search, bounded file edits, tests, branch isolation, diff review, and deployment receipts.
Technical deep dive
The harness audit
Inspect the runtime around a worker layer by layer and find the first place where reliability depends on hope.
- 01InventoryList workspace facts, instruction layers, models, context sources, tools, credentials, state stores, approvals, sensors, and evidence sinks.
- 02TraceFollow one successful and one failed run through every layer, including what the model actually saw and what each tool changed.
- 03ClassifyAssign each failure to definition, prompt, model, context, tool, permission, state, orchestration, verification, or delivery.
- 04ConstrainReduce inventories, scope credentials, add schemas, make state durable, and place deterministic guards around invariants.
- 05CompoundTurn trajectories into regression cases, improved instructions, better tools, updated knowledge, and clearer operating defaults.
Reference schema
workspace: identity + conventions + authoritative sources instruction: policy + spec + examples + output schema capability: model + tools + skills + credentials + sandbox control: state + budget + approvals + retries + stop sensors: tool results + tests + validators + graders evidence: trajectory + artifacts + receipts + version improvement: failure class + owner + regression + fix
Try it yourself
Audit the environment around one agent
Choose a recurring agent workflow and identify which reliability responsibilities live outside the model.
- 1Draw the harness stack from workspace identity to final receipt.
- 2Mark each layer deterministic, inferential, human-owned, or missing.
- 3Trace one failure to the first layer that permitted it.
- 4Design one harness change that prevents the class of failure.
Reusable artifact
Harness design record
A concise architecture and failure map for an agent runtime.
Workflow: [job and time horizon] Workspace: [identity and authoritative context] Instructions: [assembly and versioning] Capabilities: [models, tools, skills, credentials] Control: [state, permission, approval, budget, stop] Sensors: [tests, validators, environmental checks] Evidence: [trajectory and receipts] Known gaps: [failure class and owner]
Before you move on
Receipt checklist
- Every harness layer has a clear responsibility and observable failure signal.
- The worker receives only the context, tools, and credentials required for the task.
- Deterministic guides and sensors protect system invariants.
- Observed failures become regression cases and improved defaults.
Primary sources
