MSBA-371 · Lesson 7 of 12 · 19 min

Handing work between agents and people

▶ Video coming soon A video version of this lesson is on the way.

Owen Tremblay, Tidewater's editor, does not write code, but he was the first person at Tidewater to lose a day to a bad handoff. A documentation agent had updated the guidebook's contributor guide after a code change, and its pull request description said only "Updated docs to reflect changes." Owen, as the required reviewer for anything in the guide, could not tell which changes, which sections, or whether anything had been left undone. He read all twelve pages twice, found one paragraph that contradicted the code and one section the agent had not touched but should have, and wrote a long comment. The agent fixed both in ten minutes. The review had taken him most of a day.

Priya used Owen's day to open the session on handoffs. Every multi-agent workflow, and every single-agent workflow that ends in a review, has moments where work passes from one party to another: agent to agent, agent to person, person to agent. The GH-600 outline returns to these moments in several places: documenting decisions, handoffs and outcomes; identifying actions that need human judgement; and recovery patterns that include human-in-the-loop intervention. This lesson treats them together.

What a handoff must carry

A handoff succeeds when the receiver can continue without rediscovering what the sender knew. That needs five things, whether the receiver is a person or another agent.

The five parts of a good handoff. The same structure works for agent-to-person and agent-to-agent handoffs.
PartQuestion it answersExample from Owen's pull request, done well
Goal and statusWhat was this for and is it finished?Update the contributor guide for the new trail-units input; done except one open question
What changedWhere should I look?Sections 3.2 and 5.1 changed; section 4 checked and unchanged
EvidenceWhy should I believe it?Linked the code change; build of the guide passed; examples tested with the action
Decisions and reasonsWhat was chosen and why?Kept the old input name in the table, marked deprecated, because two clubs still use it
Open questions and next stepWhat do you need from me?Should section 5 show the imperial example first? Please review 3.2 and 5.1 and answer the question

The last part matters most for people. A reviewer who knows exactly what is asked of them reviews faster and better. "Please review sections 3.2 and 5.1 and decide the question below" turns a day of reading into twenty minutes.

The pull request as a handoff

On GitHub, the pull request is the main handoff from an agent to a person. The cloud agent's pull requests already carry some of the five parts automatically: a description with the plan checklist, the commits, the link to the session log, and the agent's summary. Teams can raise the quality of what agents write there with instructions. A short section in the repository's custom instructions or AGENTS.md that says what a pull request description must contain is one of the cheapest and most effective tuning changes a team can make.

An instruction for pull request descriptions, added to Tidewater's repository instructions after Owen's review.
## Pull request descriptions
Every pull request you open must have these headings:
- Goal: one sentence, and link the issue.
- Changes: list files or sections changed, and anything you checked
  but deliberately left unchanged.
- Evidence: the commands you ran and their results.
- Decisions: choices you made and why.
- Questions for the reviewer: what you need decided, or "None".
- Review focus: the parts a reviewer should read most carefully.

Draft pull requests are a second tool. An agent that opens a draft pull request early, while it works, lets people see direction before the work is finished; marking it ready for review is itself a handoff signal. The cloud agent's pull requests start as work in progress and request review from the person who assigned the task when the agent finishes.

Agent-to-agent handoffs

When one agent hands to another, the receiver has no shared memory with the sender except what is passed. The five parts still apply, but they must be explicit and usually more structured, because an agent cannot ask a follow-up question the way a person might.

In editors that support custom agent handoffs, an agent file can define buttons that appear when the agent finishes. Each handoff names a label for the button, the agent to switch to, and a prompt that is filled in for the next agent; an optional setting decides whether the prompt is sent automatically or waits for the person to press send. A planning agent might offer a handoff labelled "Start implementation" that switches to an implementation agent with the prompt "Implement the plan above." The person sees the plan, presses the button or edits the prompt first, and the next agent starts with the plan in its context.

