Skip to main content

AI Agent Design: 5 Essential Scoping Rules in the ADLC

· 10 min read
Vadim Nicolai
Senior Software Engineer

AI agent design is the phase of the agent development lifecycle (ADLC) with the least product code behind it. In part 01 I read the lifecycle pages and public repos of eight vendors. For design, only Salesforce ships an artifact you can write and check in. Everywhere else, design survives only as runtime settings: a tool list, an autonomy mode, a call or spend cap.

Agent Development Lifecycle, a 10-part series.

So write the design down as those settings. A narrow agent with a priced worst failure beats a general one, and scope is the first risk control you get. Five rules follow: one task, one tool allowlist, one approval policy per irreversible tool, one priced worst failure, one enforced limit.

What happens in the AI agent design phase of the ADLC?​

AWS says its Plan stage is "Assess AI fit, risks, ethics," and that design covers "agent trust model, cross-agent authentication, initial agent design." IBM says "ADLC guidelines, guardrails and specifications enable reliable agentic systems that conform to common standards." Salesforce also describes the lifecycle on its architect site.

The pages agree that design is where risk is decided. The repos mostly skip it. That gap is the reason for this post: if no tool holds your design, the design has to live in the code that runs the agent.

AI agent design in the ADLC: funnel of five scoping rules, narrowing from one task to one tool allowlist, one approval policy, a priced worst failure, and one enforced limit

Rule 1: Give the agent one task — why a narrow agent beats a general one​

Anthropic says "we recommend finding the simplest solution possible, and only increasing complexity when needed." It also says "Agents' autonomy makes them ideal for scaling tasks in trusted environments." Both sentences point the same way: earn autonomy with a narrow, trusted task.

Microsoft's adoption guidance is blunter about when not to build one. In Organizational readiness for AI agents, weak candidates "follow fixed and predictable steps. Conventional workflow automation handles those steps at lower cost and risk." It also says "The business function that relies on an agent owns its outcomes."

One task gives you one owner, one eval set and one failure to price. A general agent gives you none of those cleanly. If the task description needs an "and", you probably have two agents, or one agent and one workflow.

Rule 2: Write the tool allowlist before the prompt​

The tool list is the agent's scope in executable form. Whatever the prompt says, the agent can only act through the tools you hand it. Anthropic's tool-writing guide says "More tools don’t always lead to better outcomes," and recommends "building a few thoughtful tools targeting specific high-impact workflows."

Write the list first, then mark each tool as read or write, reversible or not. That marking is the input to rule 3. The Anthropic Agent SDK makes this a typed unit: its AgentDefinition in types.py is the declarative scope object.

IBM's gateway shows where such checks can sit. Its MCP Context Forge policy lists which parts of a tool call a plugin may change before the call runs. It does not enforce scope or approval by itself:

"tool_pre_invoke": HookPayloadPolicy(writable_fields=frozenset({"name", "args", "headers"})),

Rule 3: Set autonomy per tool — approve only irreversible calls​

Autonomy is not one dial for the whole agent. It is a policy per tool. IBM says "it is best practice to require human approval before an AI agent takes highly impactful actions." Microsoft's readiness page scores a candidate as strong when "The consequences of an incorrect action are reversible or contained."

Every vendor that ships an autonomy knob ships it as code. Anthropic's SDK types it as six PermissionMode values:

PermissionMode = Literal[
"default", "acceptEdits", "plan", "bypassPermissions", "dontAsk", "auto"
]

OpenAI's Codex has an AskForApproval enum in protocol.rs. Its default is OnRequest, documented as "The model decides when to ask the user for approval," and the opposite setting is Never. Google's ADK sets it per tool with FunctionTool(require_confirmation=…); the user's answer comes back as a ToolConfirmation. Microsoft's Go toolapproval package "provides middleware that manages human-in-the-loop tool approval with support for "don't ask again" standing rules."

The design decision is which tools sit behind which setting. Reads run alone. Irreversible writes wait for a person.

Rule 4: Price the worst failure before you build​

Databricks asks the design-phase question directly: "What will a request cost once it triggers several model calls, retries or guardrail checks?" Google's cost guide lists the drivers: "Four things drive what an agent costs: model tokens, compute for the deployed service, judge calls during evaluation, and telemetry storage."

The worst failure has two parts. The first is spend: the maximum calls in a run times the cost per call. The second is blast radius: what the most damaging irreversible tool can do once before anyone notices. Write both numbers into the design doc. If you cannot price the blast radius, that tool belongs behind an approval from rule 3, or outside the agent.

This is a design-doc number, not a vendor feature. None of the frameworks below computes it for you. They only enforce the limit you derive from it.

Rule 5: Cap it — a call or spend limit the runtime enforces​

The price from rule 4 means nothing until the runtime enforces it. Anthropic's SDK has the one per-run dollar cap in this comparison; its budget example sets max_budget_usd=0.10, # 10 cents - plenty for a simple query.

