The Document Set to Fix Before Delegating Work to an AI Agent
메뉴

AI Agent

The Document Set to Fix Before Delegating Work to an AI Agent

A compact document set that makes delegated agent work reviewable.

The Document Set to Fix Before Delegating Work to an AI Agent hero image

This article is the final part of the “Coding agent runtime Design” series. The previous article covered runtime perspective, Goal Contract, A2A and MCP, AI Memory and run ledger.

This time we transfer theory to a set of actual development harness documents. The goal is simple. Even if the team does not create a huge agent runtime right away, the boundaries and output of the work to be assigned to the agent must be fixed in a file.

To ensure that AI agents can work safely for long periods of time, work contracts and output contracts are separated into files.

Key takeaways

  • There is no need to create a huge agent runtime from scratch.
  • Starting with an MVP as a document-based harness is sufficient.
  • The minimum document set isgoal.md,run-ledger.md,artifact-contract.md,memory-policy.md,permission-policy.md.
  • These documents tell the agent not only what to do, but also where to stop and what to leave behind.
  • If needed later, this document structure can be promoted to SQLite or runtime state.

Why start with a document set

When creating a development harness, it can be tempting to create a complex system from scratch.

SQLite stateagent schedulermulti-agent orchestratortask queuememory graphvector databasepermission engine

A structure like this may be needed at some point. But it's too heavy at the MVP stage. Initially, a set of file-based documents will suffice.

reasonexplanation
easy for people to readImmediately review what agents have done
Traceable with gitChange history can be checked
tool independentCan be used with Claude Code, Codex, Cursor, etc.
Gradually scalableCan be promoted to DB or runtime state later
Failure analysis possibleRemains a product, not a conversation

OpenAI's [Codex harness article] (https://openai.com/index/unlocking-the-codex-harness/) explains that multiple Codex surfaces share an agent loop through the same harness and App Server. Even if you do not implement App Server yourself, concepts such as agent loop, thread state, approval, and diff event can be absorbed into operational documents.

The MVP structure can start like this:

.agent-runtime/goals/profile-update/goal.mdplan.mdrun-ledger.mdartifacts/changed-files.mdtest-result.mdrisk-summary.mdpolicies/artifact-contract.mdmemory-policy.mdpermission-policy.mdmemory/candidates/validated/

The key is separation. Dividing document sets into roles ensures that agents don't mix goals, execution history, deliverables, and policies in the same language.

goal.md template

The first file is a contract that ties together the goals, scope, completion conditions, and stop conditions in one place.

Goal:Metadata:goal_id:created_at:owner:status: draft | in_progress | blocked | completed | cancelled Objective:Write the final goal of this goal in one sentence. Context:Explain why this work is necessary and what the current status is. Scope:In Scope:- Tasks to includeOut of Scope:- Tasks to exclude Done Criteria:- Observable completion conditions- Test or verification commands- Completion criteria from the user's perspective- Summary criteria to be left at the end Stop Conditions:- Stop when DB schema change is required- Stop when authentication/authorization logic changes are required- Suspension when external costs occur- Stop when secret access is required- Stop production deployment when necessary artifact contract:- List of changed files- Summary of key changes- Verification command executed- Failed verification and reasons- Remaining risks Notes:- Additional notes

This file should be read first by the agent. Long-term execution without goals and stopping conditions carries significant operational risk.

run-ledger.md template

The second file records the agent's actual execution history in task attempt units.

run ledger Entry:task_id:attempt_id:started_at: input:- Referenced files- Documents referenced- Command executed action:- Changes made- Tests run- What we reviewed result: success | failed | blocked | input_required evidence:- diff- test log- error message- screenshot- command output diagnosis:Interpretation of failure or outcome next_action:Next direction to try artifact_created:- Artifact file path memory_decision: none | candidate | validatedhuman_review_required: yes | no

The run ledger is an agent's work log. You should be able to know what was done without having to look at the conversation log.

artifact-contract.md template

The third file is the baseline that anchors the results of your work as reviewable deliverables rather than conversational responses.

artifact contract:Implementation Artifact:- List of changed files- Core changes- Verification command executed- Passed verification- failed verification- Remaining risks- Parts that need to be checked by humans Test Artifact:- Added tests- modified tests- Command executed- Pass/Fail result- How to reproduce failure- flaky potential Review Artifact:result_levels:- blocker- warning- suggestion- verified- not_verified Failure Artifact:- failed approach- Cause of failure- Evidence log- Abandoned Home- Suggest next attempt- Whether to promote memory

The artifact contract is not a document that tells you to write a nice final response. It is a contract to leave results that can be reviewed.

memory-policy.md template

The fourth file is a filter that determines what to keep as a premise for the next task and what to discard.

memory policy:Store:- Build/test commands required repeatedly- Important conventions in code base structure- Coupling, where multiple files must be changed together- Debugging insight repeated more than once- Workaround verified in current branch Do Not Store:- One-time error- Personal information- API key, token, secret- unverified guesses- Temporary state that exists only in a specific branch- User's temporary request Validate Before Use:- Does the referenced file exist in the current branch?- Doesn’t it conflict with package.json, README, and CI config?- Has old memory been re-verified?- Does the scope of application match the current task? Memory Metadata:- source- scope- validated_at- expires_at- owner

