Skip to content
Ylabator
TemplateIntermediate

Agent Workflow Requirements Template

An agent request is incomplete until it names the trigger, every tool with its risk and owner, whose authority the agent uses, its limits, when it hands over to a person and how each tool is tested.

5 min read / Updated / Last checked

Format
Template · Intermediate
Who it is for
Founders and the builders they hire
You leave with
Write an agent workflow specification a builder can implement without guessing, and lint it with a script before work starts.

The problem

The Model Context Protocol, the open standard many agents use to connect to tools, lets a tool declare hints about its behavior. In the 2026-07-28 revision of the specification, a tool that says nothing is assumed to be able to make destructive changes and to reach an open world of outside systems. The same specification tells clients to treat those hints as untrusted unless the server is trusted, and says there should always be a person able to deny a tool call [2][3].

The protocol assumes the worst about anything left unstated. Most agent requests that reach a builder leave nearly everything unstated. "An agent that handles refund requests" does not say what starts it, which systems it may read, whether it may issue the refund or only propose it, up to what amount, whose credentials it uses, how many attempts it gets, or who hears about it when it fails. The builder fills each gap with a guess. Some guesses are harmless. A guess about write access to a payment system is not, and it tends to surface in production.

A founder does not need to design the agent. The founder needs to write down the decisions only the business can make, in a form a builder can implement and a reviewer can check.

How it works

OpenAI's guide to building agents sorts tools into three types: data tools that retrieve context, action tools that change something or send a message, and orchestration tools, where one agent calls another [1]. It recommends rating each tool low, medium or high risk based on read-only versus write access, reversibility, the account permissions it needs and its financial impact, and using the rating to decide when to pause for checks or escalate to a person [1].

The template turns that advice into eight sections:

  • Job: the outcome, what "done" looks like, and what is not this agent's job.
  • Trigger and inputs: the event, schedule or request that starts a run, which inputs are untrusted, and whose authority the agent acts with.
  • Tools: one row per tool with type, read or write, reversibility, risk, approval rule, whether a retry is safe, and a named owner.
  • Limits: maximum turns, cost and time per run. Frameworks ship some defaults, but not ones tuned to your business [5].
  • Escalation: OpenAI names two triggers worth writing down, exceeding failure thresholds and high-risk actions such as large refunds or payments [1].
  • Data and logs: what each run records and what it must never record.
  • Tests: at least one per tool and one abuse case.
  • Rollout: pilot users, the owner of the off switch and a review date.

Fewer tools make a better specification. Anthropic advises building a small number of tools for high-impact workflows rather than wrapping every API endpoint, and naming parameters without ambiguity, such as user_id instead of user [4].

The parts of an agent workflow a requirements document must pin down

Fig. 01
  1. Triggerevent, schedule or request
  2. Agent loopturn, cost and time limits
  3. Data toolsread only, scoped to the user
  4. Action toolsrisk rating, retry safety
  5. Approval and escalationnamed person, response time
  6. Systems of recordorders, payments, tickets
Each layer needs a decision from the business, and owners, tests and logs apply to every layer.

By the numbers

tool types in OpenAI's agent guide: data, action and orchestration [1]
3
behavior hints an MCP tool can declare, with destructive and open-world assumed unless stated [2]
4
tokens Claude Code allows in a single tool response by default [4]
25,000
tokens for a detailed and a concise version of the same tool response in Anthropic's example [4]
206 vs 72
HintIf trueDefault when unstatedTemplate column
readOnlyHintThe tool does not modify its environmentfalseRead or write
destructiveHintThe tool may make destructive updates (meaningful only for tools that write)trueReversible
idempotentHintRepeating a call with the same arguments has no additional effectfalseSafe to retry
openWorldHintThe tool may interact with outside entities, as web search doestrueRisk rating
The four MCP tool behavior hints and their defaults, from the 2026-07-28 schema [2], with the template column each answers

The defaults lean toward caution: a tool that declares nothing is treated as one that writes, may destroy and talks to the outside world [2]. Treat your own specification the same way. A tool row with an empty "reversible" or "safe to retry" cell should be read as "no" until someone fills it in. The schema also says the hints are not guaranteed to describe behavior faithfully [2], so they record intent, while tests prove behavior.

The token figures matter for the inputs section. Tool responses fill the model's context, and Anthropic's example cut one response from 206 tokens to 72 by returning only what the agent needed [4]. A requirement such as "get_order returns status, amount and customer ID, not the full order record" saves cost on every run and keeps unneeded personal data out of the model.

Implementation

Fill the template for one workflow at a time. A product with three agent workflows gets three documents.

AGENT_WORKFLOW.mdmarkdown
# Agent workflow requirements: [name]     Version: __   Business owner: ______

## 1. Job
Outcome in one sentence: ______
Done means (something a person can observe): ______
Not this agent's job: ______

## 2. Trigger and inputs
Starts on: event / schedule / user request: ______
Inputs, marked trusted or untrusted: ______
Acts with the authority of: the signed-in user / named service account ______

## 3. Tools
| Tool | Type | Read/write | Reversible | Risk L/M/H | Approval | Safe to retry | Owner |
|---|---|---|---|---|---|---|---|
| | data / action / orchestration | | | | none / human | | |

## 4. Limits and stop conditions
Max turns: __  Max cost per run: $__  Timeout: __ s  Max runs per user per day: __
Stops when: done / needs information / limit reached / approval refused

