Beyond the Prototype: Building Resilient, Non-Hallucinating AI Agents at Google Scale
Susmita Singh21:092026
An AI agent demo is 5% of the work, and the other 95% keeps it honest
One viral chatbot agrees to sell a car for $1; a coding agent stops mid-task to browse Yellowstone National Park photos. Such failures surface when happy-path demos meet real users, and they cost companies reputation and money. Google senior software engineer Susmita Singh, who leads AI infrastructure for the Google Store, asks what it really takes to turn a weekend prototype into an agent millions of users can trust.
Learn the evals, guardrails, metrics and fixes that move an agent from demo to production
Google senior software engineers Susmita Singh and Anamika Modi argue that building an AI agent prototype is the easy part and that the real product is the engineering around the model. They walk through four continuous pillars for production agents: rigorous evals with LLM-as-a-judge autoraters, multi-layer safety sub-agents, AI-native metrics with cost controls, and production resilience through trajectory tracing, drift monitoring and incident response.
“It's very similar to our own internal instructions where we know that we have to go to gym, we have to eat healthy, but we bypass these instructions as we see fit in our real world and so does the LLMs.”
“If your AI escalates 90% of the time to a human, you'd really just build a very computationally heavy telephone game.”
What you will learn
Balance eval data sets at roughly 50 to 60% happy paths, 15 to 20% tricky edge cases and 20 to 30% error and safety cases.
Score agent answers automatically with LLM-as-a-judge autoraters for relevancy, faithfulness and factuality.
Replace prompt-only safety with dedicated sub-agents for citation checks, PII redaction and prompt-injection screening.
Track AI-native SLIs such as time to first token and semantic cache hit rate, and cap costs with token limits, rate limiting and reserved quotas.
Debug and harden live agents with trajectory tracing, drift monitoring, circuit breakers, hot patches and a closed eval loop.
Key takeaways from the speaker
Adopt a Production-First AI Mindset: Shift your engineering focus from raw model capabilities to the critical infrastructure: evaluations, safety, and observability, required to scale agents safely and inclusively.
Build Automated Evals and Guardrails: Deploy multi-dimensional auto-raters to measure relevancy, faithfulness and fairness, and implement strict safety guardrails to prevent hallucinations and data leaks to protect diverse users.
Define AI-Specific SLIs/SLOs and Cost Controls: Establish actionable metrics for latency and error rates, and implement protective engineering (token quotas, rate limiting, AI credit systems) to prevent runaway LLM costs.
Architect AI Observability and Incident Response: Instrument your agents to trace thought trajectories, detect model drift, and build emergency stop and hot-patching mechanisms to mitigate live generative AI outages.
Details
Level
Intermediate
Format
Tech talk
Technical depth
Practitioner
For
Mid-career, Senior individual contributor
Length
21:09
Published
July 2026
Questions this talk answers
Why can't traditional unit tests validate an AI agent?
Unit tests expect deterministic output, but an LLM can give several equally valid answers to the same prompt. Evals must judge semantic meaning, accuracy and tone instead of matching characters.
How should an eval data set for an agent be balanced?
Only 50 to 60% of cases should be happy paths, with 15 to 20% tricky edge cases and the remaining 20 to 30% errors and safety cases that test the guardrails.
Why isn't a system prompt enough to keep an agent safe?
Prompt instructions can be easily bypassed, so safety should be split into sub-agents that each handle one task, such as citation checking, PII removal and detecting prompt injection.
Which metrics matter when running AI agents in production?
Time to first token is the primary SLI, alongside semantic cache hit rate, business KPIs such as human escalation rate or citation depth, and cost controls like token limits and reserved quotas.
How do you fix an agent that misbehaves or drifts in production?
Trace each step of the agent's trajectory, monitor drift with evals and tool call success rates, circuit break or hot patch the failing part, then add the problem prompts back into the eval set.
About this talk
Building an AI agent prototype is often just 5% of the journey. The challenge lies in the remaining 95%, transforming that prototype into a resilient, inclusive, production-ready system capable of serving millions of users without hallucinating.
From the real-world experiences of building agents, this session explores the engineering required to bridge the prototype to production gap. We will dive into the critical pillars of production-grade AI: building robust evaluation frameworks to tame non-determinism, implementing multi-layered safety (redactions, citations, and consent) and infrastructure guardrails to protect diverse users from bias and harm, defining hard metrics for reliability, and establishing monitoring and debugging when models drifts. Attendees will learn to architect agents that are factually grounded, inclusive, and reliable at scale using industry-standard patterns applicable to any tech stack.
Why prompts alone can't keep AI agents safe (80 s)
A digital bouncer for runaway AI costs (74 s)
The model is just one node (45 s)
Speaker 1: Yes. So I am sure you must have had amazing sessions already in the day two. In the next 20 minutes, we'll explore some of the key pillars required to take your prototype and transform that into a production-ready, scalable, and safe enterprise AI agent. I am Sushmita. I am passionate about building scalable systems. With the new AI technologies emerging, I am stepping into to learn what is out there new, and we are here to share our experience with you. As a profession, I am a senior software engineer at Google with nine years of industry experience, and I have with me Anamika.
Anamika: Yeah. Hello, everyone. I'm Anamika, senior software engineer at Google with eight years of industry experience. My core focus in Google is bringing Google's flagship AI models into the consumer subscription space. I've led the architecture for Google's AI credit system and metering system, spearheading integrations with products in Google like Gemini, Notebook LM, and Anti-Gravity. I'm incredibly excited to be here today with the women in tech audience to share my thoughts about building resilient AI agents. So let's dive in.
Anamika: Thanks, Anamika. Let's start with the core motivation for our presentation today. First thing first, Anamika: If you have an idea and you haven't started with the prototype, we strongly encourage everyone in this room to start prototyping. That is the essential first step translating your idea to the vision and how you want it to present. And thanks to the modern APIs, framework, all the tools that are available out there, building the initial V0 is incredibly fast. And honestly, a lot of fun as well when you see your idea turning into a demo.
With the demo, you can show your vision and get everyone thrilled about the AI. Anamika: But as soon as you build a demo, which runs on a happy path scenarios, you move, you want to move that towards a production and you quickly run into the problem what we are calling here as a 95% horizon. Anamika: This is the gap in the AI landscape right now, what we felt. While current tooling is fantastic at getting you spin a V0 version or a demo version, but taking that demo to an enterprise-ready, safe and scalable solution requires a lot of engineering muscles. So let's first understand why this gap is not so trivial to bridge. This is because in the current development, we tend to rely on the anecdotal
testing where we have deterministic system, we plug in few customer journeys and we see the deterministic output. Yeah, everything looks good. But in the anecdotal testing for the non-deterministic LLMs, which is exposed to a sheer amount of data and unpredictability and chaos of real-world user queries, this is not so straightforward. So the question is how do we systematically move from a prototype to a resilient and enterprise system-ready, which works for millions of users safely and reliably? So let's dive into the pillars. We have identified these four pillars, which requires for you to move your prototype to a production-ready agent. These pillars are not just one time you go through them. These are continuous. In all the pillars, you have to continuously make investments. The first pillar is the evals, and then we have safety, we have metrics and
economics, and we have production resilience. And once you go through all, you have to keep iterating over them again and again. So let's start with the first pillar, which is the rigorous evals. The first question that comes is, why do we need a new paradigm? Why can't we just use our existing unit test? Because the traditional software testing expects a deterministic input and yields a deterministic output? But for the LLMs, which are probabilistic and non-deterministic, an agent might give you five different answers, which are perfectly valid for the same prompt that you are trying.
So our testing needs to adapt to this new paradigm, which is for the non-deterministic system. And we need to not just evaluate what the outcome is, but evaluate the semantic meaning, accuracy, and tone rather than just doing a character matching at this point of time. So to do this, we need to build robust eval data set. And your eval data set should not just consist with a happy case scenario.
Here I have added an example which went viral from a car company where a user asked the LLM to just agree with everything. And then LLM agreed to sell a car for $1. So we don't want to run into this problem by just giving like happy path scenarios to our eval data set. So to avoid this, the recommended structuring for the eval cases is that we only add 50 to 60% of happy case scenarios. But then we go 15 to 20% around tricky and complex edge case scenarios and see how your agent's logic is becoming to bend.
And then give remaining 20 to 30% to errors and safety to see how your guardrails are performing and how your agent is holding up under pressure. So now once we make this eval data set, how do we run this data set? Because matching this test case manually is not going to be possible. So here we can use autorators and by autorators are LLM as a judge. And by using LLM as a judge, we can programmatically score based on the parameters. There are a few common parameters which has answer relevancy, faithfulness, or factuality. So these autorators basically give you a score from zero to one and then you have to adjust your prompts of the agents to make sure that you are trending towards one on all of the parameters
that you are giving to the autorators. And additionally, if your agents are getting data from any of the RAG pipelines or any of your existing data source, you have to make sure that the data accuracy is also there because agents will eventually generate the data based on what you provided. So make sure to validate the data from your RAG pipelines as well so that you can catch issues earlier.
Now we can once reliably, once we can reliably evaluate our agent, we have to move to the phase two, which is multi-layer safety. Here I have linked another example from a viral, from a food company which went viral where customer service bot was tricked into writing a comprehensive Python script. So this is really important when you deploy any agent from a public facing company that agent reflects your company's brand. So if it hallucinates with a fake discount or more dangerously leaks any customer data, say something inappropriate. The reputational damage is there for the company. So there is a zero tolerance for these failures when it comes to an enterprise level product. So how do we solve it? Because we cannot solely rely on just giving system prompts to keep the agent safe. You cannot just prompt it to not do the
bad things because prompt instructions can be easily bypassed. It's very similar to our own internal instructions where we know that we have to go to gym, we have to eat healthy, but we bypass these instructions as we see fit in our real world and so does the LLMs. So what we have to do is instead of just giving it and prompting it the instructions we have to divide these prompts into different sub-agents where each sub-agent is responsible for a single task. For example, safety, citation, abuse, etc. So when an LLM generates an answer, we can create a citation agent, for example, which goes and verifies that every single claim that agent is is making. Is it based on some data that we have passed through our RAC pipelines or some data system
or it is just hallucinating some data which is not, we were not passing that data. If that is the case, you can make a wrapper sub-agent which can potentially reduce, redact all the information that is not backed by any of the data. That is one option to reduce the hallucinations. Another is PII remover agent. We don't want any of the PII information to be released even if the customer is asking to. So some of the examples could be like giving star star in your email, redacting your credit card information. These are the very critical information that we don't want our agents to expose to the customers. Next is abuse.
This is very critical with LLM and in the example that we have seen prompt injection is a very common type of abuse that is happening with the LLMs. So one example to prevent this could be and have an adversarial sub-agent. Sub-agent which first analyzes what the user's query is, try to determine whether the query is trying to inject the internals of the agent or this is just a query which is in favor of what our agent is doing. By doing this sub-agent logic, we can make our main agent more safe and these are the safety guard rails that we can put additionally. So yeah, with that we have we have done the evaluation, we have done the safety logic. Now how do we scale it to
more users? I will hand it over to Anamika. Awesome. Thanks, Shushmita. So yeah, thanks to all the safety guards that we have put in place. Our bot is probably no longer promising a car for a dollar, but once we know that our agent is actually safe, we hit the critical engineering hurdle and the one that keeps stakeholders awake at night at what would this cost, will it scale? So to answer that, we have introduced a third pillar which is matrix and economics. When we're transitioning from a traditional microservice architecture into the Gen AI world, our standard monitoring doesn't really work. It falls short.
AI introduces a lot of asymmetric latencies and very weird looking cost curves into the system. So we have to fundamentally rethink the telemetry. We've divided it into three pieces. One of first is just looking at the core infrastructure and what are our SLIs really. So to talk about in an AI world or in a web world before this, you would just look at page load latency and that'll give you an indicator of how your system is performing. But in an AI world, you really, our primary SLI should be the time to first token. So this is the exact gap between when a user hits enter and the agent actually starts to type. If it takes a long time, a few seconds, the user might assume
that the system is broken, they restart the query, they do the query again. That essentially leads to another call in to your APIs and to your system. So therefore optimizing for the time to first token is really important. Another metric you could look at is the semantic cache hit rates. If 500 of your users are going to use your internal tool and going to ask the same query again and again, you want to ensure that you have vector embeddings created to match so that you can match the semantic intent of your prompt and answer using that instead of firing another query to your model. So these are for a few of the core infrastructure pieces you could look at. And once you have that, you need to go to the second layer,
which is the app layer or which are really your KPIs of the agent. What do you really want your agent to optimize for? What is the business use case that it's solving? And that is where you want to optimize, say, if your agent is a support agent, you want to ensure the human escalation rates are really low.
If your AI escalates 90% of the time to a human, you'd really just build a very computationally heavy telephone game. So you don't want to do that. For research agents, you might want to optimize on citation depth. How thorough are the answers that your AI model is giving out? And is it good enough for the research agent that you're trying to build? And once you try to optimize all the KPIs, the next layer you want to go to is your business layer or your margin defense. Autonomous agents are capable of doing unbounded executions. On the slide, you can see an example where the Enthropic coding agent just went ahead and started looking at Yellowstone National Park photos in middle of a coding execution.
So this can spiral your cost without you knowing. It's hilarious to read about, but when this really happens in practice, when your two agents are talking to each other in a while loop, the cost can spiral out of control. And therefore, to engineer around this, you need to ensure that you have strict token limits and rate limiting at your API gateway itself. And then moving ahead at Google, we usually use this pattern of using a reserve and consume architectural pattern, which is before doing a multi-step workflow, the orchestration layer estimates the cost for this particular query, and it would reserve that quota from the distributed bucket. It is essentially like a digital bouncer checking the user's wallet to ensure they have enough quota before doing that call, making that expensive reasoning model call, and then
ledgering against that. So that's an interesting, you know, way to think about it. The key takeaway from this pillar is we need to define our AI-native SLIs and build programmatic financial circuit breakers so that we can ensure that our agents scale reliably without compromising the economics. And once we build these three layers, I think it's really important that once we have the reliable, you know, monitoring in place, we know what's going wrong. Now, how do we fix it? This is where the product resilience comes in, which is our fourth pillar. If you could move to the next slide.
Yeah, thank you. So, yeah, this is our final pillar, which is product resilience, which is we know now what's going wrong. How do we go ahead and fix it? How do we debug it? How do we fix it for the long term? Standard structured logging like we do today for all of our systems doesn't really work for agents that suddenly hallucinate about, say, Lady Gaga, right? We need detailed trajectory tracking to understand what happened at each step of the agent workflow. On your screen, you can see that there's a, you know, directed, there's a detailed graph or workflow of what an agent would do throughout its journey. And you can look at each of these steps to identify what is the total latency, how many tokens were used, what was the state of each of the steps. If an agent
agent hallucinates an answer, you should be able to go look at the mutation at every single node to understand, you know, did the query generator fail? Did your vector store retrieval fail? Or did the LLM just lose context during synthesis? Another major risk is monitoring agent drifts. This usually happens because of the foundational model that you end up using, be it Google Gemini's model or anything else. They can fundamentally shift in how they respond.
A lot of your partner APIs or tool calls that you're making can change their response patterns. And all of this leads to a downgrade. Without you deploying any code, there is a regression in your system. So to identify such things, you need to ensure that your product correct monitoring in place that can identify regressions by either using evals or by using, you know, how tool call execution success percentage.
And then once you move, you solve for agent drift, another thing is incident response. These are really capabilities that you want to build in your system. When something goes wrong, what do you do right now in production to fix it? It includes things like ensuring that, you know, you're able actually able to short wire or circuit break some of your specific sub-agents that might be hallucinating or even hot patch knowledge by injecting context directly into your system prompt.
And once you can actually fix this, the final piece is really building a closed eval loop. What you want to ensure is that once you've looked at the stack trace, figured out which systems are hallucinating, deployed a fixed right to stop the incident from happening, how do you learn from it? So it's by building, putting this prompt again that had led to certain issues back into your eval, building that eval data set that Sushmita talked about, enhancing it so that we have all the content and then we can build for, you know, feature and making our system smarter over time.
Yeah, let's move to the next slide. Really to wrap up here, we have covered the four pillars necessary that we think are needed to bridge the 95% horizon gap that we talked about, which is building an AI agent over a weekend to building a resilient enterprise grade agent. Rigorous evals, like we talked about, that those are key to making sure that our system does, you know, its test and the non-determinism is really bounded. The multi-layered safety that we talked about, automated guardrails to ensure that we protect user data, we protect brand. Matrix and economics to ensure that you track AI native SLIs and architect programmatic cost controls. And production resilience, so that we know if something goes wrong, how to go ahead and fix it and then learn from it. And as the summary states, the hardest path around
building AI agents that we have discovered really is the engineering around it. The foundational models are just a single node. The actual product is the unglamorous defensive, you know, scaffolding that we build around it. And yeah, our job is really to build that deterministic reliability in this non-deterministic core. So yeah, glad that we all, we could share these architectural patterns that we have seen and our experiences that we have had. Thank you so much for spending this time with us. If you move to the next slide, what we've done is added both of our LinkedIn profiles so that you can connect with us. But if we, I know we are over time, but if you have a minute, we could open it up for questions.
Yeah. Thank you so much, Anamika. I think we have, we are just right at the time. So here is the QR code for our LinkedIn profiles. If any of you have any questions after our presentation, feel free to reach out to us and we'll be happy to connect with you over the LinkedIn. Thank you so much, everyone for joining. Bye.
Transcribed automatically; names checked against the speaker record. Select a time to jump there.
Article based on this talk
Why production AI agents depend on the scaffolding, not the model
Google engineers Susmita Singh and Anamika Modi lay out four continuous pillars that turn a weekend demo into an agent millions of users can trust.
In short
Getting an AI agent demo running is fast, but Google senior software engineers Susmita Singh and Anamika Modi argue it is only the beginning. The real product is the defensive engineering around the model: rigorous evals, layered safety, AI-native metrics with cost controls, and production resilience, revisited continuously rather than ticked off once.
Key takeaways
Adopt a production-first AI mindset: shift your engineering focus from raw model capabilities to the critical infrastructure (evaluations, safety and observability) required to scale agents safely and inclusively.
Build automated evals and guardrails: deploy multi-dimensional auto-raters to measure relevancy, faithfulness and fairness, and implement strict safety guardrails to prevent hallucinations and data leaks to protect diverse users.
Define AI-specific SLIs/SLOs and cost controls: establish actionable metrics for latency and error rates, and implement protective engineering (token quotas, rate limiting, AI credit systems) to prevent runaway LLM costs.
Architect AI observability and incident response: instrument your agents to trace thought trajectories, detect model drift, and build emergency stop and hot-patching mechanisms to mitigate live generative AI outages.
Why demos stall at the 95% horizon
Singh opens with encouragement: anyone with an idea should start prototyping, because modern APIs and frameworks make a first version quick and fun to build. The trouble starts when that happy-path demo heads for production, a gap she calls the 95% horizon.
"While current tooling is fantastic at getting you spin a V0 version or a demo version, but taking that demo to an enterprise-ready, safe and scalable solution requires a lot of engineering muscles." (2:01)
Teams, she explains, carry over anecdotal testing from deterministic systems: try a few customer journeys, check the output, move on. That breaks down when a non-deterministic LLM meets the volume and chaos of real user queries. The pair's answer is four pillars (evals, safety, metrics and economics, and production resilience) that teams keep cycling through.
Pillar one: evals built for non-determinism
Unit tests expect a fixed output for a fixed input. Singh explains why that no longer holds:
"But for the LLMs, which are probabilistic and non-deterministic, an agent might give you five different answers, which are perfectly valid for the same prompt that you are trying." (3:59)
Evals therefore need to judge semantic meaning, accuracy and tone rather than match characters. She warns against eval sets made only of happy paths, pointing to a viral case in which a car company's LLM, told by a user to agree with everything, agreed to sell a car for $1. Her recommended mix is 50 to 60% happy-path cases, 15 to 20% tricky edge cases, and 20 to 30% error and safety cases that show how the guardrails hold up under pressure.
To run those cases at scale she uses autoraters, LLM-as-a-judge scorers that rate answers from zero to one on parameters such as answer relevancy, faithfulness or factuality, so prompts can be tuned toward one. When an agent draws on RAG pipelines or other data sources, that data must be validated too.
Pillar two: safety in layers, not in prompts
A public-facing agent speaks for the brand, Singh notes, recalling a viral case in which a food company's customer service bot was tricked into writing a comprehensive Python script. A hallucinated discount or leaked customer data causes real reputational damage, and system prompts alone will not stop it:
"It's very similar to our own internal instructions where we know that we have to go to gym, we have to eat healthy, but we bypass these instructions as we see fit in our real world and so does the LLMs." (8:31)
Instead, she splits safety into sub-agents with one job each. A citation agent checks that every claim is backed by data the system supplied, with a wrapper that can redact anything unsupported. A PII remover masks details such as emails and credit card numbers even when a user asks for them. An adversarial sub-agent screens queries for prompt injection before the main agent responds.
Pillar three: metrics and economics
Modi then takes the question that keeps stakeholders awake: what will it cost, and will it scale? Standard monitoring falls short, she says, because AI brings asymmetric latencies and odd cost curves. Her telemetry has three layers. For infrastructure, the primary SLI is time to first token, since slow starts push users to retry and add load, alongside semantic cache hit rate for repeated questions. For the app layer, KPIs match the agent's job, such as low human escalation for a support agent or citation depth for a research agent.
"If your AI escalates 90% of the time to a human, you'd really just build a very computationally heavy telephone game." (13:36)
The third layer is margin defense. Autonomous agents can run unbounded; one slide showed an Anthropic coding agent that started looking at Yellowstone National Park photos in the middle of a coding task. Modi's defenses are strict token limits and rate limiting at the API gateway, plus a reserve-and-consume pattern used at Google, where the orchestration layer estimates a query's cost and reserves quota before an expensive reasoning call.
"The key takeaway from this pillar is we need to define our AI-native SLIs and build programmatic financial circuit breakers so that we can ensure that our agents scale reliably without compromising the economics." (15:13)
Pillar four: production resilience
Standard structured logging cannot explain a sudden hallucination, so Modi recommends trajectory tracking: a graph of every step with its latency, tokens and state, showing whether query generation, vector retrieval or synthesis failed. She also flags drift, when a foundation model or partner API changes its behaviour:
"Without you deploying any code, there is a regression in your system." (17:17)
Evals and tool call success rates help catch it. During incidents, teams need to circuit break a misbehaving sub-agent or hot patch knowledge into the system prompt, then feed the offending prompts back into the eval set so the system gets smarter over time. Her closing summary:
"The foundational models are just a single node. The actual product is the unglamorous defensive, you know, scaffolding that we build around it." (19:52)
Watch the talk
Beyond the Prototype: Building Resilient, Non-Hallucinating AI Agents at Google Scale by Susmita Singh with Anamika Modi, 21 minutes: https://www.womentech.net/video/beyond-prototype-building-resilient-non-hallucinating-ai-agents-google-scale
About the speaker
Susmita Singh is a senior software engineer at Google, where she leads AI infrastructure efforts for the Google Store with a focus on evaluation frameworks, safety guardrails and scalable orchestration. She is deeply passionate about mentoring women in engineering, and her co-presenter Anamika Modi, a Senior Software Engineer on the Google One team, led the development of Google's AI Credit System.
Questions this talk answers
Why can't traditional unit tests validate an AI agent?
How should an eval data set for an agent be balanced?
Why isn't a system prompt enough to keep an agent safe?
Which metrics matter when running AI agents in production?
How do you fix an agent that misbehaves or drifts in production?
Drafted with AI from the talk transcript. Editor review pending.
Frameworks and ideas mentioned
Four pillars of production AI agents
95% horizon
LLM-as-a-judge (autoraters)
Retrieval-augmented generation (RAG)
SLIs
Reserve-and-consume pattern
Circuit breakers
Semantic caching
Cite this talk
Susmita Singh. "Beyond the Prototype: Building Resilient, Non-Hallucinating AI Agents at Google Scale." WomenTech Network, 2026. https://www.womentech.net/video/beyond-prototype-building-resilient-non-hallucinating-ai-agents-google-scale