World’s largest virtual agentic engineering & quality conference
Vertex AI's Gen AI evaluation service scores final response and trajectory against your references, not real-user traffic. Here's how to test one at scale.

Akarshi Aggarwal
Author

Salman Khan
Reviewer
Last Updated on: July 24, 2026
Gartner expects over 40% of agentic AI projects to be canceled by the end of 2027, citing escalating costs, unclear business value, and inadequate risk controls, per Gartner. "Inadequate risk controls" is a testing problem. An agent that scores well in evaluation and misbehaves with real users is precisely the kind of project that stalls before production.
Vertex AI Agent Builder makes it fast to stand up a capable agent on Google Cloud. Its Gen AI evaluation service tells you the agent hit your reference trajectory. It does not tell you what happens when a real user ignores the script.
This guide covers how a Vertex AI agent is actually built, where it breaks in production, the four dimensions worth testing, and a step-by-step approach, from Google's own evaluation service to automated testing at scale.
Overview
What Is a Vertex AI Agent Builder Agent?
An agent authored with Google's Agent Development Kit (ADK) or a framework like LangGraph, reasoning over a Gemini model and deployed to the managed Agent Engine runtime as a chat or voice endpoint.
What Does Vertex AI Give You for Testing?
What Does That Miss?
It scores against references you define. It does not generate hundreds of adversarial, persona-varied conversations against the deployed agent or grade hallucination, tone, and safety on live traffic.
How Do You Close That Gap?
TestMu AI's Agent Testing platform hits the deployed endpoint with autonomous evaluators across 10 personas, scores every conversation on 9 quality metrics, and returns a Green, Yellow, or Red production-readiness verdict.
Vertex AI Agent Builder is Google Cloud's platform for building and deploying agents. Like most agent stacks, it is a set of pieces rather than one product, and a failure can start in any of them. The agent reasons over a Gemini model, calls tools, and runs on managed Google Cloud infrastructure.
What a real Vertex AI agent is made of:
Because the agent chooses its own tool-call path over a non-deterministic model, two runs of the same request can diverge. That is the shared challenge across every agentic AI framework, and it is why a single reference-based check tells you less than it looks like it does.
Google's Gen AI evaluation service frames agent quality around final response and trajectory, which maps neatly to where agents break: the answer is wrong, or the path to it was. Most production incidents land in one of the rows below.
| Failure Mode | Where It Comes From | What Breaks with a Real User |
|---|---|---|
| Wrong tool-call trajectory | The Gemini model routes to a tool based on phrasing the reference dataset never contained. | The agent queries the wrong data source and returns a confident answer built on the wrong retrieval. |
| Ungrounded final response | The agent answers from the model's parametric memory instead of the grounded tool result. | A user acts on a plausible-sounding fact the agent invented rather than retrieved. |
| Context loss across a long session | State that survived a short evaluation gets dropped over a longer, messier real conversation. | The agent re-asks for information already given or contradicts an earlier turn. |
| Prompt injection through grounded data | A grounded document or search result carries instructions the agent follows over its own system prompt. | The agent leaks data or violates policy because retrieved content told it to. |
| Silent regression after a Gemini update | A model version bump or prompt edit shifts routing and tone in ways the reference eval set never checks. | Behavior that scored well last release degrades, and nothing forces a re-test before deploy. |
Whether the agent is an enterprise assistant, a support copilot, or a data agent, the same four dimensions decide whether it is ready for real users. Each needs a different kind of scenario, not just more reference rows.
| Dimension | What It Checks | Example on a Vertex AI Agent |
|---|---|---|
| Task Success | Whether the agent achieved the goal, including the tool calls and grounding it used to get there. | The right tool fires, the answer reflects the grounded result, and the trajectory matches intent, not just the reference. |
| Conversation Quality | Coherence across turns, context retention, and recovery when the user changes direction. | The agent carries a constraint from turn one into a follow-up five turns later without re-asking. |
| Safety | No ungrounded facts, no PII leakage, and refusals where policy requires them. | The agent refuses instructions injected through a grounded document and never fabricates a value. |
| Resilience | Behavior under adversarial input, ambiguous phrasing, and tool or grounding failures. | The agent degrades gracefully when a grounding source is empty, instead of hallucinating to fill the gap. |
Testing happens in three layers: what Google's evaluation service scores against your references, how you check the trajectory, and how you score the deployed agent against the real-user traffic neither of the first two simulates.
Vertex AI's Gen AI evaluation service measures an agent's ability to complete its goal. In one Vertex AI SDK query it triggers an agent execution and returns both final response evaluation, scoring whether the agent achieved its goal, and trajectory evaluation, scoring the sequence of tool calls. It supports agents built with the Agent Engine template, LangChain agents on Agent Engine, and custom agent functions, and adds default metrics for response latency and whether the invocation errored.
It is the right foundation, and it is candid about scope: the feature is in Preview, and it scores the agent against reference datasets you supply. The inputs you did not think to write, the angry user, the injection payload, the fiftieth phrasing of the same request, are exactly where production failures hide.
For an agent, the path matters as much as the answer. Vertex AI's trajectory metrics grade it directly: trajectory_exact_match returns 1 only when the predicted tool calls match the reference exactly and in order, trajectory_in_order_match allows extra calls as long as the reference calls appear in order, and trajectory_single_tool_use checks whether a specific tool was used at all.
These catch wrong-tool and wrong-order bugs precisely against a known reference. What they cannot do is generate the hundreds of adversarial, persona-varied conversations that expose those bugs when there is no reference to compare against yet, which is the case for most of what a real user will actually say.
This is where TestMu AI's Agent Testing plugs in, at the Agent Engine endpoint your agent actually serves. Instead of reference rows you authored, autonomous evaluators hold full multi-turn conversations with the deployed agent the way real users would, across 10 pre-built personas including confused, impatient, angry, and off-script users, and score every conversation on the same 9 quality metrics each time.
Connecting a Vertex AI agent takes only its endpoint plus a prompt describing what it should and should not do. The platform generates 60-100+ scenarios from that prompt automatically, distributed across happy-path flows, edge cases, and adversarial input, so coverage stops depending on which failure cases a developer thought to enumerate as references.
Connecting Agent Testing to a Vertex AI agent does not require an SDK or a change to the ADK graph. It calls the deployed endpoint directly, adapting to its request shape with a body template and a response path, then layers three inputs on top before generating a full scenario set.
# Point the evaluator at a deployed Agent Engine endpoint
testmu-a2a test \
--agent https://your-agent-engine-endpoint/query \
--body-template '{"input": {"text": "{{message}}"}}' \
--response-path "output.text" \
--spec "Enterprise support agent that grounds answers in the knowledge base" \
--count 30From there, autonomous evaluators run the generated scenarios against the endpoint and score each on the 9 quality metrics. A tool call is checked against what it should have done, not just whether it returned, and every run rolls up into a Green, Yellow, or Red verdict, the same model our overview of AI agent testing walks through. The same approach applies if you built the agent with LangGraph on Agent Engine, covered in our guide to testing a LangChain or LangGraph agent.
Note: Point TestMu AI's Agent Testing at your Agent Engine endpoint and get a Green, Yellow, or Red production-readiness verdict before your first real user does. Start testing free
A trajectory match tells you the agent took the expected steps. It does not tell you whether the final answer was grounded, complete, or safe. Agent Testing scores each conversation on 9 quality metrics tuned for exactly how a grounded, tool-using agent goes wrong.
Every score carries a confidence level, High, Medium, or Low, based on how many scenarios ran, so a Green built on ten scenarios is never mistaken for a Green built on three hundred. That is the difference between an evaluation that looked good and an agent that is ready to deploy.
The four dimensions cover a user trying to get help. Red-teaming covers a user, or a grounded document, trying to break the agent: override the instruction prompt, exfiltrate data through a tool, or coax out PII. Enterprise agents wired to real data are the most exposed. The testmu-a2a-cli runs adversarial probes against the endpoint, scoring categories including prompt injection, jailbreak, data exfiltration, and PII leakage at basic, intermediate, or advanced intensity.
testmu-a2a redteam \
--agent https://your-agent-engine-endpoint/query \
--intensity advanced \
--spec "Vertex AI enterprise agent with knowledge-base grounding and tools"
# Target specific attack categories only
testmu-a2a redteam \
--agent https://your-agent-engine-endpoint/query \
--categories prompt-injection,jailbreak,pii-leakageThe output is a letter grade, A+ to F, per category rather than one pass or fail, because an agent can resist a direct jailbreak and still follow instructions injected through a grounded document. For any agent grounded in enterprise data, that per-category grade is the difference between a gap you found and one an attacker finds.
Co-Founder, Steadfast Systems
Discovered @TestMu AI yesterday. Best browser testing tool I've found for my use case. Great pricing model for the limited testing I do 👏
Deliver immersive digital experiences with Next-Generation Mobile Apps and Cross Browser Testing Cloud
A prompt edit, a new tool, or a Gemini version bump deploys the moment the pipeline runs. The Gen AI evaluation service runs from the Vertex AI SDK inside that pipeline, and the testmu-a2a-cli adds the endpoint-level sweep: it installs with pip, authenticates from CI secrets instead of an interactive login, and writes JUnit XML that GitHub Actions, GitLab CI, and Jenkins read natively.
# .github/workflows/vertex-agent-tests.yml
name: Vertex AI Agent Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install TestMu A2A CLI
run: pip install testmu-a2a-cli
- name: Run Vertex AI agent regression suite
env:
TESTMU_USERNAME: ${{ secrets.TESTMU_USERNAME }}
TESTMU_ACCESS_KEY: ${{ secrets.TESTMU_ACCESS_KEY }}
run: |
testmu-a2a test \
--agent https://your-agent-engine-endpoint/query \
--spec "Vertex AI enterprise agent with knowledge-base grounding" \
--format junit --output results.xml
- name: Publish results
uses: dorny/test-reporter@v1
if: always()
with:
name: Vertex AI Agent Test Results
path: results.xml
reporter: java-junitGate on exit code: 0 for all scenarios passed, 1 for any failure. Run the full evaluation for prompt, tool, or model changes and a smaller smoke set for a change that does not touch agent behavior, so every deploy is not blocked on a full regression pass.
A Green verdict means the agent passed on the scenarios you ran, with the personas you tested, on the metrics you configured. Here is what it does not cover:
None of this is a reason to skip testing. It is a reason to keep testing after launch, not just before it.
Take the Vertex AI agent you already have scoring well in the Gen AI evaluation service. Point it at a harder question than your reference dataset ever asked: what happens when a user is angry, phrases the request three ways at once, or feeds it a grounded document that tells the agent to ignore its instructions. Google's evaluation service catches the trajectory and final-response gaps against your references. TestMu AI's Agent Testing catches the rest, running the deployed agent through hundreds of personas and adversarial probes and handing back a go-live verdict before a real user finds the gap first.
Point the evaluator at your Agent Engine endpoint, check the setup docs, and run your first evaluation before the next prompt or model change deploys.
Author
Akarshi Aggarwal is a community contributor with 2+ years of experience in marketing and growth. She specializes in automation testing and frameworks like Cypress, Playwright, Selenium, and Appium. Akarshi has written numerous technical articles, contributing valuable insights into automation testing practices. She actively engages with the tech community, sharing expertise on test automation and quality engineering. On LinkedIn, she is followed by over 7,000 QA professionals, software testers, DevOps engineers, developers, and tech enthusiasts.
Reviewer
Salman is a Test Automation Evangelist and Community Contributor at TestMu AI, with over 6 years of hands-on experience in software testing and automation. He has completed his Master of Technology in Computer Science and Engineering, demonstrating strong technical expertise in software development, testing, AI agents and LLMs. He is certified in KaneAI, Automation Testing, Selenium, Cypress, Playwright, and Appium, with deep experience in CI/CD pipelines, cross-browser testing, AI in testing, and mobile automation. Salman works closely with engineering teams to convert complex testing concepts into actionable, developer-first content. Salman has authored 120+ technical tutorials, guides, and documentation on test automation, web development, and related domains, making him a strong voice in the QA and testing community.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance