Skip to main content

AI Agent Tools: 7 Proven Context Rules in the ADLC

· 23 min read
Vadim Nicolai
Senior Software Engineer

Eight vendors publish an opinion on how AI agents should be built, and their repos were read on 2026-11-26. Four of them ship a local run command as a product feature: IBM, Salesforce, AWS and Google. Examples include IBM's orchestrate chat start and Google's adk web. Microsoft's developer UI describes itself as a sample app.

Agent Development Lifecycle, a 10-part series. ← Part 2

Iteration is not the problem.

Verification is. In the repos I read, only 1 of the 8, OpenAI, ships a deterministic fake model for testing orchestration without calling a real one (OpenAI Agents SDK, ScriptedModel). Only 1, Salesforce, compiles the agent definition before it runs (Salesforce's agentscript compiler). That is 12.5% coverage for each check that fails before the model is called.

And in those repos, 0 of the 8 ship a linter for tool descriptions. That is the text which, per LangChain's tools documentation, comes straight from your docstring and reaches the model on every call.

A note on the acronym, because it is overloaded. In this article, ADLC means the agent development lifecycle, not the Agile or Application Development Life Cycle. My working definition, not quoted from either vendor: scoping, building, testing, deploying and operating AI agents. Prompts, tools and context are treated as artifacts you can test.

IBM and Salesforce both publish ADLC framings (IBM's ADLC overview, Salesforce's ADLC guide). This article uses the term in the same broad sense. I treat it as a working term, not a standard.

The 7 rules below combine vendor code with 20 published papers, from Li et al. (2024) to Advani (2026). "Proven" means each rule ties to a source you can check. It does not mean an industry body has approved the rules.

The ADLC Build Phase Is Context Design, Not "Writing the Agent"​

Ask an engineer what the build phase produces and the answer is usually "the agent". That is too vague to act on.

The vendor framings are narrower. IBM's ADLC overview treats build as one phase of its lifecycle, and AWS's AgentOps post places it inside AgentOps on AgentCore. Underneath, build produces two outputs: what the model may do (its tools) and what the model sees when it decides (its context).

The research taxonomies agree on the levers but count them differently. Li et al. (2024) break multi-agent systems into 5 components: profile, perception, self-action, mutual interaction and evolution. Huang et al. (2024) sort planning work into 5 directions: task decomposition, plan selection, external modules, reflection and memory.

Wang et al. (2023) propose a unified framework for constructing agents. Guo et al. (2024) survey where agents operate, how they are profiled and communicate, and how they develop skills.

Sapkota et al. (2025) describe agents advancing "through tool integration, prompt engineering, and reasoning enhancements". By my count, 2 of those 3 levers are context. Whichever taxonomy you choose, what you actually edit during build is tool definitions and the context assembled around them.

So I define the build phase narrowly. It is tool and context design run in a fast local loop, plus a check that fails before the model is ever called. The vendors support the first half well.

The second half barely exists.

Rule 1: A Docstring Is a Prompt the Model Re-Reads on Every Turn​

In LangChain, and in frameworks that follow the same pattern, you do not write a tool description separately. The LangChain tools documentation says: "By default, the function's docstring becomes the tool's description that helps the model understand when to use it." It adds: "Type hints are required as they define the tool's input schema." Here is its canonical example, copied exactly:

from langchain.tools import tool

@tool
def search_database(query: str, limit: int = 10) -> str:
"""Search the customer database for records matching the query.

Args:
query: Search terms to look for
limit: Maximum number of results to return
"""
return f"Found {limit} results for '{query}'"

Read that docstring the way the model does. It says what the tool does, but not when to avoid it. It never says that limit controls how much text flows into the next call.

In LangChain's example, the default limit of 10 is a context-budget decision. It looks like an ordinary function default, and the model is told nothing about its cost.

A code comment is written for the next engineer. A tool docstring is a prompt that is sent on every turn.

That makes tool descriptions a new kind of technical debt. O'Brien et al. (2022) mined 68,820 self-admitted technical debt comments across all revisions of 2,641 popular ML repositories, roughly 26 per repository. They built a taxonomy of ML-specific debt, mapped it to pipeline stages, and quantified when it gets removed. Their starting premise is that ML debt can live in training data, changing behaviour without touching code. Their study predates tool-calling agents, so applying it to agents is my extrapolation: a stale tool docstring is the same kind of debt.

It changes behaviour without changing any executable line. Nobody leaves a to-do comment on it, because nobody thinks of it as code.

The rule: review a tool docstring the way you review a public API contract. To the model, that is what it is. Say when to use the tool, when not to, and how much returned text each parameter costs.

Rule 2: Context Has 4 Parts, and the Tool List Is the One Nobody Budgets​

The LangChain context-engineering guide gives the cleanest definition I found: "Context engineering is providing the right information and tools in the right format so the LLM can accomplish a task." It splits model context into 4 parts: "instructions, message history, tools, response format".

History grows visibly during a run, so it draws attention. The tool list stays the same size, which makes it easy to forget that tools are part of every model call. Every tool you register is a fixed cost on every turn, whether the model uses it or not.

The memory literature draws a boundary worth adopting. Hu et al. (2025) separate agent memory from 3 neighbouring concepts: LLM memory, RAG and context engineering. They classify memory into 3 forms (token-level, parametric, latent) and 3 functions (factual, experiential, working). Their message to practitioners is that the old long-term versus short-term split has "proven insufficient".

Zhang, Z. et al. (2024) find memory mechanisms scattered across papers, with no review abstracting common design patterns. Singh et al. (2025) classify agentic RAG along 4 axes: agent cardinality, control structure, autonomy and knowledge representation. Retrieval is a design decision, not a context default.

My reading of these surveys: working state belongs in context, and persistent memory belongs behind a tool. If you mix the two, you pay persistent-memory costs on every turn. The test is quick. Take a representative call, list the 4 context parts, and estimate each part's share of it.

Rule 3: The Local Loop Is a Commodity, So Stop Treating It as a Strategy​

Four of the 8 vendors ship a local run command as a product (AWS's agentcore-cli, Google's ADK among them). Because they all have one, it no longer distinguishes any of them.

IBM's watsonx Orchestrate ADK defines @agents_app.command(name="create", help='Create and import an agent into the active env'), which imports an agent rather than running it; its local loop is orchestrate server start plus orchestrate chat start. Salesforce ships sf agent preview. The Agentforce DX VS Code extension brings that loop into the editor: "The Agent Preview panel lets you have interactive conversations with agents using their Agent Script file or with active agents in your org."

In the agentcore-cli README, "agentcore dev runs runtimes locally or deploys harnesses and prints invoke guidance." Google's ADK README promises "A built-in development UI to help you test, evaluate, debug, and showcase your agent(s)."

Vendor-neutral tooling follows the same shape. LangGraph's local server is "langgraph dev: A lightweight development server for rapid iteration", with hot reloading on by default. LangGraph Studio "connects to your locally running agent to show you each step your agent takes: the prompts sent to the model, tool calls and their results, and the final output."

The prompts sent to the model. Studio is the only tool whose docs I read that promises that view. A loop that shows the reply but not the assembled prompt debugs the output and ignores its input.

Microsoft is the edge case. Its Semantic Kernel README says "Microsoft Agent Framework (MAF) is the enterprise‑ready successor to Semantic Kernel." The Agent Framework repo lists DevUI as an "Interactive developer UI for agent development, testing, and debugging workflows", but the DevUI package calls itself "A Sample App for Running Agents and Workflows". So Microsoft is counted here as a sample loop, by its own description, not a product loop.

Why standardise a loop with a human in it at all? Schmidgall et al. (2025) built Agent Laboratory, which takes a human research idea through 3 stages: literature review, experimentation and report writing. Researchers could give feedback at each stage, and that involvement "significantly improves the overall quality of research". The framework cut research expenses by 84% compared with previous autonomous methods, with o1-preview producing the best outcomes. Its generated machine learning code also reached state-of-the-art performance against existing methods.

The loop is where human judgement is cheapest to apply, which is the pattern Schmidgall et al. (2025) measured. With 4 of 8 vendors shipping one, it is now expected rather than distinctive.

Rule 4: Hook Every Model and Tool Call: ~30% of Trajectories Misbehaved in One Production Study​

A preview loop shows one conversation. Callbacks and traces show all of them. Google's LlmAgent exposes before_model_callback: BeforeModelCallback | None = None and before_tool_callback: BeforeToolCallback | None = None, plus matching after-hooks (ADK llm_agent.py), which gives 4 interception points. Databricks adds tracing through @mlflow.trace in MLflow's fluent API.

Nanda et al. (2026) studied production coding agents whose misbehaviours included "deviating from the user's instructions, getting stuck in repetitive loops, or failing to use tools correctly." They grouped these into 3 categories (Specification Drift, Reasoning Problems and Tool Call Failures), which together occur in about 30% of all trajectories. Their fix, Wink, is a lightweight asynchronous observer that injects targeted course-correction guidance to steer the agent back on track. Across more than 10,000 real-world trajectories, Wink resolved 90% of the misbehaviours that needed a single intervention.

A live A/B test showed statistically significant drops in Tool Call Failures, tokens per session and engineer interventions per session (Nanda et al., 2026). My inference, not theirs: tokens probably fell because repetitive loops burn context. If your agents resemble Nanda's, roughly 3 in 10 runs go wrong. Without a hook on tool calls, you find out when an engineer steps in, which is the most expensive place to find out.

Multi-agent systems need more than timestamps, as Zhang, H. et al. (2025) show for multi-turn deep search, where failure rates are high. They name 2 core challenges: separating symptoms from root causes as errors spread across agents, and tracing information dependencies beyond temporal order. GraphTracer builds Information Dependency Graphs that record which agent built on which output, and it generates graph-aware synthetic failures targeting critical nodes. Their 8B model reaches up to 18.18% higher attribution accuracy on Who&When, and deployed integrations improved performance by 4.8% to 14.2%.

The design lesson: log what each step read, not only when it ran. A trace with timestamps but no inputs can never become a dependency graph.

Rule 5: An LLM Judge Is the Wrong Inner-Loop Check​

The default advice is to run the agent and have another model grade the transcript. It is convenient, and the output reads well. The strongest evidence I found says it fails on the failure you most need to catch.

Advani (2026) studied false success, the failure mode where an LLM agent asserts that a task is complete while the environment state shows otherwise. The data covers 9,876 tau2-bench trajectories from 8 model families and 1,879 AppWorld trajectories from 4, all with text-independent ground truth. Across 5 judges, 5 prompt strategies and full task specifications, no configuration exceeded AUROC 0.65 on tau2-bench. On AppWorld API-call traces, the same judges reached only 0.54 AUROC, barely above the 0.5 of a coin flip.

False success is common, but its rate depends heavily on the setting (Advani, 2026):

SettingFalse success
Single-control tau2-bench domains45–48% of failures
Dual-control telecom3% of failures
AppWorld self-assessing coding-agent trajectories with explicit status claims75.8%¹

¹ Different denominator from the rows above: trajectories with explicit status claims, not failures. Do not compare it directly with the other two (Advani, 2026).

The analysis explains why judges fail. They reward surface signs of completion, such as "confident closing language" in tau2-bench and sheer action volume in AppWorld, instead of verified state changes. A judge tends to believe the agent's own summary.

What worked was cruder. In Advani's (2026) results, TF-IDF detectors reached task-disjoint AUROC 0.83 on tau2-bench and 0.95 on AppWorld. At the same flag rate, they recovered 4–8x more false successes than the best judge, with 3,300x lower latency.

So the inner-loop check should be deterministic, and OpenAI comes closest. Its SDK ships class ScriptedModel(Model):, "A deterministic provider-neutral model for testing agent workflows" (OpenAI Agents SDK). It also ships def assert_complete(self) -> None:, which will "Raise when configured steps remain unconsumed". You script the model's moves, then assert that your orchestration consumed every one.

A tool that never fires, a handoff that never happens and a loop that exits early all fail that test. It needs no model call and gives the same result every run. LangChain's testing guide describes the same idea: unit tests "using in-memory fakes so you can assert exact behavior quickly and deterministically."

My position: test orchestration with a scripted model, assert on state rather than wording, and keep the judge for quality, not completion. A judge can tell you whether an answer reads well. It cannot reliably tell you whether the work was done.

Rule 6: Compile Before You Call, and Lint What No Vendor Lints​

Salesforce is the only vendor of the 8 with a static validation step that rejects a broken agent definition before it runs. Its compiler header reads * Compile a parsed AgentScript AST into AgentJSON (AgentDSLAuthoring schema v2.0)., and its first step is // Step 1: Validate @knowledge references (Salesforce agentscript). That step collects the knowledge fields, and a later expression naming an unknown field is reported as Unknown @knowledge field in the compile diagnostics, just like a bad import.

The larger gap is that tool design is treated as guidance everywhere, as in LangChain's tools docs, and enforced nowhere. In 0 of the 8 repos does anything reject a weak description. You can compile references, script a fake model and trace every call, and "Search the customer database" still ships without a warning.

Research is starting to propose structure a linter could check. Doshi et al. (2026) apply System-Theoretic Process Analysis to find hazards in agent workflows and derive safety requirements. They then formalise those requirements as enforceable constraints on data flows and tool sequences. Their capability-enhanced Model Context Protocol requires 3 structured labels: capability, confidentiality and trust level. They argue model-based safeguards "cannot guarantee system safety", while information-flow approaches "often require extensive human annotation."

The paper is a NIER proposal, and its abstract reports no evaluation. My extrapolation from it: labelled metadata is something a build can check. A tool missing a confidentiality label could fail CI the same way a missing type does.

Until a vendor ships a linter, write your own; it needs no model. Start with 3 schema checks: every tool has a description, every parameter is documented, and every side-effecting tool says so. Add the 3 labels from Doshi et al. (2026) once the basics hold.

Rule 7: Test Under Faults, Because a Clean Run Overstates Reliability​

Gupta (2026) built ReliabilityBench to measure 3 reliability properties that single-run success rates miss in production. The three are consistency across repeated runs (pass^k), robustness to semantically equivalent rewordings of the task, and tolerance of controlled tool and API faults. Faults are injected chaos-engineering style (timeouts, rate limits, partial responses, schema drift), and action metamorphic relations define correctness by end-state equivalence, not text similarity. Across 1,280 episodes in scheduling, travel, customer support and e-commerce, rewording alone cut success from 96.9% to 88.1%.

As a failure rate, that is 3.1% rising to 11.9%, roughly 3.8x more failures with no fault injected at all (Gupta, 2026). In the ablations, rate limiting was the most damaging fault. ReAct held up better than Reflexion under combined stress, and Gemini 2.0 Flash achieved comparable reliability to GPT-4o at much lower cost.

The end-state definition is the same move that Advani's (2026) results argue for: check the state, not the wording.

Two conclusions follow for the build phase. A pass on one carefully worded prompt says little, since rewording alone cost 8.8 points in Gupta's (2026) runs. And because the more elaborate architecture lost under stress, adding reflection is not a reliability strategy by itself.

Fault tests also need an undo button. Anthropic's Agent SDK ships enable_file_checkpointing: bool = False: "When enabled, files can be rewound to their state at any user message using ClaudeSDKClient.rewind_files()" (Claude Agent SDK types.py). With checkpointing on, you can replay destructive scenarios locally. I read it as the build-phase counterpart to the action guards that Mozannar et al. (2025) list among Magentic-UI's 6 interaction mechanisms.

How much fault testing you need depends on autonomy. Feng et al. (2025) define 5 levels by the user's role: operator, collaborator, consultant, approver and observer. They treat autonomy as "a deliberate design decision, separate from its capability". In my reading, approvers sign off on actions while observers mostly watch, so at the observer level fault tests are close to the last check before production.

The evaluation surveys show where coverage is still thin. Yehudai et al. (2026) review the field through 5 perspectives and name cost-efficiency, safety and robustness as critical gaps. Mohammadi et al. (2025) add enterprise needs that benchmarks usually skip: role-based data access, reliability guarantees and compliance.

Which Check to Add First Depends on Which Failure Costs You Most​

The 7 rules are not equally urgent for every team. The deciding question is which failure hurts most: a wrong answer, a false "done", or an irreversible action. The table maps each check to where it exists today, based on the repos and docs linked above, such as OpenAI's ScriptedModel.

CheckADLC stageWhat it catchesWhere it exists today
Docstring review as API contractBuildMissing "when not to use", unexplained parametersGuidance only
Inventory of the 4 context partsBuildFixed tool-list overhead, history growthYour own audit
Local run loopBuildBehaviour regressions while iteratingIBM, Salesforce, AWS, Google (Microsoft: self-described sample); prompt view documented in LangGraph Studio (vendor-neutral)
Callbacks and traces on every callBuild → OperateTool call failures, attributionGoogle, Databricks/MLflow
Scripted fake modelBuild → TestOrchestration regressionsOpenAI; LangChain fakes (vendor-neutral)
Compile/validate stepBuildDangling referencesSalesforce
Tool-description lintBuildUnlabelled, undocumented tools0 of 8 vendors
Fault and rewording testsTestBrittleness under production conditionsNot identified in this research

Pick your starting point by the failure you fear most:

  • Your agent writes to systems of record. Start with the compile step and tool labels. Su et al. (2025) list tool misuse, "deferred decision hazards" and "irreversible tool chains" among autonomy-induced risks, and "structured tool invocation" among the defences they review. An irreversible chain cannot be fixed after the fact, which is why the 3 labels Doshi et al. (2026) propose belong before the first run.
  • Your agent reports completion to users. Start with the scripted model and state assertions. Advani (2026) found false success in 75.8% of AppWorld self-assessing coding-agent trajectories with explicit status claims. Judges reached at most AUROC 0.65 on tau2-bench and 0.54 on AppWorld.
  • Your agent depends on rate-limited APIs. Start with fault injection. Gupta (2026) found rate limiting the most damaging of the 4 fault types injected.

If no single failure dominates, this is the default order:

Loading diagram…

FAQ​

Is the ADLC build phase different from SDLC coding? Yes, in what you produce and how you verify it. In SDLC coding, compilers and tests check the code you wrote. In the ADLC build phase, much of the important work is natural-language text that the model reinterprets on every turn and no type checker reads. That is why deterministic checks such as OpenAI's ScriptedModel and Salesforce's compiler matter more here.

How many tools is too many? None of the 8 vendor repos read for this article publishes a threshold, and I will not invent one. Tool Call Failures were 1 of 3 misbehaviour categories that together appeared in about 30% of the coding-agent trajectories Nanda et al. (2026) analysed. That makes tool-call correctness worth measuring. Measure what share of each call your tool list takes, and assert on tool calls in your traces.

Do I need a local server? You need a loop that shows the assembled prompt and every tool call. Whether that is langgraph dev, adk web, agentcore dev or sf agent preview matters less than whether you can inspect inputs as well as outputs.


Half the vendors have solved iteration. None has solved the text the model reads most often.

The opening framed this as a gap between iteration and verification. The evidence points somewhere more specific. Advani's (2026) judges failed because they read prose and believed it. The labels in Doshi et al. (2026) are designed so that a machine can check them without reading prose at all.

Today the tool description is on the wrong side of that line. It is free text, generated from a docstring, sent on every call, and checked by nobody.

The next reliability gain will not come from a better loop. It will come from moving tool descriptions from prose toward schema, so they become something a build can reject. Until a vendor ships that, the most valuable file you can add to your agent repo is a linter you write yourself.