An illustrative editor custom agent (.github/agents/planner.agent.md) with two handoffs. Tool names vary by editor and version; check the current reference before copying.
---
name: planner
description: Researches a task and writes a plan. Read-only.
tools: ['search', 'fetch', 'githubRepo']
handoffs:
  - label: Start implementation
    agent: implementer
    prompt: Implement the plan above. Follow the out-of-scope list exactly.
    send: false
  - label: Write tests first
    agent: test-writer
    prompt: Write failing tests for the plan above. Do not change source files.
    send: false
---
You plan changes; you never edit files. Every plan has Goal, Done when,
Steps, Out of scope and Files expected sections.

Setting send to false keeps a person in the loop at the handoff: they read the plan and choose to continue. That small pause is often the right amount of human judgement for a sequential pipeline. In orchestrator patterns with subagents, handoffs happen inside the orchestrator without buttons, so the structure of what each subagent returns, its summary, evidence and open questions, must be defined in the orchestrator's instructions.

A swim-lane diagram with three lanes: person, planning agent, implementation agent. The person assigns an issue. The planning agent writes a plan. The flow returns to the person lane for approval, then moves to the implementation agent lane, which works and opens a pull request. The flow returns to the person lane for review, with a dashed arrow back to the implementation agent labelled review comments.
A sequential pipeline with people at the two handoffs that matter: approving the plan and reviewing the result.

Person-to-agent handoffs

Handoffs run the other way too. When a person assigns an issue to an agent, the issue is the handoff, and the same five parts apply: goal, current state, evidence such as error logs, decisions already made, and open questions. Issue templates help. Tidewater added an "Agent task" issue template with fields for intent, done when, out of scope, defaults and links to evidence, which also fixed the specification failures from the tuning lesson.

When a person takes work back from an agent, which is the recovery case, the agent's handoff is the session log, the branch and the plan checklist. A person should be able to pick up any agent's unfinished branch and continue, which is one more reason for agents to commit after each step and keep their plan current.

Where people must decide

Not every handoff needs a person, and too many people in the loop slows everything without making it safer. The outline asks candidates to identify actions that require human judgement. A useful test is whether the decision involves values, accountability or irreversibility that an agent cannot own.

Which decisions need human judgement. Values, accountability and irreversibility are the signals.
DecisionHuman judgement needed?Why
Approve a plan for a public interface changeYesAffects other people's code; trade-offs about compatibility
Merge a pull request to the default branchYesAccountability for what ships; rulesets require review
Choose between two valid designsUsuallyTaste and long-term maintenance are team decisions
Approve a production deploymentYesIrreversible effects on users; environment protection rules
Rename a local variable during a refactorNoLow risk, reversible, checked by tests and review
Retry a flaky test onceNoRoutine; a stopping condition limits repeats
Ignore a security alert as a false positiveYesRisk acceptance belongs to an accountable person

GitHub's own design for the cloud agent puts people at two points by default. A person with write access assigns the task, and the agent's pull request needs approval from someone other than the person who asked for it before it can merge, under the repository's rules. Between those points the agent works alone inside its boundaries.

Escalation

An escalation is a handoff the agent starts because it cannot or should not continue: a stopping condition was met, an open question blocks progress, or the next action needs a person. Good escalations are short, specific and actionable. "I am blocked" is not an escalation; "Tests in test/import fail because the park feed fixture is missing; please add it or tell me where it lives" is.

Escalations need somewhere to go. For the cloud agent, the pull request is the natural place, and people are notified through normal GitHub notifications. For orchestrated systems, teams decide whether escalations go to the person who started the task, the code owner, or an on-call rotation, and how long an escalation can wait before the session is cancelled.

Worked problem

Fixing the documentation handoff

After Owen's day of review, the group redesigned how documentation changes were handed to him.

Show solution
  1. Added the pull request description instruction above to the guidebook repository.
  2. Gave the documentation custom agent a rule to list every section it checked and left unchanged, so Owen could see coverage.
  3. Added a Review focus heading so Owen could read the changed paragraphs first.
  4. Set a rule that a documentation pull request with open questions stays in draft until Owen answers them.
  5. Owen reviewed the next three documentation pull requests in twelve, twenty and eight minutes.

Ownership