LangChain caps calls rather than dollars, with ToolCallLimitMiddleware (shown below). AWS handles risk later, through Cedar policies (its permission rules): its policy client "Provides access to policy engine and Cedar policy CRUD operations." I found no cost-cap code in the AWS, Google or Microsoft repos I searched.

Pick the knob your runtime has, and set it from the rule 4 number, not from a default.

Which vendors ship AI agent design code, and which only guidance?​

VendorDesign artifactAutonomy knobCost cap
SalesforceAgent Script file; sf agent generate agent-spec——
AWSresource spec (JSON)Cedar policy—
IBM———
AnthropicAgentDefinitionsix PermissionModesmax_budget_usd
OpenAIdraw_graph (documents a design)Codex AskForApproval—
Googlescaffold (agents-cli create)require_confirmation per toolguide only
Microsoftdesign record (proposed)Go toolapproval—

Salesforce is the only vendor with a design artifact. Its Agent Script README says "Agent Script allows you to define an agent as a single file with custom syntax for storing state, specifying execution flow, string templating, and defining deterministic hooks for agent control." The CLI's agent-spec command generates a spec file from the org. The README places the runtime that executes it out of its scope.

AWS's agentcore-cli create writes a project JSON spec, "the spec that declares the project's resources." That is infrastructure, not behaviour. OpenAI's draw_graph draws an existing agent, so it documents a design rather than declaring one.

Google and Microsoft add none. Google's lifecycle guide says "The loop runs three CLI commands, scaffold, eval, and deploy." Microsoft's semantic-kernel has a declarative agent schema record whose status is "proposed." The microsoft/agent-framework repo returned 404 when I checked, so its row is the Go port.

How to write scope, autonomy and risk into a LangGraph agent​

If your platform holds no design, put it in the agent definition. LangGraph lets you "mix deterministic steps with LLM-driven steps in the same graph," and LangChain's agent middleware covers rules 2, 3 and 5.

The human-in-the-loop docs say that when a model proposes a risky action, "the middleware can pause execution and wait for a decision." State is saved through LangGraph's persistence layer, and the pause is built on interrupt. This is the docs' conditional example, verbatim:

from langchain.agents import create_agent
from langchain.agents.middleware import HumanInTheLoopMiddleware, ToolCallRequest
from langgraph.checkpoint.memory import InMemorySaver


def writes_outside_workspace(request: ToolCallRequest) -> bool:
"""Pause writes to paths outside the workspace directory."""
path = request.tool_call["args"].get("path", "")
return not path.startswith("/workspace/")


def is_write_query(request: ToolCallRequest) -> bool:
"""Pause SQL that isn't a read-only SELECT."""
query = request.tool_call["args"].get("query", "")
return not query.lstrip().upper().startswith("SELECT")


agent = create_agent(
model="gpt-6.1-sol",
tools=[write_file, execute_sql, read_data],
middleware=[
HumanInTheLoopMiddleware(
interrupt_on={
"write_file": {
"allowed_decisions": ["approve", "edit", "reject"],
"when": writes_outside_workspace,
},
"execute_sql": {
"allowed_decisions": ["approve", "reject"],
"when": is_write_query,
},
},
),
],
checkpointer=InMemorySaver(),
)

The tools list is the allowlist. The interrupt_on map is the approval policy, and the when predicates keep reads from pausing: "Calls that evaluate to False never pause." Conditional interrupts require langchain>=1.3.3.

The cap comes from the built-in middleware, again verbatim from the docs:

from langchain.agents import create_agent
from langchain.agents.middleware import ToolCallLimitMiddleware

agent = create_agent(
model="gpt-6.1-sol",
tools=[search_tool, database_tool],
middleware=[
# Global limit
ToolCallLimitMiddleware(thread_limit=20, run_limit=10),
# Tool-specific limit
ToolCallLimitMiddleware(
tool_name="search",
thread_limit=5,
run_limit=3,
),
],
)

thread_limit counts "across all runs in a thread" and "Requires a checkpointer to maintain state." It caps calls, not dollars, so multiply by your cost per call from rule 4 to get the spend it bounds.

FAQ​

What is agent autonomy level? A per-tool approval policy. Anthropic types it as six PermissionModes; Codex defaults to OnRequest.

Should every tool need approval? No. Gate irreversible tools, and use a when predicate so reads never pause.

Where does the agent spec live? In Salesforce, in an Agent Script file. Everywhere else, in code: the tool list, the approval policy and the limit.

AI agent design fits in one agent definition​

The ADLC design phase has almost no tooling, and it does not need much. One task, one allowlist, one approval policy per irreversible tool and one limit fit in a single agent definition. Price the worst failure first, then let the runtime hold you to it.

Series: ADLC, Part 02. Part 01 covered the agent development lifecycle. Next: part 03, on the tools an agent gets and how they are described. Follow the series at vadim.blog.