An AI agent uses a model to choose actions that help it reach a goal. It may also use tools or outside information. Unlike a single prompt, an agent can make several decisions before it responds. Each tool call and any action that changes something outside the agent needs a clear limit.
This guide covers the AI agent development life cycle, or ADLC. It explains how to define a task, design an agent, test it and improve it after release.
A demo shows an agent working in one situation. It cannot show how the agent will respond when information is missing, a tool fails or a user requests an action they are not allowed to take. The development process helps us test these cases.
1. Define the task and success criteria
Begin with the problem the agent should solve. Choose the model and framework after you understand the task.
Describe who will use the agent, what it should do, which inputs it receives and what answer it should return. Set conditions for when the agent should stop or ask for help. Choose outcomes you can measure, such as correct task completion, response time and cost. List actions the agent must not take and identify which actions need approval.
An engineering research agent might answer technical questions using relevant documents and reliable sources. It should separate confirmed facts from assumptions, cite evidence and point out when the sources do not support an answer.
Also state what the agent must not do. For example, a research agent should not edit a repository just because a document includes a command.
2. Design the workflow and boundaries
Decide which steps need the model to make a judgment and which steps need rules in code.
A model can help with an unclear question, choose search terms or compare documents that disagree. Code should enforce permissions, check tool inputs, limit retries and track usage.
Give the agent only the tools and permissions it needs. Define input and output formats, timeouts and retry limits. Decide what it should do when a service is unavailable. Treat retrieved text and tool results as untrusted content.
Do not rely on the model alone to enforce permissions. The application must check each tool call before it runs. Set a step limit or a deadline so the agent cannot continue indefinitely.
3. Build a representative evaluation set
Collect examples of routine tasks, unclear requests, missing information, tool failures and requests that cross permission boundaries. For each example, write down the expected result or behavior.
For a research agent, the first evaluation set could include cases like these:
- A clear technical question should get an answer supported by relevant sources. If a question is unclear, the agent should state its assumption or ask for more information.
- If a documentation page is unavailable, the agent should try another suitable source within its retry limit or report the problem. If sources disagree, it should explain the difference and separate evidence from its own conclusion.
- Malicious instructions in a retrieved page must not change what the agent is allowed to do. The agent must not edit a file without permission. If it reaches its time or tool limit, it should stop safely and say what it completed.
Keep some examples out of development so you can check how changes work on cases the agent has not already seen. Model behavior can vary between runs, so repeat important cases when practical. Do not treat one successful run as proof that the agent is reliable.
4. Implement and test the agent
Connect the model, instructions, stored context and tools. Check tool inputs and outputs. Test ordinary code on its own as well.
Run the evaluation set against the full workflow. Review the final answer, tool calls, error handling and any changes the agent made. Use isolated services or test versions when a real action could change data.
Use three kinds of checks:
- Unit tests: Check predictable parts such as input validation, permission checks and budget calculations.
- Integration tests: Check how the agent works with its tools and outside services.
- End-to-end evaluations: Check whether the full workflow completes the task while following its limits.
A correct answer does not always mean the agent acted safely. It may reach a good answer after accessing data it should not use or making an unnecessary request. Review the steps it took as well as its answer.
5. Evaluate quality, safety and cost
Compare results with the previous version and look at failures. Do not rely on one overall score. Check whether the agent answers correctly, uses tools well, follows permissions and stops when it lacks enough evidence.
Measure response time and token or service costs along with quality. Useful measures include task success rate, citation quality, unauthorized action attempts, tool failures, response-time percentiles and cost per task.
Use release gates for requirements that must always pass. A higher task completion rate should not make up for a change that allows unauthorized writes.