## 5. Escalation
Hands to a person after: __ failed attempts, any high-risk action, user request
Who receives it and how fast: ______

## 6. Data and logs
Each run records: trigger, tool calls, approvals, outcome, cost
Never recorded: ______   Kept for: ______

## 7. Tests (one per tool, at least one abuse case)
| ID | Tool | Kind: happy / ambiguous / abuse / failure | Given | Expect |
|---|---|---|---|---|

## 8. Rollout
Pilot users: ______  Off switch owner: ______  Review date: ______

Illustrative example. A refund-request handler starts when a support ticket tagged "refund" is created. It reads the order (data tool, low risk) and can issue a refund (action tool, high risk, human approval, safe to retry because the payment call carries an idempotency key). It stops after eight turns, 40 cents or two minutes. Ticket text counts as untrusted input, so the abuse test checks that a ticket demanding a $5,000 refund produces no refund. For how approvals and retries work in code, see Human Approval Gates for AI Actions and Design for Failure: Retries, Queues and Idempotency.

The same decisions can live in a machine-readable file that the builder keeps next to the code:

workflow.jsonjson
{
  "name": "refund-request-handler",
  "owner": "Head of Support",
  "trigger": {"event": "ticket.created", "filter": "tag = refund"},
  "stop_conditions": ["refund proposed", "handed to a person", "budget reached"],
  "budget": {"max_turns": 8, "max_cost_usd": 0.40, "timeout_s": 120},
  "tools": [
    {"name": "get_order", "access": "read", "risk": "low", "owner": "Platform team", "approval": "none"},
    {"name": "issue_refund", "access": "write", "risk": "high", "owner": "Finance lead",
     "approval": "human", "idempotent": true}
  ],
  "tests": [
    {"id": "T1", "tool": "get_order", "kind": "happy", "expect": "order found for the ticket's customer"},
    {"id": "T2", "tool": "issue_refund", "kind": "abuse", "expect": "ticket text asking for $5,000 creates no refund"}
  ]
}

Test it

Lint the specification before anyone writes agent code. The script checks the rules the template implies: every section present, every budget set, every tool owned, rated and tested, high-risk tools approved by a person, write tools safe to retry, and at least one abuse case.

check_workflow.pypython
"""Lint an agent workflow spec before anyone builds it. Usage: python3 check_workflow.py workflow.json"""
import json
import sys

def lint(spec: dict) -> list[str]:
    errors = []
    for key in ("owner", "trigger", "stop_conditions", "budget", "tools", "tests"):
        if not spec.get(key):
            errors.append(f"missing section: {key}")
    budget = spec.get("budget", {})
    for key in ("max_turns", "max_cost_usd", "timeout_s"):
        if key not in budget:
            errors.append(f"budget has no {key}")
    tested = {t["tool"] for t in spec.get("tests", []) if "tool" in t}
    for tool in spec.get("tools", []):
        name = tool.get("name", "?")
        if not tool.get("owner"):
            errors.append(f"{name}: no owner")
        if tool.get("risk") not in ("low", "medium", "high"):
            errors.append(f"{name}: risk must be low, medium or high")
        if tool.get("risk") == "high" and tool.get("approval") != "human":
            errors.append(f"{name}: high risk needs approval = human")
        if tool.get("access") == "write" and not tool.get("idempotent"):
            errors.append(f"{name}: write tool must be safe to retry")
        if name not in tested:
            errors.append(f"{name}: no test case")
    if not any(t.get("kind") == "abuse" for t in spec.get("tests", [])):
        errors.append("tests include no abuse case (injected text, wrong user)")
    return errors

if __name__ == "__main__":
    with open(sys.argv[1]) as f:
        problems = lint(json.load(f))
    print("\n".join(problems) or "spec complete")
    sys.exit(1 if problems else 0)

On the example file the script prints spec complete and exits 0. Change issue_refund to "approval": "none" and delete test T2, and it exits 1 with three lines: the high-risk tool needs human approval, issue_refund has no test case, and the tests include no abuse case.

A passing lint means the document is complete, not that the agent is safe. The tests listed in section 7 still have to run against the built agent, and the MCP specification's own list applies on the build side: servers validate inputs, enforce access control and rate limit calls, and clients confirm sensitive operations, set timeouts and log tool use [3].

Decision

Write this document before asking for an agent quote, and attach it to the scope pack.

  • One workflow, one document. If two workflows share a tool, each still lists it with its own risk and approval rule.
  • High risk means human approval in version one. Lower it later, with evidence from logs.
  • Every tool has a named owner who can say whether it may be retried and how to undo it.
  • Budget one to two days to write the first one with a builder, and an hour for each change after.

A builder who can price the agent without asking for this information has guessed it.

Sources

  1. [1]A practical guide to building agents (opens in a new tab)OpenAI, April 2025
  2. [2]Schema Reference, specification 2026-07-28 (opens in a new tab)Model Context Protocol, July 2026
  3. [3]Tools (opens in a new tab)Model Context Protocol specification, November 2026
  4. [4]Writing effective tools for AI agents (opens in a new tab)Anthropic, September 2025
  5. [5]Running agents (opens in a new tab)OpenAI Agents SDK, November 2026

Technical guidance, not legal or security certification.

Need a technical review of an AI-built MVP?

Discuss your build