Skip to content
mentoor

Topic 1 of 5 · 5 min read

Vague roles and task specs that derail agents

Goal: Trace a failed multi-agent run to an unclear role or task spec and rewrite that spec so the failure cannot recur.

Most multi-agent failures start before any agent runs: the role and the task were written so loosely that each agent had to guess. A single agent with a vague prompt gives a mediocre answer. Several agents with vague prompts give mediocre answers that disagree, overlap and never finish.

Check yourself · 1 of 3

A researcher agent keeps searching for 40 minutes and never returns. Which spec change addresses the cause?

Choose one answer

Why it matters

The MAST study of failed multi-agent runs (see the references) put specification problems in their own group of failure modes. The recurring ones are agents that disobey their task or their role, repeat steps, lose track of the conversation, and do not know when to stop. Anthropic reported the same in its research system: early subagents given a short instruction such as "research the semiconductor shortage" duplicated each other's searches or went after the wrong thing.

How to read a failure as a spec failure

Ask four questions of the failed run, in order:

  1. Role. Could two agents each believe a step is theirs? Overlapping roles produce duplicate work or a step nobody does.
  2. Objective. Does the task say what a good result looks like?
  3. Boundaries. Does it say what the agent must not touch, which tools it may use and how much effort is enough?
  4. Stop condition. Is "done" stated as something checkable?

Before and after

# Before
researcher: Look into the failing checkout and fix it.
reviewer: Check the work.

Both agents read the code, both may edit it, and neither knows when to stop. Rewritten:

# After
researcher: Find the cause of HTTP 500 on POST /checkout since the 14:00 deploy.
  Read only: src/checkout/, logs/checkout-*.log. Do not edit files.
  Output: JSON {"cause": str, "evidence": [file:line], "confidence": "high|low"}.
  Done when you have one cause with a file:line, or after 15 tool calls.
reviewer: Receive the researcher JSON. Re-run the failing request from
  tests/e2e/checkout.http. Reply PASS or FAIL with the response body.

Each role now owns one step, has an output shape the next agent can parse, and a stop rule.

What goes wrong

  • Role overlap. Two agents both "plan", and the second overrides the first.
  • Prose where a schema is needed. The downstream agent has to interpret a paragraph and guesses.
  • No budget. "Be thorough" has no end, so the agent keeps searching or polishing.
  • Role drift. A long run pushes the original role text far back in the context, and the agent starts doing a neighbour's job. Repeat the role in each handoff message instead of trusting the first message to hold.

Examples

The two planners

A pipeline has a planner and an architect, both told to "break the task into steps". On every run the architect re-plans what the planner produced, and the run ends when the token budget does. Fix: the planner owns the step list, the architect only reviews dependencies between steps and returns a list of changes, and the run ends when the architect returns an empty list.

Done means what?

A writer agent is told to "improve the draft until it is good". It rewrites the draft nine times, each time with new phrasing and no new content. Fix: "Make at most two passes. Pass one fixes the issues in the review list. Pass two checks every claim has a source. Stop."

Key points

  • A multi-agent failure is often a spec failure: each agent had to guess its role, its output shape or its end point.
  • Give every role one owned step, so two agents cannot both believe the same step is theirs.
  • State what a good result looks like and a machine-readable output shape for the next agent.
  • Write the stop condition as something checkable, plus a budget such as a number of tool calls.
  • Restate the role in each handoff, because roles drift in long runs.

Common mistakes

  • Giving two agents the same verb ("plan", "review", "improve") with no split of who owns what.
  • Writing the task as one paragraph of prose and expecting the next agent to parse it.
  • Leaving out the stop condition because the human knows when it is done.
  • Putting the role only in the first message and never repeating it as the run grows.

Check yourself · 2 of 3

Two agents both edit the same config file and overwrite each other. What is the most direct spec fix?

Choose one answer

Check yourself · 3 of 3

Why does the MAST taxonomy treat "unclear role or task" as its own group of failures?

Choose one answer

Practice items, not counted towards your mastery.

Start here