Skip to content
Agent Field Notes
Practice topicsFilter practice questions by topic.All practice →
knowledge unit 23AdvancedImplementationAbout 15 minutes

Understand → Implement → Debug → Design

Task contracts and independent acceptance checks

Make the execution environment, permissions, status, evidence and completion judgment of the model into a project contract.

HarnessTask contractAcceptanceexecution environment

Knowledge content check2026-10-03 · Check the source of the original question2026-10-02

Which step do you want to learn from this knowledge point?

Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.

Understand first

New to this knowledge point

Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.

Start with core principles →

Implement next

Prepare to write the principles into code

Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.

Reading implementation and trade-offs →

Debug failures

Need to handle failures and changes in conditions

Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.

Continue to delve deeper into the problem →

Compare designs

Need to design or review plans

Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.

Analyze engineering scenarios →
Knowledge unit directory

LEARN · PRACTICE · REFLECT

Knowledge learning and personal records

My notes and review ↗

First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.

Answers and personal notes

Each modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.

Core concept · Task contracts and independent acceptance checks

Understand the core principles first

Preparatory concepts:access control, immutable version, Test acceptance

A harness turns goals into executable boundaries and verifiable artifacts. The model may change the solution, but cannot manufacture success by changing permissions or acceptance criteria. Recovery rebuilds the working view from facts rather than treating a progress summary as authoritative system state.

Visual guide · Make success independently checkable

Make success independently checkable

The model can revise its solution, while trusted boundaries and an independent verifier retain control of acceptance. Select the figure to open it at full size.

Prompts cannot enforce every boundary

Prompts guide interface use but provide no transaction, credential, or filesystem controls. If a gateway permits deleting acceptance files, “do not change the tests” remains a soft constraint. Separate task definitions, candidate artifacts, and acceptance procedures into permission domains. Runtime restrictions come from trusted task records.

Turn vague goals into observable evidence

“Fix login” needs permitted directories, an input baseline, expected behavior, and a validation environment. Contract changes need an explicit source and version, identifying which earlier evidence becomes stale. An independent verifier checks the current artifact. Model-written progress flags aid coordination without deciding success.

Recovery reconciles the current facts

Progress notes describe the previous position; the repository and tool receipts show what exists now. Diagnose inconsistencies before proceeding instead of blindly repeating an old summary. Anthropic’s long-task articles motivate engineering records. Independent verification and permission separation here are additional design guidance, not automatic SDK guarantees.

Check understanding with a question

What responsibilities does Agent Harness have? How to design input and acceptance contracts for tasks?

Compare with the reference answer

A harness surrounds the model with tool access, permissions, budgets, persistence, environment preparation, event recording, and verification. Specify goals, constraints, allowed actions, artifacts, and executable acceptance checks. Reconstruct trusted context on recovery. Models propose plans and results; the harness determines permitted actions, evidence support, and completion.

Implementation and trade-offs

Express responsibilities through interfaces

Separate model adapters, tool gateways, state stores, policy controls, verifiers, and event pipelines. Adapters normalize calls; gateways validate and authorize; stores record facts; verifiers check artifacts. Prompts describe rules that gateways enforce. Anthropic’s long-task guidance uses progress notes, feature lists, and version history to support new contexts taking over readable project state.

Specify a concrete task contract

Record task_id, goal, resource scope, baseline, deadline, and budget. Restrict tools and resources, such as permitting branch edits without production database access. Specify artifact paths, formats, citations, and required fields. Acceptance uses observable behavior: anonymous public reading, denied private access, and passing builds. Models may add checks but cannot delete failure criteria to manufacture success.

Recover facts at distinct levels

Retain confirmed goals, baseline, completed subtasks, unresolved issues, evidence locations, and next candidates. Logs support audits; summaries reduce context without replacing logs. Recheck repository state, artifact digests, and authorization expiry. Missing files behind a completed record require diagnosis. An independent verifier determines success. Approval records bind object version, approver, and scope rather than a global flag.

Verify the contract

Fixed test models can claim completion without artifacts, encounter changed files, request forbidden resources, or recover after context loss. Assert rejection or diagnosis and require evidence for success. Then measure representative live-model tasks, interventions, and cost. Start with one task class, separating deterministic enforcement from judgments needing human review.

Engineering deduction

scene
Hypothetical engineering scenario: The agent modifies the website across multiple rounds, and it is easy to forget the unfinished mobile behavior and announce the launch in advance.
design decisions
Establish a versioned task list and acceptance records; read the current code and progress during recovery; deployment is triggered by artifacts that pass acceptance.
Verify target
Expected behavior: The task remains unfinished when the mobile directory is not accepted, and the new context can continue to process this item.
applicable boundary
This is a general architecture example and does not claim to have unattended development capabilities; visual quality may still require human evaluation.

Continuous questions and answers

Continue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.

Draw inferences from one example: If the conditions change, how to deduce it?

First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.

Delivery relies on third-party APIs

Changing conditions:The test environment is not representative of live external services

Extended question:Does passing the local test prove that the task has been completed?

Derivation and reference solutions

Distinguish between local contract verification and true integration verification. Use isolation credentials to verify necessary links, deliver code and clear unverified items when inaccessible, and cannot claim remote success. The transaction receipt, permission scope and environment identification returned by the third party serve as evidence, and the simulated response only proves the local processing logic.

The principles that remain unchanged:Every successful conclusion requires evidence consistent with the scope of its claim.

Design draft without automatic criteria

Changing conditions:Product quality requires human judgment

Extended question:How to maintain independent acceptance?

Derivation and reference solutions

First define automatic checks such as size, format, and required content, and then allow authorized reviewers to review the fixed version according to specific usage goals. The approval record is bound to this version; the model can revise the draft and explain the trade-offs, but cannot write approved=true to itself. While there is a subjective component to quality scoring, the acceptance process still maintains clear sources and traceable results.

The principles that remain unchanged:Acceptance can be performed by humans, but the determination of source and artifact version must be independent of the self-assessment text.

Easy to make mistakes

  • Equivalent Harness to the Prompt template or model itself
  • Only natural language summaries are saved, evidence and versions are not saved
  • Treat model self-evaluation as final acceptance

References

It is designed based on public technical information; the reference materials support the technical mechanism, and the scenarios and scoring standards are designed by this website and do not represent the original interview questions of a certain company. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.

Check how far you understand

After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.

Basic standards met
A model also needs a runtime, tools, and state management.
Intermediate and advanced signals
Ability to write inputs, permitted actions, budgets, artifacts and acceptance contracts.
Senior criteria
Make policy enforcement, isolation, recovery, and evidence collection verifiable boundaries.

Hands-on verificationComplete on demand · Suggestions15 minutes

Write the task contract and acceptance conditions for "Fix an API and deliver the patch".

Expand acceptance requirements and checkpoints
  • Acceptance is executable
  • The allowed modification scope is explicit.
  • Test evidence is linked to the actual artifact

Key inspections

  • Distinguish between prompts and runtime executable constraints
  • Can specify input, artifact, acceptance, and recovery contracts
  • Acceptance evidence cannot be replaced or deleted by the model itself