The reason why [GitHub Copilot Memory document] (https://docs.github.com/en/copilot/concepts/agents/copilot-memory) emphasizes citation, current branch verification, and stale memory deletion is in the same context. Memory is a prerequisite for the next operation, so verification and expiration are required.

permission-policy.md template

The final file is the control surface that divides what the agent can do directly and what needs human approval.

Permission Policy:Allowed Without Approval:- read source files- edit non-sensitive source files- run unit tests- run lint- run typecheck- inspect git diff Approval Required:- add dependency- modify DB migration- change auth logic- change payment logic- modify CI/CD workflow- call external paid API- run e2e test against external service- update production-like config Blocked:- read env files- print secrets- access production DB- deploy to production- run destructive command- delete user data- bypass tests

The important thing here is that permission policy is different from instruction. Instruction tells the agent to act like this. Permission is actually a layer that prevents this.

This is the same reason why Claude Code memory document explains memory as context. Security and permissions must be handled in separate policy and enforcement layers.

MVP operation flow

Just creating a document set is not effective. You must fix the order in which files the agent will read and update before starting the job, during execution, and after completion.

  1. PRD / SPEC / UI
  2. Create goal.md
  3. Write plan.md
  4. Human checking of plans and stopping conditions
  5. Task unit execution
  6. run-ledger.md record
  7. Save artifacts
  8. memory candidate review
  9. Generate summary artifact

The advantage of this flow is simplicity. Even if it fails, it can be traced. What's left is where the agent got it wrong, what assumptions it abandoned, what tests it ran, and what to remember for the next task.

expansion direction

Once your file-based MVP is stable, you can expand to the next level.

stepstructure
MVPBased on Markdown files
V1Add JSON schema and validation
V2Add SQLite runtime state
V3Add task scheduler and approval queue
V4A2A compatible agent delegation
V5Validated memory by memory graph and repository

There is no need to create V5 from scratch. The most important thing is the structure in which the units of work remain.

If you work without a goal, you lose direction.If you work without run ledger, you will repeat failure.If you work without Artifact, you cannot review it.Working without a memory policy will pollute your memory.Working without a permission policy becomes dangerous.

final checklist

Before applying the harness to an actual project, the items below should be considered the minimum operating standards.

[ ] PRD / SPEC / UI documents are prepared.[ ] Goal.md contains Objective and Done Criteria.[ ] Stop Conditions include hazardous operations.[ ] Task attempt is recorded in run-ledger.md.[ ] There is artifact-contract.md.[ ] Test results and failure logs remain as artifacts.[ ] There is memory-policy.md.[ ] There are standards for memory promotion.[ ] There is permission-policy.md.[ ] Secret, production, and deploy operations are blocked.[ ] There is a flow of human final approval.

finish

Coding agents are becoming more and more powerful. However, to safely use powerful agents, you must design the runtime before the model.

The prompt is the starting point. But product development doesn't stop with prompts. What's important going forward is defining goals, recording tasks, isolating deliverables, verifying memories, and controlling authority.

This is what a development harness is supposed to do.

The takeaway from this series is simple. Separatinggoal.md,run-ledger.md,artifact-contract.md,memory-policy.md, andpermission-policy.mdallows you to treat the agents' tasks as reviewable units of operations rather than as conversations.

Continue reading the series

  • Part 1: Why are coding agents runtime?
  • Part 2: Goal-based development through Codex/goal
  • Part 3: Multi-agent development workflow from A2A and MCP perspective
  • Part 4: AI Memory is not RAG
  • Part 5: AI Coding Agent Document Set for Application to Development Harness

References

Practical example: Closing small tasks with a set of documents

There is no need to write all four documents at length just for small feature modifications. However, the role of each document must be maintained. For example, if you are fixing a search ranking bug, write the symptoms and completion criteria ingoal.md, and leave the confirmed commands and results inrun-ledger.md. Inartifact-contract.md, files that need to be changed and generated output are written down, and inmemory-policy.md, it is determined whether this failure is a rule to be reused in the next task.

documentminimum record
goal.mdWhat to fix and how far not to fix it
run-ledger.mdVerifications performed and classification of failures
artifact-contract.mdSource and generated file relationship
memory-policy.mdDecide which logs to reuse and which logs to discard

A failure would be to leave only the QA results and not record why that verification was selected. When the next person takes over the same task, they have to guess again whether they only need to look atnpm run testor whether they needcontent:checkas well. Harness documentation is not a device to increase document volume, but rather a device to reduce guesswork during handover.

The comparison criteria are simple. Decisions left only in conversations fade over the longer the session, and agreements left on file can be reread on the next run. The harness document is not a device to make the agent run longer, but a device to make it clear when to stop and when to take over.

댓글

GitHub 계정으로 로그인하면 댓글을 남길 수 있습니다. 댓글은 GitHub Discussions를 통해 운영됩니다.

TOP