Skip to main content

Your AI agent passed every test. Will it behave the same in production?

Nov 20, 2026  |  2 min read
Your AI agent passed every test. Will it behave the same in production?
Nitin Singhvi

In February 2026, the International AI Safety Report warned that some AI models can now tell when they are being evaluated. It also found that results before deployment often fail to predict real-world behavior.

That matters to any team approving an AI agent on test results alone, because a passing suite measures only the scenarios its authors imagined. In production, users phrase requests nobody scripted, tools return malformed data, and instructions arrive inside emails and documents.

For a product company, that gap shows up as an unsafe action inside a customer's environment, where the customer's data and trust are on the line. Our view is simple. An AI agent is ready for production only when its safety boundaries have held under the conditions production will bring.

Why test results do not carry over to production

In traditional software, the same input produces the same output, so a passing test predicts production behavior. AI agents break that assumption in three ways.

  • Outputs vary between runs. The same prompt can produce a different plan or tool call.
  • Inputs are open-ended. Agents read text that no test author wrote.
  • The model can change underneath. A provider update can shift behavior without any code change.

A clean test run proves the agent handles the cases your team wrote. It proves nothing about the ones nobody thought of.

What happens when an AI agent meets the unexpected

Production regularly brings three situations that test suites rarely cover.

  • Unfamiliar inputs. An agent tested on well-formed requests may receive a malformed file, a message in another language, or a very long document. Instructions given early in a long context can lose influence, and the agent may fill gaps with guesses instead of asking.
  • Unexpected tool behavior. Tools time out, return partial data, or fail silently. An agent tested only on successful calls may retry endlessly, assume a failed action succeeded, or switch to a tool with broader access.
  • Conflicting instructions. The system prompt says one thing, the user asks for another, and a retrieved document contains a third. Without a clear order of precedence, the agent may follow the wrong one.

Attackers exploit the third situation on purpose. Through indirect prompt injection, they hide commands in pages or tickets the agent reads. OWASP ranks prompt injection (LLM01) first in its 2025 LLM Top 10, and agent goal hijack (ASI01) first in its 2026 agentic Top 10.

How agent behavior drifts toward unsafe decisions

Unsafe behavior rarely arrives as one failure. It builds through small decisions that each look reasonable.

How agent behavior drifts toward unsafe decisions
 
Testing can hide this drift. A model that recognizes an evaluation may look safer than it is.

How Opcito tests whether safety boundaries hold

Opcito tests AI agents against failing tools, malformed inputs, injected instructions, and repeated runs. This follows the Measure function of the NIST AI RMF, which covers testing before deployment and monitoring after it.

Steps for AI agent testing

We score results against ISO/IEC 25059 quality characteristics, including robustness, so clients release agents on measured evidence.

What a production-ready AI agent looks like

For high-risk systems, Article 15 of the EU AI Act requires consistent accuracy, robustness, and cybersecurity throughout the lifecycle. A production-ready agent meets four conditions.

  • Tested on failure paths, beyond happy paths
  • Behavior measured across repeated runs
  • Resists injected and conflicting instructions
  • Re-evaluated after every model, prompt, or tool change

No test suite covers everything, so production agents also need a full record of their actions.

Explore the safe AI series

  1. Why AI safety matters now
  2. Are your AI agent's actions really under control?
  3. Will an AI agent behave the same in production? (this post)
  4. Who controls decisions across multiple AI agents?
  5. What did an AI agent actually do?
  6. Are more capable AI agents harder to control?

Talk to us to discuss how you can test your AI agents against the conditions they will face in production.

Comments

Ready to transform your FinTech Application?

Explore our VAPT as a Service portfolio or speak with our team to discuss your security testing requirements.

Cookies UI