Every handoff should leave one clear owner. Two failure modes are common. In the first, nobody owns the work: an agent's pull request waits for review because the person who assigned it is on holiday and nobody else was asked. In the second, too many people own it: three reviewers are requested and each assumes another will look. Simple rules help: the assigner owns the result until it merges or is closed; a named backup takes over after a set number of days; code owners review only their areas.

Handoffs across time zones and shifts

Skerry's developers work across several time zones, and Seraphine described the handoff problem that creates. A developer in Halifax assigns an agent task at the end of the day; the agent finishes overnight; the reviewer who will look at it first may be in another office, with no context. Without a good handoff, the reviewer either waits for the original developer or reviews blind.

Skerry's answer was to make the issue and the pull request carry the whole handoff, so that whoever picks the work up next can act. Issues assigned to agents must name a backup reviewer as well as the requester. Agent pull requests must answer the questions-for-the-reviewer heading in a way that someone outside the team can act on. And escalations raised overnight go to a channel that the next shift reads first thing, rather than to one person's notifications.

Measuring handoffs

Handoff quality can be measured, which makes it something the evaluation and tuning lessons can improve. Useful measures include the time from an agent finishing to a person's first response, the number of clarifying questions reviewers ask before they can review, the share of agent pull requests whose description follows the required headings, and the share of escalations that the receiver could act on without asking for more information.

Tidewater tracked only the first two, informally, for a month after Owen's day. Time to first response on documentation pull requests fell from about two days to the same day, and Owen's clarifying questions almost disappeared. When the numbers drifted later, the first thing the team checked was whether the description instruction was still being followed, which it was not in one repository whose AGENTS.md had been rewritten without it.

Handoffs inside an orchestrator

When an orchestrator hands parts of a task to subagents, the handoff is a prompt the orchestrator writes and a summary each subagent returns. Both deserve the same care as a handoff between people. The orchestrator's prompt to each worker should contain the goal of the whole task, the specific part assigned, the files or areas the worker may change, what to return and in what form, and what to do if it finds a problem outside its part. The worker's summary should state what it did, what it found, the evidence and any open questions, so the orchestrator can combine results without re-reading every file.

Seraphine's documentation pipeline went wrong in its first week because the drafting agent's summaries said only "Page drafted", and the checking agent had to rediscover which functions each page described. Adding a required list of the functions covered and the source files read to each summary cut the checker's work, and its cost, by about a third.

Common mistakes

  • MistakeAccepting pull request descriptions like "Updated docs".

    InsteadRequire goal, changes, evidence, decisions, questions and review focus.

  • MistakeSending every agent-to-agent handoff automatically.

    InsteadKeep a person at handoffs where a wrong plan would be costly.

  • MistakePutting a person in the loop for every routine action.

    InsteadReserve human judgement for values, accountability and irreversibility.

  • MistakeEscalating with "I am blocked."

    InsteadEscalate with the specific cause and the decision or action needed.

  • MistakeLeaving agent pull requests without a clear owner.

    InsteadThe assigner owns the result, with a named backup.

Summary and key terms

  • A handoff carries goal and status, what changed, evidence, decisions with reasons, and open questions with the next step.
  • The pull request is the main agent-to-person handoff; instructions can require a useful description.
  • Editor custom agents can define handoffs with a label, target agent and prompt, sent automatically or not.
  • Issues are the person-to-agent handoff; templates help.
  • People decide where values, accountability or irreversibility are involved.
  • Escalations should be specific, have a destination and a time limit.
  • Every handoff leaves one clear owner.
Handoff
Passing work, with its context, from one agent or person to another.
Escalation
A handoff an agent starts because it cannot or should not continue on its own.
Human-in-the-loop
A design in which a person must act at defined points before work continues.
Review focus
The part of a change a reviewer should read most carefully.
Draft pull request
A pull request marked not ready for review, used to show direction early.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which part of a handoff matters most for a busy reviewer?

    Show answer

    Open questions and the next step: exactly what is asked of them.

  2. What does setting send to false on an editor handoff do?

    Show answer

    It fills in the prompt for the next agent but waits for the person to send it.

  3. Give two signals that a decision needs human judgement.

    Show answer

    Any two of: values or trade-offs, accountability, irreversibility.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz