Langchain eval engineering
Inspect an agent repository and optional traces, interview the user, write reviewed Task Specs, build and audit Harbor tasks, and bootstrap reusable project World Knowledge Skills. Use for agent evals, benchmark design, Task generation, controlled Environments, synthetic data, Verifiers, Harbor runs, calibration, or continuous benchmark maintenance.
By- name:
- langchain-eval-engineering
- description:
- Inspect an agent repository and optional traces, interview the user, write reviewed Task Specs, build and audit Harbor tasks, and bootstrap reusable project World Knowledge Skills. Use for agent evals, benchmark design, Task generation, controlled Environments, synthetic data, Verifiers, Harbor runs, calibration, or continuous benchmark maintenance.
Eval Engineering
Flow
- Inspect all inputs first: the repository, Harness, optional traces, existing Tasks and runs, existing World knowledge, and the human goal. Identify the source files and skill references that apply before proposing work.
- Create or update the small project World Knowledge Skill from reusable facts in those inputs. Use it to propose one grounded Task.
- Draft the Task Spec and World Skill together. Show both to the user, keep exact
Task truth only in
Task.md, and refine both until the user approves them. - Implement the approved Task, validate its Environment and Verifier, run the real Harness, and inspect the full evidence. Fix the Task or Verifier when the eval does not measure the intended behavior, and update the agent when the eval exposes a real product failure.
- Reconcile the World Skill with what the run proved, then repeat this flow for the next Task.
Terms
- Task Spec:
Task.md, which describes the input, relevant agent conditions, Environment, scoring, fairness, and open decisions for one Task. - Task: the runnable instruction, Environment, and Verifier.
- Harness: the complete agent Harbor runs, including prompts, model loop, tools, hooks, memory, sessions, and adapter.
- Environment: the files, data, services, identity, permissions, network, clock, and mutable state around the Harness.
- Verifier: independent checks that score the result or mark a run invalid.
- World Knowledge Skill: a repository-local skill with reusable project-specific knowledge, references, scripts, assets, and tests that help generate Task Specs and build future Tasks.
- Spec2Task: the full loop that turns a reviewed Task Spec into an audited runnable Task. Follow Task implementation for its concrete build order and reference routing.
Reference routing
Read each reference when its decision appears:
| Need | Read |
|---|---|
| Inspect source, traces, the Harness, dependencies, access, and existing evals | Discovery |
| Bootstrap or update reusable project knowledge | World knowledge |
| Propose Tasks and write the single Task Spec | Task design |
| Build data, services, access, state, and reset | Environment building |
| Create structured or natural-language data | Synthetic data |
| Define independent evidence and scoring | Verifier design |
| Apply Spec2Task to turn a reviewed Spec into an audited Task | Task implementation |
| Compare model runs and classify failures | Calibration |
| Package and run Harbor tasks | Harbor |
| Adapt a known benchmark design | Benchmark patterns |
| Build multi-turn conversations | Multi-turn simulation |
| See World knowledge learned across two Tasks | Service-desk example |
Reusable implementation resources:
- Multi-turn runner, model user, and Harbor adapter example
- Tool-schema comparison, which compares
supplied schema fragments but does not resolve external
$reftargets - Read-only SQLite state snapshot
1. Inspect inputs and existing World knowledge
Review every input the user provides before proposing a Task. Use the guidance that matches each available input:
- For a repository, Harness, traces, or dependencies, read Discovery.
- For existing Tasks and runs, inspect their instructions, Environments, Verifiers, rewards, trajectories, and final state. Read Calibration when run quality or failure causes affect the new design.
- For an existing project World Skill, read World knowledge, then check the sources and reusable methods that affect the new Task.
- For human goals and constraints, read Task design.
- For relevant benchmark examples, use the domain index and source callouts in Benchmark patterns.
Inspect the repository before asking questions that source and tests can answer. Follow the active Harness through prompts, models, tools, services, state, effects, and focused tests. Inspect existing Task instructions, parsers, Verifiers, reward paths, and run evidence.
If the user supplies traces, review complete runs or threads. Use traces to learn real requests, dependency behavior, state shapes, errors, and failure conditions. Do not treat a trace answer as independent truth.
If .agents/skills/<project>-world/SKILL.md exists, read it. Follow its routing
only for knowledge relevant to the current Task. Check cited repository paths,
commands, and scripts when their accuracy affects the design.
2. Propose and select a Task
Read Task design and use the index in Benchmark patterns to find the relevant domain and source callouts. Focus on that domain unless the Task crosses another one. In the first user-facing design response after inspection, propose one Task grounded in repository evidence, supplied traces, existing coverage, or a human priority. State:
- the real work and capability;
- the condition that makes the case non-trivial;
- the Environment and independent evidence it needs;
- the important failure it can detect;
- how it differs from existing Tasks; and
- the main open decision.
In the same response, show the relevant current World Skill content and the specific additions or corrections this Task suggests. If no World Skill exists, show the small initial contents that will help create this Task and future Tasks. Keep the Task's exact request, focal records, expected result, hidden truth, and exact scoring rules out of the World Skill.
Let the user revise the Task proposal and World knowledge together before implementation. Offer alternatives only when a real user choice changes the design.
3. Write and review the Task Spec and World Skill
Copy the Task template to
evals/<suite>/tasks/<task-id>/Task.md. Put all Task-specific design in this
one file. At the same time, create or update the project World Skill by
following World knowledge. Determine the
project skill location supported by the active agent and repository.
.agents/skills/<project>-world/SKILL.md and
.claude/skills/<project>-world/SKILL.md are common landing spots. Follow an
established project convention when one exists. Otherwise, explain the proposed
location and get user confirmation before creating the skill. Start from
the World Skill template when needed.
Keep each Task.md beside the Harbor task it describes:
evals/<suite>/tasks/<task-id>/
├── Task.md # human-reviewed control-plane spec
├── task.toml # required Harbor configuration
├── instruction.md # required agent input
├── environment/ # required Environment definition and visible state
│ ├── Dockerfile # use this or docker-compose.yaml
│ └── docker-compose.yaml # optional; primary service must be main
├── tests/
│ ├── test.sh # required Harbor Verifier entry point
│ ├── test_*.py # optional Verifier helpers
│ └── fixtures/ # optional hidden Verifier data
└── solution/
└── solve.sh # optional reference path
Never copy or mount Task.md into the evaluated agent's workspace or image.
The agent receives instruction.md and only the Environment state intended for
the run.
Include:
- purpose and source evidence;
- exact input and later turns;
- only the Harness conditions relevant to this Task;
- initial state, services, access, visibility, reset, and production differences;
- required results, prohibited effects, accepted alternatives, and independent Verifier evidence;
- fairness, leakage risks, and invalid-run conditions; and
- open decisions and assumptions.
Show the full Task Spec and the World Skill changes to the user. Explain what
is already in the World Skill, what this Task adds or corrects, and what stays
only in Task.md. Revise both through the same back-and-forth. Mark the Task
Spec approved only after explicit approval. Treat World Skill changes as
accepted only after the user reviews them. If the user requests an end-to-end
build without an approval pause, continue with an agent-reviewed
Status: Draft and label the World Skill changes as unreviewed.
If implementation changes the request, visible information, material
Environment behavior, or scoring boundary, update Task.md and show the
change. Set its status back to Draft. Show the diff and require explicit
reapproval before setting it to Approved again.
4. Apply Spec2Task
Follow Task implementation. It gives the build order and routes each decision to the Environment, synthetic-data, Verifier, Harbor, and calibration references.
For an existing project, use its pinned or supported Harbor version. Otherwise, use the installed supported version and record it. Upgrade only with user approval and a stated compatibility reason. Use the installed CLI help as the command contract.
Before a scored model run:
- Confirm the model, trial count, judge, timeout, and maximum expected cost with the user unless the user already authorized that run plan.
- Complete the package audit in Harbor. Confirm every required file, entry point, path, permission, configuration value, mount, service, and reward output needed for this exact Task is present and works through Harbor. Confirm hidden Task, Verifier, solution, and secret material is absent from the agent-visible image and workspace.
- Check setup and trial isolation in the way that fits the Environment. A fresh container or worktree can provide isolation by replacement. A reused mutable service needs a checked reset. Immutable frozen data needs only a checked load. See Task implementation.
- Exercise every operation the Task depends on.
- Run the reference path when one exists.
- Test the Verifier with a clear valid result, a valid alternative, a realistic wrong result, a shortcut, a prohibited collateral change, and missing or corrupt evidence.
- Confirm every completed Verifier path writes a valid reward and useful evidence without exposing hidden truth or secrets.
5. Run and audit
Run the actual Harness through Harbor. Read the complete trajectory, not only the reward. Inspect:
- messages, model calls, tool calls, results, retries, and errors;
- initial and final Environment state and external effects;
- service, setup, readiness, reset, and cleanup evidence;
- each Verifier criterion, its evidence, decision, and error; and
- the resolved Harness, model, Environment, and judge configuration.
Classify each unsuccessful run as an agent capability failure, missing information, Harness defect, Environment defect, Verifier false rejection, Verifier false acceptance, leakage, or infrastructure failure. Fix non-agent failures before using the score.
Model comparison is an optional calibration strategy, not a completion rule. When it would answer a real uncertainty, compare a weaker model, the target model, or a stronger model and repeat trials when behavior is variable. Read every selected trace. Contrast can expose unclear inputs, brittle setup, leakage, shortcuts, or reward hacks. Pass rates and model ordering do not prove Task quality.
Read Calibration for the complete audit method.
6. Reconcile project World knowledge
Use World knowledge throughout Task design, implementation, and audit. Add or correct project-specific knowledge when the work supplies evidence that would help another Task. This can include Task patterns, Environment methods, data creation, Verifier evidence, run procedures, scripts, assets, and examples.
After the audit, reconcile the World Skill with what the completed Task proved. Show the user:
- the proposed reusable knowledge;
- the evidence supporting it;
- how another Task would use it;
- where it should live; and
- what remains specific to the completed Task.
Remove or narrow ideas that the Task disproved. If the user asked for autonomous end-to-end updates without a pause, make the smallest supported update, show it in the final review, and do not imply that the human approved the generalization.
Create only SKILL.md at first. Add references/, scripts/, assets/, or
tests/ only when their real contents justify them.
Keep the completed Task's request, focal state, expected result, and exact
criteria in its collocated Task.md. Do not copy broad guidance that is already
clear in this skill. Record the project-specific adaptation of that guidance.
7. Repeat
Use Tasks two and three to test the World Skill. Check whether it reduces rediscovery, improves Task Specs, preserves important relationships, reuses a proven operation, or prevents a known Verifier defect. Correct rules that are missing, stale, or too broad.
When several materially different Tasks have exercised the shared knowledge and the construction and verification methods are clear, the next cycle can propose several independent Task Specs:
- Mine new repository, trace, and human evidence.
- Use the World Skill to generate distinct Task Specs.
- Have the human review the specs.
- Build independent approved Tasks in parallel.
- Audit every Task individually.
- Update World knowledge only with reusable corrections.
Continue this loop as production behavior, user priorities, agents, and models change.
Dependencies, access, and safety
Map required systems, data, roles, network needs, and safe setup methods. Never read, print, copy, store, or ask the human to paste secret values. Tell the human what dependency is needed, why it is needed, and how the project expects access to be provided. Default to controlled local, frozen, or simulated dependencies. Never write to production during an eval. Treat access, startup, reset, timeout, judge, and Verifier failures as invalid runs, not failed agent work.
Complete only when
Task.mdmatches the built instruction, Environment, and Verifier.- The Task is solvable from agent-visible or normally discoverable information.
- The Environment starts reliably and isolates trials by replacement, reset, or immutable state as appropriate, without leaking hidden truth.
- Valid and invalid Verifier cases behave as intended.
- At least one real Harness run was read in full.
- Non-agent failures were repaired or reported as unresolved limits.
- Model comparison, when used, includes trace review rather than pass rates alone.
- The project World Skill was created or updated with the Task Spec, reviewed during the work, and reconciled with the final evidence.
- The user receives the Task path, run command, results, evidence, and remaining limits.
Open this reference as its own page
Calibration
Calibration tests whether the Task measures the intended capability fairly. A score or pass rate alone cannot answer that question.
Choose evidence
Run the production Harness and target model. Model comparison is optional. Use a weaker or stronger model only when contrast can answer a named uncertainty, such as whether the instruction is unclear, the Verifier is weak, or a shortcut exists. Repeat trials only when behavior varies enough to affect the conclusion. Run a known-good path and focused Verifier fixtures before scored model trials.
Do not require a weak-target-strong ladder or a fixed model count. One carefully inspected target-model run can be sufficient when deterministic checks pass and the run answers the current quality questions.
Do not require a fixed pass-rate pattern. A weak model can pass by finding a leak. A strong model can fail because of a broken service or unfair prompt.
Read complete runs
For each selected trial, inspect:
- all messages, model calls, tool calls, results, retries, and errors;
- initial and final Environment state and external effects;
- setup, service, readiness, reset, timeout, and cleanup logs;
- every Verifier criterion, its evidence, decision, and error; and
- resolved Harness, model, Environment, judge, and timeout settings.
Compare strategies, not only rewards. Check whether the agent had all required information, whether the Environment behaved as designed, whether the Verifier accepted equivalents, and whether a pass used a shortcut or leaked fact.
Classify each problem
| Cause | Meaning | Action |
|---|---|---|
| Capability | Fair access and correct infrastructure, but intended work failed | Keep as an agent result |
| Missing information | A required fact was not visible or discoverable | Fix Task or Environment |
| Harness | Runtime, tool, prompt, session, or adapter was wrong | Fix Harness |
| Environment | State, service, permission, fidelity, or reset was wrong | Fix Environment |
| False rejection | A valid result failed | Fix Verifier |
| False acceptance | An invalid result passed | Fix Verifier |
| Leakage | Hidden truth or scoring logic was visible | Fix packaging or boundary |
| Infrastructure | Build, startup, timeout, judge, credential, or cleanup failed | Repair and rerun unscored |
Do not make a Task harder to hide a defect. First repair all non-agent causes and rerun affected trials.
Judge difficulty and fairness
A good hard Task requires real work. It does not rely on hidden information, unclear language, fragile startup, unrealistic data, or a broken check. If all models fail, test solvability and fairness first. If all pass, inspect for weak criteria and leakage before changing difficulty.
To change difficulty, change one supported condition: more relevant state, longer history, stale or conflicting facts, permissions, delayed effects, required clarification, or collateral-change risk. Keep the required evidence visible or normally discoverable.
Report model and Harness versions, trial counts, criterion results, strategies, failure causes, defects fixed, rerun results, remaining uncertainty, and the next recommended change.
Open this reference as its own page
Discover the Agent, Its Work, and Existing Evals
Discovery should explain the real work, the agent that performs it, the systems around it, and the evidence available for new Tasks. Organize findings in the form that best fits the project. Do not force every finding or trace into a fixed template.
Contents
- Set the scope
- Review the repository
- Map the Harness and connected systems
- Review existing evals
- Review traces
- Cluster real requests
- Review traces in batches
- Learn tool and system behavior
- Map dependencies and access
- Synthesize evidence
Set the scope
Identify the repository and revision, the agent or workflow under test, the existing eval suite, the available trace source, and the human's goal. Keep different agent versions or materially different deployments separate. Mark unknown facts as unknown.
Read repository instructions, manifests, workspace configuration, and focused documentation. When reviewing the repository, do not start services, install packages, open secret stores, or use credentials. Access an external trace source only when the human supplied or approved it.
Review the repository
Start from each real way the agent is invoked. Follow reachable code through:
- Input, prompt, and context assembly.
- Model creation, routing, settings, and fallbacks.
- Agent loops, stopping, retries, and error handling.
- Tools, exact input and output schemas, and validation.
- Tool implementations, connected systems, parsing, and effects.
- Skills, subagents, hooks, middleware, sessions, and memory.
- Files, databases, APIs, applications, network, time, and identity.
- Focused tests, known failures, deployment, local execution, and CI.
Use repository search to locate code, then read the complete relevant functions, callers, schemas, and focused tests. A README or directory listing can locate behavior, but it does not prove runtime behavior.
Keep notes in whatever structure makes relationships clear. Cite important claims with repository paths and symbols. Distinguish what source code proves, what a test proves, what a trace only suggests, and what remains uncertain.
For a large repository, divide review by real runtime area, system, or workflow. Do not divide work by arbitrary file counts. The main reviewer must join cross-area relationships and check the source behind consequential findings.
Map the Harness and connected systems
The Harness is the evaluated agent behavior: prompts, model loop, tools, session behavior, and adapter. The Environment contains the files, data, services, identity, permissions, network, clock, and mutable state around it.
Follow each agent capability across that boundary. For a search tool, inspect the registered tool name and arguments, how the Harness parses results, the service that answers the query, the returned record shape, permissions, ordering, pagination, errors, and any state changed by the call.
Map only details that can affect Task design or faithful execution:
- how requests enter the Harness;
- information added before the model sees a request;
- tools available in each condition;
- exact request, response, and error shapes;
- state read or changed by each operation;
- permissions, identity, time, ordering, and pagination;
- loops, retries, fallbacks, stopping, sessions, and memory;
- user-visible and external effects; and
- differences introduced by the Harbor reconstruction.
Repository definitions are the primary source for intended schemas. Traces are useful evidence of real values, error shapes, latency, ordering, and behavior. Compare both when designing a simulated system.
Review existing evals
Follow each scored path from instruction to reward:
- Read the exact agent input and promised result.
- Read output parsing and fallback behavior.
- Read every objective check and semantic judge.
- Read weights, partial credit, thresholds, and the complete pass rule.
- Read tests for valid, invalid, and partly valid results.
- Correlate available run evidence with the exact Task version.
Look for unstated checks, unchecked requirements, hidden preferences, leaked truth, false acceptance, false rejection, stale evidence, and infrastructure errors reported as agent failures. New Task directions must add a meaningful condition, capability, failure mode, or evidence requirement.
Review traces
Use a trace source supplied or approved by the human. Record enough source context to cite findings later, such as project, agent version, filters, time range, export time, and stable conversation or trace identifiers.
When traces are in LangSmith, use the authenticated langsmith CLI to sample
with runs list or threads list and threads get. Use runs export for a
repeatable JSONL snapshot when needed. Check authentication with
langsmith auth info, pin the target with --workspace, request --format json
for parsed list or get output, and consult each command's --help for filters.
In an agent-based workspace, find the agent with langsmith agents list, then
resolve its environment to a session ID with
langsmith projects resolve --kind AGENT --id <agent-id> --environment <ENVIRONMENT>
before project-scoped queries. Keep raw exports out of the
repository and Harbor Tasks; synthesize privacy-safe scenarios from them.
A trace system can store one interaction as several related records. Names and relationships differ across products. Reconstruct the user-visible interaction and all relevant agent activity in time order. Include the initial request, later user turns, model responses, tool calls and results, retries, errors, state changes, and final outcome when they exist. Do not assume terms such as parent run or child run are available.
Start with a varied sample. Include different request types, tools, lengths, outcomes, permissions, agent versions, and failure shapes. Keep incomplete and failed interactions visible. They can reveal important dependencies and Task conditions.
Look for:
- what users actually ask the agent to accomplish;
- how much context, detail, data, and constraint users provide initially;
- facts users expect the agent to discover;
- ambiguity, follow-up questions, corrections, and changed requests;
- desired outputs, state changes, files, messages, or decisions;
- common agent strategies and where they diverge;
- failed tool calls, malformed arguments, empty results, permission errors, timeouts, retries, and fallback behavior;
- loops, abandoned attempts, unsupported claims, and partial completion;
- user dissatisfaction, corrections, rejection, repeated requests, abandonment, and explicit acceptance;
- final system state and external effects, not only the final response;
- cases where a user appears satisfied despite a hidden error, or unhappy despite correct work;
- tool and system schemas observed in real use; and
- realistic conditions that could become Tasks without copying private data.
Preserve citations for important examples and aggregate claims. A note can use a trace ID, conversation ID, stable event ID, or another locator supported by the source. The structure of the note is flexible. It only needs enough context for another reviewer to understand and verify the claim.
Traces show observed behavior. They do not prove intended policy, complete business rules, or a correct answer. Use repository code, tests, source data, policies, final state, or human decisions as independent truth.
Cluster real requests
Group requests by underlying work and outcome, not by exact wording. Useful dimensions can include:
- user goal and requested artifact or state change;
- systems and tools needed;
- read-only, analytical, drafting, or mutating work;
- amount of context supplied by the user;
- information the agent must discover or clarify;
- permission, policy, time, or identity conditions;
- single-turn or multi-turn interaction;
- common failure or user dissatisfaction; and
- independent evidence available for verification.
Name each cluster in plain language. Keep representative citations and note important variation inside the cluster. Counts can show frequency in the sample, but they do not establish business priority or population frequency unless the sample supports that claim.
Preserve rare but important requests, especially those involving safety, permissions, high-impact effects, or a distinctive capability. Do not force an unclear request into a cluster only to make the grouping complete.
Use the clusters to propose coverage, not to copy production conversations. Translate a cluster into a Task only after defining a controlled Environment, independent evidence, fairness boundary, and privacy-safe scenario.
Review traces in batches
When the trace set is large, review several small batches before expanding. Choose batches by stable identifiers, time windows, request clusters, agent versions, or outcomes. Keep batches non-overlapping unless overlap is an intentional review check.
If subagents are available and parallel review is useful:
- The main agent defines shared analysis questions and privacy limits.
- Give each subagent a bounded, non-overlapping batch and the same definitions.
- Ask for request clusters, representative citations, tool and system facts, failure patterns, user reactions, possible Task conditions, and uncertainty.
- Do not require one fixed response template. Require evidence for important claims and enough structure to merge results.
- The main agent merges equivalent clusters, keeps disagreements visible, checks representative citations, and audits a sample from each batch.
Do not treat subagent agreement as truth. Retrieve more traces only to answer a named gap, test whether a pattern repeats, or cover a missing segment.
Learn tool and system behavior
Trace review should help reconstruct the systems an eval may need to simulate. For each important tool or system, learn what evidence permits:
- exact operation and argument names;
- required, optional, enum, and nested fields;
- output objects, identifiers, ordering, pagination, and null behavior;
- validation, permission, empty-result, rate-limit, and timeout errors;
- retries and whether repeated calls are safe;
- reads, writes, external effects, and delayed effects;
- identity, role, tenant, time, and other hidden context;
- relationships across records and systems; and
- which behavior is defined by code versus only observed in traces.
Do not infer a complete API contract from one successful call. Compare varied calls, failures, repository schemas, tests, and approved documentation. Record known limits so a simulated Environment does not claim unsupported fidelity.
Map dependencies and access
Map every dependency needed for discovery, Task construction, model runs, or verification. This can include repositories, trace systems, documents, databases, APIs, applications, sandboxes, model providers, networks, VPNs, proxies, browser sessions, roles, and credentials.
Never read, print, copy, store, or ask the human to paste secret values. Do not
open .env files, credential stores, tokens, cookies, private keys, or secret
configuration. Inspect only safe code and sample configuration that names a
dependency or variable.
When access is needed, tell the human:
- which dependency is needed and for what step;
- the account, role, scope, or permission required;
- the safe setup mechanism supported by the project;
- the network or local environment requirement;
- whether read-only, sandboxed, frozen, or simulated access can work; and
- what fidelity or evidence is lost without access.
The human supplies access through the approved runtime mechanism. The agent uses only that mechanism and never records the value. After a safe access path works, record the reusable setup pattern in project World knowledge: dependency name, required role and scope, variable or profile name, setup command or documentation path, readiness check, and known limits. Never record the secret.
Synthesize evidence
Before proposing Tasks, give the human a clear synthesis. Choose the structure that best communicates the project. Cover:
- the Harness and connected-system behavior relevant to evaluation;
- real request clusters and representative trace citations;
- user-provided detail, common ambiguities, and interaction shape;
- tool schemas, system state, effects, errors, and simulation implications;
- agent failure patterns and user dissatisfaction signals;
- existing eval coverage and defects;
- dependencies, safe access needs, and missing evidence;
- conflicts, assumptions, and unknown facts;
- candidate reusable World knowledge; and
- two or three supported Task directions.
Protect private data. Summarize or replace identities and raw content when they are not needed to support the finding.
Open this reference as its own page
Environment Building
Build the smallest resettable world that preserves the production behavior the
Task needs. Put Task-specific choices in the collocated Task.md. Put proven,
reusable project methods in the project World Skill.
Define the boundary
The Environment owns files, data, services, identity, permissions, network, clock, flags, initial state, effects, and reset. The Harness owns prompts, the model loop, tools, hooks, memory, sessions, and parsing. A tool server can run in the Environment, but its interface must match what the Harness expects.
Choose each dependency deliberately:
| Mode | Use when |
|---|---|
| Live | A safe read-only dependency is hard to reproduce and can be pinned or recorded. |
| Frozen | Content must stay stable, such as a document corpus or repository revision. |
| Simulated | Writes, failures, permissions, time, or state must reset for each trial. |
Default to controlled local dependencies. State what differs from production. Never write to production during an eval.
Write the contract in Task.md
Record:
- exercised operations and exact request and response shapes;
- source of truth, initial records, relationships, and constraints;
- identity, permissions, time, ordering, pagination, and relevant errors;
- reads, writes, external effects, and reset;
- evidence from code, tests, traces, or approved production reads; and
- fidelity limits and agent-visible information.
Define one canonical truth source for each part of state. A cross-system Task can use several stores when the production decision depends on their distinct behavior. Keep IDs, time, and generated values stable. Enforce domain rules in the backend, not in a prompt or Verifier. Do not key behavior on the Task ID, expected answer, exact instruction, or hidden tool sequence.
Preserve relationships
Create a relationship-complete subset. Include each record needed to exercise the decision and each related record needed to make it valid. For a ticket, this can include its account, requester, owner, entitlement, and relevant history. Do not add random distractors. Each extra item must test a named condition such as ambiguity, freshness, permissions, or a constraint.
Use the smallest faithful injection point: a fixture, temporary workspace, seeded SQLite database, local endpoint, frozen corpus, or local tool server. Keep production tool names, schemas, parsing, and exercised errors. Replace the service or data behind the interface, not repository tool code.
Protect hidden evidence
The Harness must see state only through its normal interface. The Verifier can read raw final state through a separate boundary. Do not expose expected results, hidden tests, judge rules, reference actions, or a state dump tool to the evaluated agent.
Record non-secret requests, responses, errors, and mutations when they occur. Capture initial and final state. Use one Environment instance per trial. Keep state across turns. After timeout or failure, destroy and replace a disposable Environment or reset reused mutable state. Make reset safe to run more than once when reset is the isolation method.
Check fidelity before a model run
- Check trial isolation in the way this Environment needs. For reused mutable state, make a representative change, reset, and confirm the Task-relevant baseline returns. For a fresh disposable Environment, verify one clean construction. For immutable frozen data, verify the pinned input loads; no reset check is needed.
- Call every operation the Task needs.
- Confirm valid actions succeed and invalid actions fail for the right reason.
- Compare schemas, ordering, permissions, errors, and state changes with production evidence when approved evidence exists.
- Run a reference path when reachability is uncertain.
- Confirm the agent cannot read hidden truth or bypass the normal interface.
- Run the real Harness and inspect whether the Environment created the intended decision.
Copy reusable setup, reset, schema, or fixture methods into the project World Skill only after real Tasks prove them useful.
Open this reference as its own page
Harbor
Contents
Use the project's pinned or supported Harbor version. Otherwise, use the installed supported version and record it. Upgrade only with user approval and a stated compatibility reason. Use that CLI's help as the command contract. Use Docker locally unless the Task requires another supported Environment.
Task layout
Create this package before any Harbor trial:
evals/<suite>/tasks/<task-id>/
├── Task.md # required by langchain-eval-engineering; hidden from agent
├── task.toml # required by Harbor
├── instruction.md # required by Harbor; exact agent input
├── environment/ # required by Harbor
│ ├── Dockerfile # use this or docker-compose.yaml
│ ├── docker-compose.yaml # optional; primary service must be main
│ └── <agent-visible seed files>
├── tests/
│ ├── test.sh # required Harbor Verifier entry point
│ ├── test_*.py # optional Verifier helpers
│ └── fixtures/ # optional hidden Verifier data
└── solution/
└── solve.sh # optional reference path
The files have these contracts:
Task.mdis the human-reviewed control-plane spec. Keep the exact request, initial state, hidden truth, complete scoring rules, fairness analysis, and open decisions here. Never mount or copy it into the agent image or workspace.task.tomlfollows the installed project-supported Harbor schema. Record the agent and Verifier timeouts, Environment resources and services, network policy, and runtime variable names needed by this Task. Never store secret values in it.instruction.mdcontains the exact approved agent input. State the goal, agent-visible context, required output or effect, paths, and real limits. Do not mention hidden tests, scoring, expected answers, or the solution.environment/contains one usable Environment definition: aDockerfile, or adocker-compose.yamlwhose primary service ismain. Include only the dependencies and seed state visible to the agent. Never copyTask.md,tests/,solution/, hidden truth, judge rules, or credentials into it.tests/test.shalways exists. Harbor uploadstests/only after agent work ends and runs this file as the Verifier entry point. It may call optional helper tests and hidden fixtures. It must read independent evidence and write a valid reward to/logs/verifier/reward.txtor/logs/verifier/reward.jsonon every completed Verifier path. It must not exit before writing the reward, turn an infrastructure failure into a zero, or expose hidden truth or secrets in output.solution/solve.shis optional. When present, it performs the real reference work against the same Environment and proves the intended result is reachable. It does not write a hard-coded answer only to satisfy the Verifier.
Use optional Verifier helpers, fixtures, or a solution only when the Task needs them. Do not create empty placeholder files or directories.
A Harness adapter can bind approved dependencies and translate I/O. It must not decide the answer or fabricate actions.
Keep generated jobs outside task source, for example under evals/jobs/. Keep
them until the user accepts, revises, or drops the eval. Before retaining
private transcripts, define who can read them, what must be redacted, how long
to keep them, and how to delete them. Keep only the evidence needed to audit
the Task.
Audit package completeness before running
Use harbor --help and subcommand help to confirm current flags. Resolve the
configuration without a scored run when the installed version supports it.
Do not start any Harbor trial, including an Oracle or model trial, until this
audit passes for the exact Task package:
- Confirm
task.toml,instruction.md,tests/test.sh, and a usable Environment definition all exist at the paths Harbor will load. ConfirmTask.mdexists beside them for human review. - Parse
task.tomlwith the supported Harbor version. Confirm exact Task selection, Harness or adapter, model, resources, network policy, runtime variable names, trial count, concurrency, timeouts, judge, and output paths. - Build and start the Environment through Harbor. Confirm mounts, the
mainservice when Compose is used, readiness, agent-visible seed state, allowed operations, cleanup, and trial isolation. - Inspect the built agent image and workspace. Confirm they do not contain
Task.md,tests/,solution/, hidden evidence, expected answers, judge rules, or secret material. - Confirm Harbor can upload and execute
tests/test.shwith the required file permissions and working paths. Exercise each Verifier dependency. - Run known-good, alternative-valid, wrong, shortcut, collateral-change, and missing-or-corrupt-evidence cases through the real Verifier command. Confirm each completed path produces a parseable reward and criterion evidence.
- Run
solution/solve.shthrough Harbor when it exists, then run the Verifier. Confirm the reference result is reachable and receives the intended reward. - Fix every missing file, invalid path, parse error, build error, startup error, missing dependency, permission error, missing reward, or leaked file before starting a trial.
Docker is the default boundary, not proof that isolation works. Test allowed and denied access when network policy matters. Report a limit if the backend cannot enforce or expose it. Never put secret values in source, images, prompts, fixtures, or logs.
Run contract
Before model trials, run Environment checks, the reference path, and focused Verifier fixtures through the same images and commands Harbor will use. Increase timeouts only when evidence shows valid work exceeds the current limit. Keep a finite bound and record the reason.
For each trial, retain:
- resolved configuration;
- Harness messages, calls, results, retries, and errors;
- Environment startup, requests, state, reset, and cleanup evidence;
- Verifier criteria, evidence, verdict, reason, reward, and errors; and
- phase timing and termination reason.
Wrong agent work receives zero. Build, adapter, credential, reset, timeout, judge, Verifier, or cleanup failure receives no agent score. Every attempted trial must end as completed, cancelled, or infrastructure error. Do not use a pending trial as evidence.
For multi-turn runs, also prove that the first Harness input equals
instruction.md, later turns came from the declared user policy, one approved
session was reused, future messages were not preloaded, and no model call
occurred after termination. See the multi-turn reference for implementation
details.
Open this reference as its own page
Benchmark Patterns
Use these patterns as evidence-backed starting points. Read the relevant domain section before designing a Task. Open the cited benchmark when its design can answer a concrete question about Task shape, Environment state, tool surfaces, simulation, or verification. Adapt the method to the current project. Do not copy a benchmark's private data, hidden answer, exact scenario, or limitations without review.
Contents
- Benchmark design index
- Automation Environments
- Browser and Desktop Environments
- Coding Environments and Tasks
- CRM and Knowledge-Work Environments
- Multi-Turn and Policy Environments
- Terminal Environments and Tasks
- Cross-domain quality checks
Benchmark design index
Use this table to decide which external design to inspect in more detail.
| Benchmark | Domain | Design worth studying |
|---|---|---|
| AutomationBench | Business automation | Trigger data, pre-populated SaaS state, realistic tool surfaces, assertion-level scoring, and a separate strict completion result |
| AppWorld | Cross-application APIs | Stateful simulated applications, database-backed truth, cross-app workflows, and final-state verification |
| ToolSandbox | Stateful tool use | Controlled hidden state, milestones, tool-call consequences, and reproducible interaction state |
| TheAgentCompany | Workplace agents | Longer work across applications, documents, messages, and durable artifacts |
| WebArena | Browser agents | Reproducible websites, browser interaction, seeded application state, and state-based evaluation |
| WorkArena | Enterprise browser work | Role-aware enterprise tasks, realistic web workflows, and application state |
| WorkArena++ | Multi-application enterprise work | Longer workflows across enterprise applications and role-sensitive state |
| OSWorld | Desktop agents | OS and application snapshots, computer input, cross-application work, and state restoration |
| SWE-bench | Coding agents | Real issues, pinned repository revisions, behavior tests, and patch verification |
| SWE-smith | Scalable coding Tasks | Reproducible mutation and execution pipelines; mutations still need usefulness review |
| CRMArena-Pro | CRM agents | CRM roles, linked business records, permissions, and realistic sales workflows |
| tau-bench | Policy and tool use | User simulation, policy-guided decisions, tool use, and database final state |
| tau-squared Bench | Longer multi-turn work | Both sides of a tool-mediated dialogue, longer interactions, and final-state checks |
| Terminal-Bench | Terminal agents | Isolated command-line Environments, natural instructions, tests, and reference solutions |
A benchmark citation is not an authority claim. Check its current repository, paper, release, license, and task format before copying an implementation pattern. Record which design choice was adapted and why it fits this project.
Automation Environments
Use this pattern
Use for scheduled jobs, event handlers, background agents, retries, alerts, integrations, and work where time or repeated delivery changes correctness.
State and storage
Store current state and append-only events separately. Include:
- Trigger ID and type.
- Scheduled, occurred, observed, and completed times.
- Actor or source.
- Idempotency key, which prevents repeat delivery from causing a repeat effect.
- Attempt count and error class.
- Current workflow state.
- Side effects and their external IDs.
- Cause or parent event.
Use a fixed clock and deterministic event queue. Use an explicit state machine, which lists allowed states and changes. Store enough history to prove retry, deduplication, and recovery behavior.
For each case, define trigger data, pre-populated starting state, the allowed tool surface, and final-state assertions. This is the useful AutomationBench case shape. The trigger starts the workflow; it does not replace the World or the Task success contract.
Services, tools, and access
Simulate mutable queues, schedulers, webhooks, email, and third-party writes unless an approved sandbox is safe and resettable. Preserve payload schema, delivery order, duplicate delivery, error classes, retry limits, and side-effect IDs.
Catalog scheduler, queue, service, cloud, and model credentials by name and scope. Keep the fixed clock and hidden future events unavailable to the agent.
Setup and reset
- Load base state and pending events.
- Set the clock and visibility boundary.
- Start the worker and dependent services.
- Check queue and service readiness.
- Save initial state, events, and external-effect ledgers.
- Reset from the source snapshot, including retry counters and deduplication state.
Test reset after partial effects and timeouts.
Strong Task families
- Process a scheduled action exactly once.
- Recover from a transient error without duplicate effects.
- Stop after a permanent policy or permission error.
- Reconcile a delayed observation with newer state.
- Handle concurrent triggers in a valid order.
Worked Task A: retry a transient delivery
Instruction:
Process the pending notification. The first delivery attempt has a transient error. Complete the delivery without creating a duplicate message.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| final_state | Workflow is complete | Final workflow row | Compare state with completed |
Exact match |
| retry | One allowed retry occurred | Attempt and error rows | Match one transient failure then one success | Exact sequence |
| one_effect | One message exists | External-effect ledger | Count unique message IDs for the source event | One |
| repeat_safety | Both attempts share one repeat-protection key | Attempt records | Compare keys and source event ID | All equal |
| scope | Other work stays fixed | Before and after snapshots | Compare unrelated workflows and schedules | Equal |
Known-good: one transient failure is followed by one successful attempt with the same repeat-protection key and one message. Wrong results: abandon, create two messages, change the key, exceed the retry limit, or change another action.
Worked Task B: handle duplicate triggers
Instruction:
Process the two visible trigger deliveries for the same source event. Apply the business change once and retain audit evidence for both deliveries.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| one_change | Business state changes once | State history | Count changes for the source event | One |
| delivery_log | Both deliveries are retained | Delivery records | Compare delivery ID set | Exact two IDs |
| one_effect | Both deliveries resolve to one effect | Delivery and effect records | Join by source event and effect ID | One shared effect |
| no_loss | Other visible triggers remain | Queue before and after | Compare unrelated trigger IDs and states | Equal |
Known-good: both deliveries are logged and one business effect is committed. Wrong results: apply twice, drop the second delivery record, create two effect IDs, or consume an unrelated trigger.
Calibrate
Use a fixed clock. Run one delivery, duplicate delivery, transient retry, permanent failure, reordered events, partial effect, and timeout. Reset queue, attempt, repeat-protection, and effect state each time. Inspect the full event order and final state. Treat worker startup or clock-control failure as infrastructure.
Report assertion-level partial credit when useful for diagnosis or training. Keep a separate strict completion result that passes only when every required assertion passes.
Difficulty changes
Change one condition: longer delay, retryable then permanent error, concurrent worker, stale read, reordered event, or partial side effect. Use controlled time and known event order so failures remain reproducible.
Sources
- AutomationBench: realistic business workflows over 47 simulated SaaS tools. Borrow its trigger data, pre-populated state, tool surface, assertion-based final-state checks, assertion-level partial credit, and separate strict completion result.
- AppWorld: stateful APIs and database verification across applications.
- ToolSandbox: stateful tool calls, milestones, and controlled interaction state.
- TheAgentCompany: longer-running workplace workflows and artifacts.
Browser and Desktop Environments
Use this pattern
Use when the agent operates websites, browsers, desktop applications, files, and visual interfaces.
State and storage
Pin:
- Website or application version.
- Browser, extensions, profile, and viewport.
- Operating system image and display settings.
- Login state and assigned identity.
- Application databases, files, downloads, and clipboard state.
- Time, locale, timezone, and accessibility settings.
Use local sites or snapshots when live content changes results. Preserve realistic DOM, visual, pagination, latency, validation, and permission behavior. Use accessibility state only when the real Harness can use it.
Services, tools, and access
Choose live services only when accounts, data, reset, cost, and side effects are controlled. Prefer a local clone, frozen site, or sandbox for mutable workflows.
Match the real Harness input and observation surface:
- Screenshots and cadence.
- Mouse, keyboard, scroll, and window controls.
- DOM or accessibility data when available in production.
- Browser downloads and uploads.
- Application launch and focus behavior.
Catalog model, website, SSO, OAuth, VPN, application, and cloud credentials by name, role, scope, provider, and network need. Never save cookies or secret values in specs or committed artifacts.
Setup and reset
- Restore a pinned browser, VM, or application snapshot.
- Establish approved login state through the setup boundary.
- Place required files and clear unrelated downloads and clipboard data.
- Set display, locale, clock, and window state.
- Check readiness through the same surface the agent uses.
- Save raw application state for the Verifier.
- Reset the full profile or snapshot after every run.
Do not rely on clicking back or reversing UI actions as reset.
Strong Task families
- Complete a multi-page business workflow.
- Find and update the correct record among similar records.
- Transfer data between a document and application.
- Respect a permission or confirmation boundary.
- Recover from validation or stale-page errors.
Worked Task A: update a user without changing access
Instruction:
Update the selected employee's department and phone number. Keep their role, group membership, and account status unchanged.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| identity | Correct employee was edited | Final application row | Match stable employee ID | Exact ID |
| fields | Department and phone match | Final application row | Compare normalized requested values | Both equal |
| access | Role, groups, and status stay fixed | Before and after access rows | Exact comparison | Equal |
| persistence | Saved values survive a new session | Reloaded row from clean session | Read again after restart | Both equal |
| scope | Other state stays fixed | Application state difference | Compare non-allowlisted rows and fields | No difference |
Known-good: only the stable employee ID and requested fields change and remain after a new session. Wrong results: update a similar name, change access, leave an unsaved form, or edit another record while searching.
Worked Task B: file-to-application workflow
Instruction:
Read the approved local request file, create the matching application record, and save the confirmation PDF in
/home/oai/share/confirmations.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| source | Created values match the approved request | Parsed source file and final row | Compare named fields | All equal |
| record | One record was created | Before and after application rows | Count new IDs and match type | One |
| artifact | One valid confirmation PDF exists | Required path and parsed PDF | Check path, file count, text, and record ID | One valid file |
| scope | No extra effect occurred | State, upload, message, and file differences | Compare with allowlist | No extra change |
Use application state and file parsing for verification. Use visual comparison only for layout that cannot be checked structurally.
Known-good: one matching application row and one readable confirmation PDF. Wrong results: wrong source file, unsaved form, duplicate record, screenshot instead of PDF, wrong output path, or an extra upload or message.
Calibrate
Restore the snapshot before each reference, wrong-result, and model run. Test a similar identity, unsaved form, changed access, stale page, duplicate submit, and extra file. Verify raw application and file state after a fresh session. Treat login, display, or application startup failure as infrastructure.
Difficulty changes
Change one condition: similar records, more pages, modal or validation error, permission boundary, stale page, cross-application transfer, or required file artifact. Do not create difficulty through tiny targets, hidden UI, or unstable live content.
Sources
- WebArena: reproducible websites, browser interaction, and state-based evaluation.
- WorkArena: enterprise web tasks, roles, and workflow state.
- OSWorld: operating-system and desktop application snapshots, computer input, and cross-application tasks.
Coding Environments and Tasks
Use this pattern
Use for bug repair, feature work, refactoring, tests, build systems, and codebase navigation.
State and storage
- Pin repository URL, commit, submodules, large-file inputs, and toolchain.
- Use a fresh worktree or copy per run.
- Keep package caches outside the scored worktree or reset them explicitly.
- Record repository instructions, generated-file sources, public exports, and build outputs.
- Preserve enough repository history when the agent needs blame, prior changes, or release context.
Model relationships beyond files:
- Public API to implementation.
- Registration to runtime selection.
- Schema to generated artifacts.
- Source package to consumer import path.
- Bug report to failing behavior and focused tests.
Services, tools, and access
Prefer a frozen repository and installed offline dependencies. Allow live package or web access only when the real job requires it and the run can remain safe and comparable.
Preserve the production Harness shell, editor, patch, search, test, and build interfaces. Record private registry credentials, source-host access, and model credentials by variable name only. Keep hidden tests and reference patches unavailable to the agent.
Setup and reset
- Create a fresh worktree at the pinned commit.
- Apply one controlled condition, such as an existing bug or generated mutation.
- Confirm the public failure before the agent starts.
- Capture Git status and relevant generated-file hashes.
- Reset by discarding the whole task worktree, not by reversing guessed files.
Use a container or VM when system packages, services, or compiler state affect the result.
Strong Task families
- Repair a real issue with a reproducible failing test.
- Add a feature through the public API and consumer path.
- Change lifecycle or state behavior across modules.
- Update a schema and all required generated or migration surfaces.
- Diagnose and fix a build, packaging, or release fault.
Do not score a preferred patch shape when tests and public behavior define correctness.
Worked Task A: repair duplicate pagination
Instruction:
Fix the duplicate-item pagination bug in
/workspace. Keep the public API compatible. Add or update focused tests for duplicate-free traversal.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| behavior | Pagination has no duplicate items | Focused test output | Run the pinned reproduction and boundary tests | All pass |
| regression | Related behavior still works | Existing focused suite | Run the named test files | All pass |
| compatibility | Public call shape remains available | Consumer import and call test | Import and call the old public function | Test passes |
| scope | No unrelated change | Git diff and generated-file hashes | Compare with an allowlist | No extra path or hash change |
Known-good: a patch that fixes cursor advancement and adds a focused boundary test. Wrong results: filtering duplicate output after retrieval, changing the public signature, disabling the failing test, or editing unrelated snapshots.
Worked Task B: add a public extension
Instruction:
Add the requested provider through the public package import path. Register it in runtime selection and add a consumer-facing test.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| implementation | Provider performs the requested behavior | Focused provider test | Run the named behavior case | Passes |
| registration | Runtime selects the provider | Factory test and registry state | Load valid config through the public factory | Correct class returned |
| public surface | Consumer import works | Clean consumer process | Import from the documented package path | Import succeeds |
| tests | Related code remains valid | Pinned internal and consumer suites | Run the named tests | All pass |
| scope | Other providers and defaults stay fixed | Git diff and config snapshot | Compare named files and defaults | No extra change |
Known-good: implementation, registry entry, public export, and consumer test from the source files that own each surface. Wrong results: implementation without registration, internal export only, unit test only, or hand-edited generated output without its source update.
Calibrate
Run the reference patch, no-op patch, disabled-test shortcut, and unrelated edit. Run agent trials when they answer a named calibration question. Inspect the selected diffs and each named test. Treat toolchain, dependency, and build-start failures as infrastructure errors, not coding failures.
Difficulty changes
Change one condition: cross-package surface, longer call path, missing regression test, lifecycle interaction, migration, partial failure, or more plausible distractor code. Do not remove needed issue context or rely on a huge unrelated test suite to create difficulty.
Sources
- SWE-bench: real repository issues, pinned commits, and test-based patch verification.
- SWE-smith: programmatic mutation and scalable task generation. Borrow reproducible generation and execution; do not assume every mutation is useful work.
- Terminal-Bench: isolated command-line Environments and reference solutions for tasks that cross system setup.
CRM and Knowledge-Work Environments
Use this pattern
Use for sales, support, operations, research, documents, messaging, meetings, and work that crosses business applications.
State and storage
Use a relational store for identities and mutable business records. Use files or document tables for email, notes, reports, transcripts, and attachments. Add search only when retrieval behavior is part of the Task.
Model:
- People, organizations, accounts, and aliases across services.
- Ownership, teams, roles, and permissions.
- Opportunities, cases, tasks, and status history.
- Messages, meetings, documents, and source records.
- Product usage, contracts, and time-dependent facts.
- Draft, sent, approved, and deleted states.
- Conflicting, stale, and missing observations.
Create structural facts with code. Create selected prose through source-supported generation requests and criterion-level review.
Services, tools, and access
Choose per service:
- Frozen for read-only corpora that must remain comparable.
- Simulated for mutable CRM, messaging, calendar, or document state.
- Live sandbox only when reset, privacy, cost, and side effects are controlled.
- Disabled for irrelevant access that adds leakage or risk.
Match tool names, arguments, results, pagination, permission errors, and effects. Catalog CRM, email, calendar, document, model, and search credentials by name, account, role, scope, network need, and provider. Do not store values.
Setup and reset
- Select a relationship-complete record set, not one isolated row.
- Preserve identities, history, documents, and cross-service IDs.
- Apply one named setup operation through a service or checked builder.
- Give the agent only its assigned identity and production-shaped tools.
- Reset from a clean database or snapshot after every run.
- Save initial and final state plus message and document effects.
Strong Task families
- Reconcile records across systems and update the source of truth.
- Draft a message or report supported by several services.
- Act on a request while respecting permissions and policy.
- Detect stale or conflicting state and clarify before action.
- Complete a multi-step workflow without duplicate or collateral effects.
Worked Task A: update an account after a meeting
Instruction:
Review the latest meeting and current account state. Update the account's next step and create an internal follow-up note. Do not send an external message.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| account | Correct account has the supported next step | Before and after CRM rows plus meeting | Match account ID and allowed values | Exact match |
| note | One supported internal note exists | New note and meeting facts | Check count and cited facts; judge only unsupported prose | One valid note |
| identity | Assigned user made permitted changes | Audit log, owner, and role | Match actor, owner, and permission rule | All match |
| no_message | No external draft or send exists | Message and draft tables | Compare before and after | Equal |
| scope | Other business records stay fixed | Stable state snapshot | Compare every non-allowlisted row and field | No difference |
Known-good: supported next step plus one source-supported note. Wrong results: use an older meeting, update a similar account name, claim a decision not made, send an email, or change a related opportunity that was not requested.
Worked Task B: produce a portfolio brief
Instruction:
Create a brief for the assigned accounts. Rank urgent items, cite the source record for each claim, and state conflicts instead of resolving them without evidence.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| coverage | Each qualifying assigned account appears once | Assignment and issue rows plus brief | Recompute expected account IDs and counts | Exact set and count |
| ranking | Order follows the stated urgency rule | Source values and brief order | Recompute score and compare order | Exact order, allowing declared ties |
| sources | Each material claim names a valid record | Brief citations and source rows | Resolve each ID and compare its claimed fields | Every claim supported |
| uncertainty | Conflicts stay explicit | Conflicting rows and brief text | Check required conflict IDs; judge only whether wording preserves uncertainty | All conflicts stated; none invented |
Known-good: every qualifying account appears once in recomputed order with valid citations and stated conflicts. Wrong results: omit an account, include an unassigned account, use stale state, cite a missing record, or hide a conflict. Use a limited judge only for claim support and useful wording.
Calibrate
Run the reference actions, wrong identity, stale-source, duplicate-effect, unsupported-claim, and collateral-change cases before model trials. Reset all services between runs. Inspect final state, audit rows, citations, and each meaning-based result. Do not treat service startup or login failure as Task failure.
Difficulty changes
Change one condition: similar names, longer history, cross-service identity, stale record, permission boundary, several valid actions, or collateral-effect risk. Do not make the Task hard by hiding a required source.
Sources
- AppWorld: stateful application APIs, cross-application tasks, and database-based verification.
- CRMArena-Pro: CRM roles, records, and business workflows. Use domain structure, not private data.
- WorkArena++: enterprise application workflows and role-sensitive state.
- tau-bench and tau-squared Bench: policy, user interaction, tool use, and final-state checks.
- TheAgentCompany: longer workplace tasks across tools and artifacts.
Multi-Turn and Policy Environments
Use this pattern
Use when success depends on conversation, hidden user facts, clarification, consent, policy, escalation, or changes during a dialogue.
State and storage
Keep separate:
- Agent-visible conversation.
- User simulator facts and goals.
- Policy rules.
- Mutable service state.
- Tool calls and effects.
- Turn and time limits.
The simulator may know facts the agent must ask for. It must not reveal facts without the defined trigger or judge correctness itself. Store final service state independently from dialogue.
Services, tools, and access
Preserve production tool schemas, permission errors, and state changes. Use a simulated user for repeatability and a simulated or sandbox service for mutable effects.
Catalog model credentials for the agent, user simulator, and any judge separately. Pin each model. Keep simulator facts, policies, and expected results hidden from the agent.
User simulator contract
Define:
- Goal and known facts.
- Facts supplied initially.
- Facts supplied only after a clear question.
- Behavior on vague, repeated, or leading questions.
- Consent and refusal behavior.
- When the user corrects a mistake.
- Stop condition and turn limit.
Do not let the simulator help the agent simply because progress stalled.
Setup and reset
- Create fresh service state and conversation state.
- Set the assigned identity, policy version, clock, and simulator facts.
- Check tools before the first turn.
- Save every turn, tool call, and state change.
- Reset both conversation and service state after every run.
Strong Task families
- Gather required facts before an action.
- Apply policy while helping the user reach a valid outcome.
- Clarify conflicting identity or intent.
- Refuse or escalate a prohibited request.
- Recover after the user changes a material fact.
Worked Task A: policy-bound refund
User start:
I need a refund for my last order.
Hidden user facts include order identity, reason, and whether the item was used. Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| identity | Customer and order are confirmed | Dialogue and service IDs | Find explicit confirmation before action | Correct IDs confirmed |
| facts | Required facts are obtained first | Ordered turns and policy fields | Check each required answer precedes the action | Complete and ordered |
| policy | Action follows the pinned rule | Policy and confirmed facts | Recompute allowed action | Exact match |
| state | Service records match that action | Final order, refund, and escalation rows | Compare expected fields and counts | Exact match |
| scope | No extra effect occurred | Before and after service state | Compare non-allowlisted rows | Equal |
Known-good: confirm the order and required facts, then create only the refund or escalation allowed by policy. Wrong results: act on the latest order without confirmation, infer item state, invent an exception, create both refund and credit, or refuse an allowed request.
Worked Task B: clarify an identity conflict
User start:
Move Alex's meeting to Friday afternoon.
Two visible contacts match Alex. Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| clarification | Agent asks before changing state | Ordered dialogue | Find a question that names a distinguishing fact before the tool call | Present and ordered |
| selection | Confirmed contact owns the changed event | User reply and final event | Resolve confirmed contact ID and compare | Exact match |
| time | New time follows request and calendar rules | Final event, clock, and policy | Recompute allowed Friday window | Within window |
| scope | Other events and attendees stay fixed | Calendar difference | Compare with focal-event allowlist | No extra change |
Dialogue checks should establish that clarification happened. Final calendar state proves the action.
Known-good: ask one distinguishing question, receive the answer, then move only the confirmed contact's event. Wrong results: guess from name, ask after the move, change both events, choose a blocked time, or change attendees.
Calibrate
Run scripted good, ambiguous, changed-request, refusal, repeated-question, and premature-action conversations before model trials. Inspect ordered turns and final service state. Reset both after every run. Treat simulator, model, or tool startup failure as infrastructure, not policy failure.
Difficulty changes
Change one condition: more hidden facts, policy exception, conflicting user statement, changed request, permission boundary, or tool state change. Do not make the simulator evasive beyond the defined user behavior.
Sources
- tau-bench: user simulation, policy-guided tool use, and database final state.
- tau-squared Bench: longer interactions and both sides of a tool-mediated dialogue.
- ToolSandbox: stateful tool use, milestones, and controlled hidden state.
Terminal Environments and Tasks
Use this pattern
Use for command-line diagnosis, repair, build, data processing, services, systems work, and tasks that require a container or VM.
State and storage
Pin:
- Base image or VM snapshot.
- Operating system and architecture.
- Installed tools and versions.
- Files, permissions, owners, and working directory.
- Processes, ports, services, and clocks.
- Offline packages, datasets, and repositories.
- CPU, memory, storage, GPU, and network limits.
Keep tests and reference solutions outside the agent-visible image. Store starting-state and final-state evidence for files, processes, services, and command results.
Services, tools, and access
Use a single container when possible. Use Compose only for real service
boundaries; name the primary Harbor service main. Add health checks for
dependencies.
Disable network unless the real Task requires it. Record registry, cloud, SSH, database, and model credential names and scopes. Never bake secrets into images or pass them as build arguments.
Setup and reset
- Build from a pinned image.
- Install pinned runtime dependencies or include approved offline assets.
- Place agent-visible files only.
- Start services and check observable readiness.
- Capture baseline files, permissions, processes, and service state.
- Reset by replacing the container or VM.
Separate Environment build errors, service startup failures, timeouts, and Verifier errors from Task failure.
Strong Task families
- Diagnose and repair a broken service.
- Restore or transform data under constraints.
- Configure a tool or deployment correctly.
- Repair a build or dependency fault.
- Investigate logs and produce a tested fix.
Worked Task A: repair a local service
Instruction:
The service in
/appfails its health check after restart. Diagnose and fix it. Keep its public endpoint and stored records compatible.
Use five required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| readiness | Service becomes healthy | Process, port, and health output | Start with the pinned command and poll to the limit | Healthy in time |
| behavior | Public endpoint is correct | Request and response | Run named requests and compare status and body | All match |
| persistence | Existing records stay readable | Baseline and final store | Read and compare every pinned record | Equal |
| restart | Fix survives restart | Fresh process and requests | Stop, start, wait, and rerun checks | All pass |
| scope | Other system state stays fixed | Port, process, file, owner, and permission differences | Compare with allowlist | No extra change |
Known-good: the normal start command reaches health, serves correct stored data, and does the same after restart. Wrong results: bypass health, hardcode a response, delete stored data, leave a foreground process only, or open an extra port.
Worked Task B: recover a damaged dataset
Instruction:
Recover all valid records from
/data/input, write stable, sorted JSONL to/data/output/recovered.jsonl, and report rejected record IDs.
Use four required criteria:
| ID | Required result | Evidence | Exact check | Pass |
|---|---|---|---|---|
| recovery | Every valid record appears once | Independent parser and output | Recompute valid IDs and compare output IDs | Exact set, no duplicates |
| rejection | Every invalid ID has a valid reason | Independent errors and report | Compare ID set and allowed reason per ID | Exact match |
| format | Output is stable JSONL | Parsed output and second run | Check schema, sort key, bytes, and repeat build | All match |
| scope | Inputs and other files stay fixed | Before and after file hashes | Compare outside the output allowlist | Equal |
Known-good: recover the exact valid ID set in stable order and report every invalid ID once. Wrong results: drop or duplicate rows, repair unsupported values, write only to stdout, change an input, use unstable order, or give an unsupported rejection reason.
Calibrate
Run the reference solution, no-op, hardcoded response, data deletion, foreground-only service, partial recovery, and unrelated-file edit. Rebuild the container or VM for each run and test restart. Treat image build, service startup, and resource failure as infrastructure.
Difficulty changes
Change one condition: more services, partial failure, permission fault, restart, larger data, limited resources, or cross-file consistency. Do not create difficulty through missing tools, impossible timeouts, or hidden network needs.
Sources
- Terminal-Bench: isolated terminal Environments, natural instructions, tests, and reference solutions. Pin the exact 2.x or 3.x release because formats and Verifiers can change.
- SWE-bench: repository repair and test-based correctness when the terminal Task includes code changes.
Cross-domain quality checks
For every adapted pattern, ask:
- Does the Task require useful production work and the selected capability?
- Is all needed information visible or normally discoverable?
- Does the Environment preserve the relationships that change the decision?
- Can independent evidence prove required and prohibited results?
- Can an agent pass through wording, record order, leakage, or a shortcut?
- Does the Task add a meaningful condition rather than rewrite an old prompt?
- Which benchmark design was adapted, and which limitation was rejected?
- If model contrast was useful, what did the selected complete traces reveal?
Store proven project-specific adaptations in the project World Skill. Keep the
exact request, focal state, expected answer, and scoring criteria in the
collocated Task.md.
Open this reference as its own page
Synthetic Data
Create structured truth with deterministic code. Use a model only for fields that need natural language or semantic variation.
Build structured truth first
Define IDs, relationships, permissions, dates, state, constraints, and edge cases in code. Use a fixed seed. Materialize the result so each trial gets the same data. Validate foreign keys, event order, permissions, counts, and required scenario conditions before generating prose.
Create a relationship-complete subset. Each record must support the intended decision, a named distractor, or a required relationship. Do not use answer-coded names, insertion order, a single obvious choice, or unrelated noise.
Generate prose from facts
Give the generator one structured request per output. Include:
- stable request and target IDs;
- allowed source facts with fact IDs;
- document type and workflow position;
- required and prohibited claims;
- time bounds and output fields; and
- a rubric version.
The generator must use only supplied facts and return the fact IDs it used. It must not invent keys, permissions, source facts, or the planned Task answer. Keep the request, output, generator identity, and content hash.
Separate generation from review
When volume warrants it, generate independent records in parallel. Validate shape with code, then use a separate reviewer for meaning. Do not show the reviewer another review.
Review every output for:
| Check | Question |
|---|---|
| Facts | Does each factual claim match an allowed fact? |
| Time | Are dates and event order valid? |
| Relations | Are people, teams, records, and products connected correctly? |
| Fit | Does the content fit its document type and workflow point? |
| Distinctness | Is it specific and not a near-duplicate? |
| Safety | Does it avoid private data, hidden answers, and agent directions? |
Require pass or fail and evidence for each check. Use code for JSON shape, IDs, date and length bounds, prohibited literals, duplicate hashes, strong overlap, and content-hash matching. Use a reviewer only for meaning that code cannot settle.
Merge only accepted content. Use one transaction. Reject missing, changed, repeated, or failed requests. Validate the complete world after the merge.
Test Task quality
Before model runs, inspect ordinary, boundary, and rejected records with their source facts. Confirm that the Task is solvable through normal discovery and that data does not reveal the expected result. Run the reference path and the Verifier fixtures. When model contrast answers a named uncertainty, inspect the selected traces for confusing records, accidental clues, and unsupported shortcuts. Do not require weak-and-strong model runs for every Task.
Put reusable project schemas, generators, validation rules, and safe examples
in the project World Skill. Keep a Task's focal records and exact expected
answer in its collocated Task.md and Environment assets.
Open this reference as its own page
Design and Review One Task Spec
Sections
- Find directions
- Select one Task
- Write the Task Spec
- Review the Task and World Skill with the human
- Build a family
Find directions
Use repository capabilities, supplied traces, user priorities, production failures, existing eval coverage, and project World knowledge. Start with real work and an observable result. Do not create a Task only because an unusual fixture is available.
Propose one grounded Task in the first user-facing design response after inspection. Use any concise structure that shows the work and capability, non-trivial condition, important failure, Environment and access, independent Verifier evidence, difference from existing Tasks, source evidence, and open decisions. Offer alternatives only when a real user choice changes the design.
In the same response, show relevant knowledge already in the project World Skill and the reusable additions or corrections suggested by the Task. If the skill does not exist, show the small initial content that will support this Task and future Tasks. Frequency in traces can support relevance but does not prove business priority. A repository feature can support feasibility but does not prove the Task is valuable.
Select one Task
A strong Task:
- represents useful work;
- requires the selected capability;
- is solvable from visible information or normal discovery;
- contains a realistic reason the agent can fail;
- produces independently observable evidence;
- accepts materially equivalent results;
- checks harmful side effects;
- avoids hidden trivia and answer leakage; and
- differs from existing Tasks by condition, state, evidence, or failure mode.
Reject a Task that mainly tests prompt decoding, brittle formatting, infrastructure luck, impossible knowledge, or a preferred internal tool sequence.
Use normal request language. State the goal, necessary context, expected output or effect, and real limits. Do not prescribe steps unless the procedure is the capability.
Write the Task Spec
Copy assets/task/Task.md.template into the runnable Task directory beside
task.toml. Keep it outside the agent-visible image and workspace. Create or
update .agents/skills/<project>-world/SKILL.md in the same design loop by
following World knowledge.
Purpose and evidence
Name the work, capability, value, source, and difference from existing Tasks. Use paths, symbols, focused tests, trace IDs, policies, or human decisions for important claims.
Agent input
Write the exact initial instruction and any later turns or triggers. State
context passed outside the instruction. The generated instruction.md must
match either the approved input or the reviewed Draft input used under the
documented no-pause exception.
Relevant agent conditions
Include only Harness behavior this Task depends on: tool interfaces, session persistence, time, retries, or reconstruction differences. Do not repeat a complete repository map in every Task.
Environment
Describe initial state, relationships, visible and hidden information, dependencies, access, identity, permissions, time, network, setup, readiness, reset, and material production differences. Cite project World knowledge used by the design.
Verification
For each required or prohibited result, state independent evidence, the exact objective check or bounded semantic question, and its pass condition. List accepted alternatives, the complete pass rule, and invalid-run conditions.
Fairness and leakage
Explain why the Task is solvable, how the agent can find required information, which shortcuts might work, and how hidden truth stays inaccessible. Name a realistic wrong result and a collateral change that must fail.
Review the Task and World Skill with the human
Show the full Task Spec and World Skill changes before building by default.
Explain what already existed, what the current Task adds or corrects, and what
stays only in Task.md. Let the human revise both. Ask the human to review:
- whether the work and failure matter;
- whether the request is realistic;
- whether the Environment contains enough and only appropriate information;
- whether live, frozen, and simulated choices are acceptable;
- whether the evidence measures the intended outcome;
- whether valid alternatives are allowed;
- whether prohibited effects are complete; and
- whether cost, access, privacy, and safety are acceptable.
Mark Status: Approved only after explicit approval. If the user requested a
full build without another pause, continue with a Draft and label it honestly.
Treat World Skill changes as accepted only after human review.
After implementation, ask for evidence review. Show representative trajectories, final state, Verifier evidence, defects found, revisions made, results, and remaining limits. A reviewed markdown design does not prove a good runnable Task.
Build a family
Prove one Task before creating a family. Then vary one meaningful condition:
- longer or conflicting history;
- similar identities;
- missing or stale information;
- permission or policy boundary;
- required clarification;
- multiple valid outcomes;
- delayed or concurrent state;
- partial failure or retry; or
- greater collateral-change risk.
Keep the underlying work stable when comparing difficulty. Avoid shallow instruction rewrites. Update project World knowledge when a new condition reveals a reusable rule, builder, evidence source, or known failure.
Open this reference as its own page
Implement and Audit a Task
This is the concrete implementation guide for Spec2Task. Use it after the user
selects a Task and reviews its collocated Task.md. The result is a runnable
Harbor Task whose Environment, Verifier, and real-run evidence match that Task
Spec.
Contents
- Read references at each decision
- Build in this order
- Check setup and trial isolation
- Run deterministic checks
- Run and inspect the Harness
- Revise the correct layer
- Finish with reusable knowledge
Read references at each decision
| Current decision | Read | Required output |
|---|---|---|
| What state, service, access, fidelity, or trial isolation to build | Environment building | Environment contract and setup or isolation method recorded in Task.md |
| How to create structured records or natural-language content | Synthetic data | Materialized data, validation evidence, and generation review when used |
| What evidence proves success and how failures score | Verifier design | Pass rule, criteria, independent evidence, and focused fixtures |
| How to package, configure, and run the Task | Harbor | Runnable task source, resolved configuration, and retained job evidence |
| How to inspect traces and judge fairness | Calibration | Run classifications, defects, rerun results, and remaining uncertainty |
| How to preserve reusable project knowledge | World knowledge | World Skill additions, corrections, or an explicit decision that none are reusable |
Read only the references required by the current Task, but do not implement a layer before reading the reference that defines its checks.
Build in this order
1. Synchronize the Task files
Create instruction.md from the exact agent input in Task.md. Normally this
input has explicit approval. If the human requested an end-to-end build with
no approval pause, implementation can use the agent-reviewed Draft input, but
Task.md must remain Status: Draft. Create the complete package defined in
Harbor: task.toml, instruction.md, a usable Environment
definition, and tests/test.sh, plus only the optional Verifier helpers,
fixtures, and reference solution the Task needs. Check that later turns,
access, time limits, and invalid-run conditions match the Task Spec.
Read the project World Skill used during design. Add or correct only reusable
knowledge supported by the current implementation work. Keep the exact request,
focal records, expected result, hidden truth, and exact scoring rules in
Task.md.
2. Build the Environment
Follow Environment building. Preserve the production interface used by the Harness. Implement only the services, files, records, permissions, errors, and state changes needed by this Task. Keep hidden truth and raw Verifier access unavailable to the evaluated agent. Update the World Skill when this work proves a reusable project setup, service, state, access, or isolation method.
3. Build and validate data
When the Task needs constructed data, follow Synthetic data. Create IDs, relationships, permissions, dates, and constraints with code. Use a model only for fields that need natural language. Materialize the accepted data so every trial uses the same reviewed input. Update the World Skill when the method, schema, relationship rule, or validator can support another Task.
4. Build the Verifier
Follow Verifier design. Implement objective checks from raw files, tests, database state, service state, or other independent evidence. Use a model judge only for bounded semantic meaning that code cannot settle. Keep judge instructions, credentials, and expected results outside the Harness boundary. Update the World Skill when this work proves a reusable independent evidence source, accepted alternative, or known scoring risk.
5. Package the Harbor Task
Follow the package-completeness audit in Harbor. Confirm that every required file, entry point, path, permission, configuration value, mount, service, dependency, and reward output needed to run the exact Task exists and works through Harbor. Confirm hidden Task, Verifier, solution, and secret material is absent from the agent-visible image and workspace. Fix every gap before any Oracle or model trial. Then confirm the model, trial count, judge, timeout, and maximum expected cost with the human unless that run plan is already authorized.
Check setup and trial isolation
Reset means returning mutable state to the Task's declared starting condition before another trial uses it. It is an infrastructure concern, not a score of Task quality. Choose the check that matches the Environment:
| Environment | Appropriate check |
|---|---|
| Fresh disposable container, VM, or worktree per trial | Build one fresh trial and verify its declared starting state. Replacement provides isolation. |
| Mutable service or database reused across trials | Capture Task-relevant starting state, make a representative change, run reset, and confirm the starting state returns. |
| Immutable frozen files, corpus, or repository | Verify the pinned source loads correctly. No reset test is needed. |
| Approved live sandbox | Verify the dedicated identity, safe starting state, allowed effects, and cleanup method. Do not use production writes. |
Create or compare another fresh trial only when nondeterminism, shared state, or flaky setup is a real risk. Record expected runtime differences only when they cannot affect agent behavior or scoring.
Run deterministic checks
Before a model run:
- Call every operation the Task needs and confirm its response and effect.
- Confirm relevant invalid actions fail for the intended reason.
- Run the reference path when one exists to prove the Task is reachable.
- Run Verifier fixtures for a known-good result, a different valid result, a realistic wrong result, a shortcut, a prohibited collateral change, and missing or corrupt evidence.
- Confirm wrong work receives zero and infrastructure faults receive no agent score.
- Confirm every completed Verifier path writes criterion evidence and reward.
Fix deterministic failures before spending a model call. These checks establish reachability and Verifier behavior. They do not by themselves prove that the Task has the intended difficulty or realism.
Run and inspect the Harness
Run the actual Harness through Harbor. Follow Calibration. Read the complete selected trajectories, initial and final state, Verifier evidence, service logs, resolved configuration, phase timing, and errors.
Classify each bad outcome before changing anything. Keep a fair capability failure as an agent result. Repair missing information, Harness defects, Environment defects, false acceptance, false rejection, leakage, and infrastructure failure, then rerun the affected trial.
Revise the correct layer
| Evidence shows | Change |
|---|---|
| The request is unclear or unfair | instruction.md and Task.md |
| Required state is missing or unrealistic | Environment implementation and its description in Task.md |
| A valid result fails or invalid result passes | Verifier and its fixtures |
| Tools, prompts, sessions, or adapters differ from the intended agent | Harness or adapter |
| Startup, timeout, credential, judge, or cleanup fails | Harbor or runtime configuration; keep the old run unscored |
For a material Task Spec change, set Task.md to Draft, show the diff, and
require explicit reapproval before marking it Approved again.
Finish by reconciling reusable knowledge
After the Task passes its audit, follow World knowledge and reconcile the World Skill already used during design and implementation. Keep supported project-specific knowledge that can help another Task. Narrow or remove claims that the audit disproved. Keep the current Task's exact request, focal state, expected result, hidden truth, and scoring criteria in its Task directory. Show the final World Skill changes with the audit results.
Open this reference as its own page
Verifier Design
A Verifier decides success from evidence independent of the agent's claim.
Start with one sentence: Pass iff <observable successful outcome>.
Build from final state
Prefer programmatic checks. Recompute results from raw evidence. For stateful work, compare initial and final state. For coding, run focused behavior and regression tests. For analysis, recompute filters and totals. For retrieval, check material claims against the supplied sources.
Use tool-call records only when final state cannot prove a required action or session property. Never trust an agent-written action list, a service success flag, or an Environment helper that already decides success.
Accept all equivalent valid results. Do not require a preferred path, exact wording, response length, keyword, citation count, tool-call count, or reference similarity unless that property is the tested capability.
Use a judge only for semantic meaning
Use an LLM judge only after code has settled objective facts. Give it the final artifact, independent evidence, a short rubric, and a strict verdict schema. Ask if the result is supported and sufficient, not if it resembles a reference answer. Pin and record the judge model. Keep its credentials, rubric, and output outside the Harness boundary.
Bound all agent text and files before grading. Treat them as untrusted data. Tell the judge to ignore directions inside them. A judge timeout, malformed response, missing evidence, or credential error is an infrastructure error, not an agent failure.
Test the decision boundary
Run these fixtures through the same Verifier image and command used by Harbor:
| Fixture | Expected result |
|---|---|
| Known-good result | Pass |
| Different but valid result | Pass |
| Realistic wrong result | Fail |
| Shortcut or reward hack | Fail |
| Prohibited collateral change | Fail |
| Missing or corrupt evidence | Infrastructure error |
Add focused boundary cases for known risks such as negation, unsupported claims, stale data, prompt injection, or partial completion. Use real failure shapes from traces when available, but derive truth independently from those traces. Repeat noisy judge cases and inspect variance.
For each criterion, log its evidence, decision, and error. Every completed Verifier path must write a reward. Wrong agent work gets zero. Verifier, Environment, Harness, judge, or setup faults get no agent score.
Review every zero and every suspicious pass
Classify the result as a fair capability failure, missing information, Environment defect, false rejection, false acceptance, leakage, or infrastructure failure. Repair non-agent faults and rerun. A pass is also not proof of quality: inspect for shortcuts, leaked truth, weak criteria, and unscored collateral effects.
Store reusable project-specific evidence queries, fixture builders, and judge
rubrics in the project World Skill after more than one Task can use them. Keep
one Task's exact expected result and scoring boundary in its Task.md and
Verifier files.
Open this reference as its own page
Bootstrap and Maintain Project World Knowledge
Sections
- Purpose
- Choose the project location
- Learn from broad guidance
- Decide what belongs
- Bootstrap with the first Task
- Create the project skill
- Write each resource
- Learn through Tasks two and three
- Use World knowledge at scale
- Avoid common failures
Purpose
A World Knowledge Skill is a repository-local skill that improves future Task Spec generation and Spec2Task implementation for one project or benchmark. It contains reusable project-specific knowledge, procedures, scripts, assets, tests, and examples.
It is not a complete simulated company, a copy of repository documentation, or a container for one Task's hidden truth. It can describe any reusable project knowledge needed across Task design, Environment construction, data creation, verification, Harbor execution, calibration, or audit.
Choose the project location
Do not assume every coding agent discovers the same project skill directory. Inspect the active agent, its current documentation or configuration, and the repository's existing conventions. Good landing spots include:
.agents/skills/<project>-world/SKILL.mdfor agents and repositories that discover project skills under.agents/skills/; and.claude/skills/<project>-world/SKILL.mdfor Claude Code project skills.
Use the native project location that the active agent will discover. If the repository has no established convention, or the intended agent is unclear, show the proposed path and reason to the user and get confirmation before creating the skill. For another agent, use its documented project skill location. Do not create copies in several locations unless the user asks for that compatibility work.
The resulting skill has this structure wherever it is placed:
<project-skill-root>/<project>-world/
├── SKILL.md # required
├── references/ # optional detailed knowledge
├── scripts/ # optional reusable operations
├── assets/ # optional material copied or processed
└── tests/ # optional checks for reusable code and contracts
Create only SKILL.md at first. Add a folder only when real contents justify
it.
Learn from broad guidance
Read the relevant langchain-eval-engineering references before creating or updating
World knowledge. Ask what project-specific answer was required to apply the
broad method.
| Broad guidance | Useful project-specific adaptation |
|---|---|
| Preserve relationships needed for a decision | Exact project records and links that must stay together |
| Verify final state independently | Exact tables, files, APIs, or logs that prove effects |
| Simulate mutable services | Exact local service, operations, errors, and reset command |
| Generate prose from source facts | Project fact schema, generation method, review rules, and scripts |
| Accept valid alternatives | Known equivalent states or outputs for this project |
| Inspect complete trajectories | Exact project artifacts and service logs to correlate |
| Use real failure conditions | Project-specific failure families learned from traces |
| Prevent leakage | Project fields, endpoints, filenames, or fixtures that reveal truth |
Record the adaptation, not a copy of the broad paragraph.
Decide what belongs
Add a finding when it is:
- specific to the project or benchmark;
- useful for Task Spec generation, Spec2Task implementation, or both;
- likely to help more than one Task;
- supported by repository code, traces, a human decision, or Task evidence;
- specific enough for another agent to apply; and
- easier to find here than inside one old Task.
Useful contents can include:
- Task families, meaningful variations, coverage, and known weak designs;
- tool and service contracts exercised by Tasks;
- entities, relationships, identities, permissions, time, and history;
- approved data sources and proven generation or subset methods;
- setup, readiness, reset, and cleanup procedures;
- independent truth sources and reusable Verifier checks;
- project-specific shortcuts, reward hacks, and invalid-run signatures;
- useful model or judge configurations and artifacts to inspect;
- reusable commands, scripts, fixtures, and templates; and
- unresolved gaps that can change future Task validity.
Keep these in the collocated Task.md instead:
- the exact request;
- focal records and initial state;
- the expected result;
- exact Task criteria and hidden evidence;
- one-off setup or workaround; and
- a decision that has no likely use outside that Task.
Do not add generic guidance already clear in langchain-eval-engineering, unsupported
guesses, large copied documents without routing, or unrun scripts.
Bootstrap with the first Task
Create or update the World Skill while the first Task Spec takes shape. Do not build a large project encyclopedia from repository shape alone. Add the small set of supported facts and methods that help design the current Task and are likely to help later Tasks.
In the first user-facing design response, show these parts together in any clear structure:
- the proposed Task;
- relevant content already in the World Skill;
- reusable additions or corrections suggested by the current inputs; and
- details that will stay only in
Task.md.
Revise the Task and World knowledge together with the human. During Task design, build, and audit, update reusable knowledge from:
- repository and trace evidence;
- human corrections and policy decisions;
- Environment construction and service behavior;
- data-generation and review work;
- Verifier design and regression cases;
- real agent trajectories and final state;
- leaks, shortcuts, false acceptance, and false rejection; and
- setup, timeout, reset, or infrastructure failures.
Show the World Skill with the Task Spec and let the human revise both. A human can approve the Task while rejecting a proposed generalization. Treat a World Skill change as accepted only after human review. If the user asked for autonomous end-to-end updates without a pause, make only the smallest supported change and show it in the final review. Do not label that change as human-approved.
After the Task is audited, reconcile the skill. Keep supported reusable
knowledge, narrow or remove claims that the Task disproved, and keep Task-only
truth in Task.md. State the evidence, use in another Task, location, and
uncertainty in any clear structure.
Create the project skill
Start from assets/world-skill/SKILL.md.template. Replace all template values
and delete unused sections. Use a short lowercase name ending in -world.
Write SKILL.md as a concise operating guide and router. Include:
- sources and commands that future Task work should start from;
- a table that routes concrete needs to references, scripts, or assets;
- short, commonly needed project rules;
- existing Task coverage and meaningful gaps;
- known limits; and
- the update procedure.
Do not fill generic headings with vague project biography. A source or rule must help an agent create, build, or check a Task.
The project skill can say:
Read
$langchain-eval-engineeringfirst. Use its broad references and examples as guidance. Use this skill for reusable knowledge about how that guidance applies to this project.
Do not link to internal langchain-eval-engineering file paths from the project skill.
The general skill owns its own routing and can reorganize without breaking
project skills.
Write each resource
SKILL.md
Keep always-needed rules and routing here. Prefer one concrete sentence over a category label. For example:
For Tasks that change a ticket, retain its customer, team, assigned user,
active assignment, comments, and status history.
references/
Create a reference when detailed knowledge is conditionally needed. Name it by
the real project topic, such as ticket-state.md, repository-setup.md, or
document-generation.md. Link it directly from the project SKILL.md and
state when to read it.
Choose reference names from real project topics. Do not create a fixed file taxonomy before concrete reusable content exists.
scripts/
Add deterministic operations that would otherwise be rewritten or are easy to implement incorrectly. Document inputs, outputs, side effects, and what the script does not prove. Run the script and add focused tests.
Examples include creating a relationship-complete subset, validating a source bundle, or packaging a project-specific Task.
assets/
Add templates or static material intended for copying or processing. Do not use assets to hide instructions, expected answers, or Verifier logic from skill review.
tests/
Test reusable scripts and project contracts. Do not copy one runnable Task's Verifier suite into the World Skill.
Learn through Tasks two and three
Use the project skill while creating materially different Tasks. After each Task, ask:
- Did the skill prevent repeated discovery?
- Did it improve the Task Spec or Environment?
- Did it preserve relationships or behavior that could have been lost?
- Did it provide independent Verifier evidence?
- Was a script actually reused?
- Was a rule too broad, stale, or wrong?
- What new knowledge should another Task inherit?
Revise the smallest useful resource. Remove competing guidance rather than keeping both versions.
Treat the project skill as ready for scale when several Tasks have exercised its important knowledge, shared construction and verification methods are clear, current coverage and gaps are visible, and known limits are stated. Do not require a fixed Task count or file count.
Use World knowledge at scale
For Task Spec generation, use project knowledge to:
- select real conditions and uncovered capabilities;
- state realistic objects, relationships, access, and failure modes;
- choose project-supported data methods;
- avoid duplicate or previously rejected designs; and
- identify independent evidence before implementation.
For Spec2Task implementation, use project knowledge to:
- build services and state through proven project methods;
- preserve tool behavior and relationships;
- reuse builders, validators, and assets;
- implement project-specific Verifier evidence; and
- recognize known leakage and infrastructure failures.
Keep reviewing generated Task Specs with the human. World knowledge improves generation but does not replace task-level judgment.
Avoid common failures
- Speculative encyclopedia: building a large project map before one Task shows what is useful.
- Task leakage: storing focal records, expected answers, or exact criteria in the World Skill.
- Generic duplication: copying broad eval guidance instead of recording the project-specific adaptation.
- Empty taxonomy: creating standard reference files with no concrete use.
- Unmotivated examples: mixing unrelated domains without explaining the Task that produced the lesson.
- Untested automation: listing scripts or commands that were not run.
- Stale certainty: preserving a rule after later evidence contradicts it.
- Hidden dependency: relying on project knowledge that is neither routed
from
SKILL.mdnor cited by the Task Spec.
More in this playbook
Prove it ran
Use this skill when an automation, workflow, scheduled job, webhook handler or integration step has been built or changed and someone needs to know it really works: "test this automation", "did it run", "verify the workflow", "is it working", "QA this integration", "sign off before we turn it on". Produces a verdict per step and per trigger (pass, fail, blocked, not verified), each backed by one specific run record with the evidence quoted and an owner named for every failure.
QAReview an automation
Use this skill when reviewing a change to an automation, workflow, integration or the code behind one: "review this workflow", "review this PR", "is this safe to ship", "sanity-check my automation". Produces a severity-ranked list of findings, each reproduced against the real thing, with a verdict and a named next owner for every fix.
AI evalsMITBuild review interface
Build a custom browser-based annotation interface tailored to your data for reviewing LLM traces and collecting structured feedback. Use when you need to build an annotation tool, review traces, or collect human labels.