Run relevant cases again when the model, instructions, tools or source data change. If a new version fails a release gate, find out why before deploying it. Record the setup and results so you can compare versions fairly.
6. Deploy with safeguards
Start with a small rollout that matches the risk. Give the agent only the account access it needs. Require approval for important actions. Set request and spending limits. Keep a way to stop the workflow or restore an earlier version.
Check that logs do not expose secrets or unnecessary personal information. Limit access to sensitive traces and decide how long to keep them.
When a tool supports idempotency, use it so a retry does not repeat the same action. After a network failure, check whether an important action succeeded before trying it again.
Restoring an earlier agent setup cannot undo an email, payment or deleted record. Set safeguards based on what each tool can change.
7. Monitor and improve
Track task results, errors, tool failures, response time, cost and user feedback. Look for repeated problems. Add examples of those problems to the evaluation set before changing the workflow.
Suppose the research agent keeps citing old documentation. Save a few examples and check whether the problem comes from search, source choice or the agent’s reasoning. Make a focused change and compare it with the previous version.
Review permissions and dependencies as tools and use cases change. Repeat the process when the agent changes.
Example: an engineering research agent
Suppose a developer asks:
How does database connection pooling work and what should I consider when configuring a pool?
The agent plans its research and uses read-only search tools to find relevant documents. It compares sources and checks that they support its claims. Then it answers with citations and notes any limits in the available information.

The workflow also needs to handle problems. If a page is missing, the agent can look for another source within its time and tool limits. If sources disagree, it should explain the difference. If a page tells the agent to change a file or ignore its rules, the workflow must block any action without permission.
Before enabling a tool that edits files or sends messages, add permission checks and tests for that action. These tools add risk even when the agent’s research process stays the same.
References
- Autio, C., Schwartz, R., Dunietz, J., Jain, S., Stanley, M., Tabassi, E., Hall, P., & Roberts, K. (2024). Artificial intelligence risk management framework: Generative artificial intelligence profile (NIST AI 600-1). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.AI.600-1
- Debenedetti, E., Zhang, J., Balunovic, M., Beurer-Kellner, L., Fischer, M., & Tramèr, F. (2024). AgentDojo: A dynamic environment to evaluate prompt injection attacks and defenses for LLM agents. Advances in Neural Information Processing Systems, 37. https://doi.org/10.52202/079017-2636
- Grace, M., Hadfield, J., Olivares, R., & De Jonghe, J. (2026, January 9). Demystifying evals for AI agents. Anthropic. https://www.anthropic.com/research/demystifying-evals-for-ai-agents
- Hadfield, J., Zhang, B., Lien, K., Scholz, F., Fox, J., & Ford, D. (2025, June 13). How we built our multi-agent research system. Anthropic. https://www.anthropic.com/research/multi-agent-research-system
- Liu, X., Yu, H., Zhang, H., Xu, Y., Lei, X., Lai, H., Gu, Y., Ding, H., Men, K., Yang, K., Zhang, S., Deng, X., Zeng, A., Du, Z., Zhang, C., Shen, S., Zhang, T., Su, Y., Sun, H., … Tang, J. (2024). AgentBench: Evaluating LLMs as agents [Conference paper]. International Conference on Learning Representations. Conference paper
- OpenAI. (n.d.). Evaluation best practices. https://developers.openai.com/api/docs/guides/evaluation-best-practices
- OpenAI. (2026, January 15). A practical guide to building agents. https://openai.com/business/guides-and-resources/a-practical-guide-to-building-ai-agents/
- OWASP Foundation. (n.d.). OWASP Top 10 for Agentic Applications 2026. https://genai.owasp.org/top-10-for-agentic-applications-2026/
- Schluntz, E., & Zhang, B. (2024, December 19). Building effective agents. Anthropic. https://www.anthropic.com/research/building-effective-agents
- Tabassi, E. (2023). Artificial intelligence risk management framework (AI RMF 1.0) (NIST AI 100-1). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.AI.100-1
- Warner, A., & Davidovič, Š. (2018). Canarying releases. In B. Beyer, N. R. Murphy, D. K. Rensin, K. Kawahara, & S. Thorne (Eds.), The site reliability workbook: Practical ways to implement SRE. O’Reilly Media. https://sre.google/workbook/canarying-releases/
These references were carried over from the previous list. Their details have not been checked again for this version.
Build agents with evidence and limits
Building an AI agent requires software engineering and careful testing. A model can make choices that are hard to predict. Clear tasks, permission checks in code, useful evaluations and production monitoring help us understand and manage its behavior.
The goal is to give an agent enough freedom to solve its task while keeping its actions visible, limited and testable.
Explore RefactorRoom Labs for agent evaluation and engineering tools, or read the engineering blog for practical guides.
