AI Engineer

Build-Time vs. Run-Time: Why Dev Tools Fail in Production — Averi Kitsch & Prerna Kakkar, Google

1898 summary words 8 min summary Watch video

Start with the signal

8 min read

Summary

At-a-Glance

  • Verdict: Watch fully
  • Core thesis: Developer-facing MCP tools can remain flexible and model-controlled, but production agent tools must constrain actions, bind identity outside the model, and enforce security at the data-access layer.
  • Why it matters: This is a practical zero-trust design pattern for preventing agent prompt injection, confused-deputy failures, SQL overreach, and cross-user data exposure in MCP-connected systems.
  • Best use: Use it as a design review checklist for converting exploratory agent tools into production-safe semantic tools, especially where agents access databases or act on behalf of users.

Executive Summary

Google engineers Averi Kitsch and Prerna Kakkar draw a hard operational distinction between build-time tools and runtime tools. Build-time tools—such as database administration APIs and natural-language-to-SQL—are flexible, atomic, and useful for developer assistance, but should generally require human oversight. Runtime tools serving end users should instead expose narrowly defined business outcomes, such as looking up flights or cancelling an order, rather than giving the model raw infrastructure or SQL control.

The central security argument is that an agent cannot be trusted as the authorization boundary. A model with database credentials, connection details, arbitrary SQL capability, and access to untrusted content can be manipulated into becoming a confused deputy: it uses its own broad permissions to retrieve sensitive information for an unauthorized user. The speakers connect this to Simon Willison's “lethal trifecta”: private data, untrusted content, and a channel to exfiltrate outputs.

Their proposed progression is to remove increasingly sensitive controls from the model: first hide connection configuration in a server-side source primitive; then enforce read-only access, allowed datasets, and output limits; then replace arbitrary SQL with predefined, typed, prepared-statement tools; finally, bind user identity through application authentication or validated JWT claims rather than asking the agent to supply a user ID.

The talk is most useful for its concrete tool-interface guidance: make tools outcome-oriented rather than thin REST wrappers, split read from write actions, require confirmation for writes, use simple flat inputs, provide errors the agent can act on, and write descriptions that guide tool selection. The included product claims concern Google's MCP Toolbox for Databases, Google Managed MCP, Model Armor, and EvalBench, but the security architecture applies beyond those products.

Key Takeaways

  • Claim: Treat build-time and runtime agent tools as different product and security classes, not as one shared tool catalog. | Evidence: The speakers classify control-plane/database administration tools and NL-to-SQL as build-time tools: flexible and atomic, but unsuitable for unattended production actions. Their runtime example instead uses a customer-facing flight assistant with purpose-built actions such as flight lookup and changes. | Implication: Ken should maintain separate tool policies and exposure surfaces: exploratory/admin tools for supervised operator workflows, semantic constrained tools for end-user or autonomous production workflows. | Caveat: The presentation does not argue that NL-to-SQL or administrative tools are inherently unusable; it argues they need human-in-the-loop controls and should not be directly exposed as unrestricted production end-user capabilities.
  • Claim: The model must not be the authorization boundary because an agent with broad privileges can be turned into a confused deputy. | Evidence: In the triage-agent example, malicious instructions embedded in a trusted ticket ask the agent to query employee salaries. The agent uses its own permissions, retrieves data the ticket author was not entitled to access, and posts the results back to the ticket. | Implication: Authorize each sensitive operation against the authenticated end user and fixed application policy, rather than relying on system prompts or the agent's intended behavior. | Caveat: Prompt robustness alone does not solve this category of risk; the failure arises from privilege and parameter design, even if the original application workflow is legitimate.
  • Claim: Production-safe tools progressively remove connection, scope, query, and identity control from the agent. | Evidence: The proposed evolution moves database host, port, credentials, and connection details into a preconfigured YAML-backed source; adds read-only driver enforcement, allowed datasets, and output-size limits; then replaces model-generated SQL with predefined custom SQL tools using typed prepared-statement parameters. | Implication: Design every tool by asking which fields are facts and policy constraints that the application must bind, versus which small set of non-sensitive values the model may derive dynamically. | Caveat: Read-only access reduces destructive risk but does not by itself prevent sensitive-data disclosure; dataset restrictions and output controls remain necessary.
  • Claim: Identity and PII should be injected or cryptographically derived at execution time, never supplied by the model as an ordinary tool parameter. | Evidence: The Lookup Flights example initially takes user ID and date. The safer design binds user ID after application authentication or validates an OpenID/JWT token and extracts claims such as user ID, email, and issuer, leaving the model to provide only a simple value such as date. | Implication: For user-scoped agent actions, remove account IDs, tenant IDs, permissions, and similar identifiers from model-visible arguments; derive them from the request/session identity in the tool layer. | Caveat: A valid token must still be validated for authenticity and the appropriate issuer/claims before its identity data is used.
  • Claim: Semantic, outcome-oriented tools are more reliable and safer than exposing atomic REST or raw database primitives. | Evidence: The speakers recommend tools centered on the action the user needs, rather than atomic API calls, because this reduces multi-call round trips. A predefined Lookup Flights tool is presented as safer than a tool accepting arbitrary SQL. | Implication: Expose a small capability vocabulary—such as lookup_flights, cancel_order, or change_booking—with server-owned workflow logic, rather than granting agents generic CRUD, shell, or query interfaces.
  • Claim: Tool-interface quality materially affects agent reliability and should be engineered deliberately. | Evidence: The talk recommends clear descriptions that guide when to use a tool, separate read and write tools, automatic approval for reads versus confirmation for writes, actionable retryable errors instead of generic HTTP 404 responses, and flat simple inputs instead of complex maps or primitives. | Implication: Add tool-schema and error-message quality to agent evaluation criteria; security controls alone will not compensate for ambiguous descriptions, complex arguments, or opaque failures. | Caveat: Automatically approving reads is appropriate only after read access itself has been scoped to prevent disclosure of sensitive information.
  • Claim: Google positions MCP Toolbox as a production-oriented database access layer, but its scale claims are product context rather than proof of universal safety. | Evidence: The speakers state that MCP Toolbox for Databases is open source, has roughly 15.7k GitHub stars, 132+ contributors, and support across 40+ databases; combined managed and Toolbox offerings reportedly processed 20 million tool calls in the preceding month. It offers connection pooling, integrated authentication, and observability. | Implication: Evaluate MCP Toolbox and Google Managed MCP as potential implementation components, but validate their authorization semantics, database-driver enforcement, observability, and evaluation coverage in Ken's own threat model. | Caveat: The talk provides no comparative benchmark, incident data, or independent assessment of these offerings, and the planned live demo failed to load.

Detailed Brief

Threat model: the lethal trifecta and parameter ownership

  • Claims: A data breach becomes especially likely when an agent simultaneously has access to private data, consumes untrusted content, and can return content to an external user.; Agentic architectures blur the traditional distinction between trusted application inputs and untrusted instructions, so parameter ownership must be made explicit.
  • Evidence: The speakers attribute the term “lethal trifecta” to Simon Willison.; They distinguish user identity, application/workload identity, and agent identity. The application may need broad service connectivity, but the agent should have access only to data the end user is authorized to access.; They distinguish agent parameters—dynamically inferred and untrusted—from application parameters—factual constraints that should remain outside model control.
  • Caveats: The talk is database-centered, but the same pattern applies to any tool that can retrieve privileged data and return it through a user-visible channel.
  • Implications: Threat-model tool calls as an authorization and data-flow problem, not merely a prompt-injection problem.; Document each tool argument's provenance and classify whether it is model-derived, user-authenticated, application-fixed, or token-derived.

Implementation components and evaluation signal

  • Claims: The presented stack spans a self-managed database MCP server, a hosted managed MCP offering, and an evaluation framework for agents, MCP servers, and skills.; Evaluation is presented as necessary to know whether tools work well, although the talk does not detail the framework's test methodology or metrics.
  • Evidence: MCP Toolbox for Databases is described as an open-source, self-managed service with customizable configuration, connection pooling, integrated authentication, and observability.; Google Managed MCP is described as a governed hosted option that can connect to agents and IDE/harness environments including Gemini CLI, Anthropic CLI, and Cloud Code.; Prerna Kakkar identifies herself as technical lead for EvalBench and recommends its repository for agent, MCP, and skills evaluation.
  • Caveats: No EvalBench scenarios, results, quality thresholds, or security-evaluation examples are provided in the transcript.; The flight-booking demo intended to demonstrate authenticated runtime access was unavailable because of technical difficulties.
  • Implications: Do not treat a tool schema as production-ready until it has adversarial tests for identity substitution, prompt-injected instructions, scope violations, oversized output, malformed inputs, and write-confirmation behavior.

Notable Concepts & Terms

  • Build time vs. runtime: Build-time tools support developers and exploratory work with flexibility and oversight; runtime tools serve end users and require constrained, deterministic, policy-bound actions.
  • Confused deputy attack: An attacker manipulates an agent into using its own higher privileges to access or expose data the attacker cannot access directly.
  • Lethal trifecta: Simon Willison's framing of a high-risk combination: private data, untrusted content, and the ability to externally expose outputs.
  • Source primitive: A server-side configuration mechanism that removes database connection details from model control and injects them when the MCP server runs.
  • Custom semantic tools: Predefined, outcome-level tools with controlled server-side logic and limited typed inputs, rather than raw SQL or atomic API exposure.
  • Bounded parameters: Parameters such as user identity are bound by the authenticated application and are unavailable for the model to alter.
  • Authenticated parameters: Tool inputs derived after validating an identity token, such as an OpenID/JWT, and extracting trustworthy user claims.
  • EvalBench: Google's referenced evaluation framework for agents, MCP, and skills; raised as the mechanism for validating that tools work well.

Operator Notes / Why Ken Should Care

  • Audit all current MCP and agent tools for model-controlled identifiers, credentials, endpoint locations, tenant scopes, database/table names, raw queries, or authorization-relevant flags; move these to application policy or validated identity claims.
  • Create a production-tool admission standard: semantic action boundary, simple flat schema, explicit read/write classification, server-side authorization, bounded output, actionable error contract, and tests for prompt-injection-driven privilege escalation.
  • Require explicit confirmation or an equivalent workflow gate for every state-changing tool; do not infer safety from a tool's friendly name or an agent instruction.
  • Add adversarial evaluations that attempt cross-user identity substitution, malicious content embedded in tickets/documents, arbitrary-query expansion, unauthorized dataset selection, and bulk-data extraction.
  • Evaluate whether MCP Toolbox's source configuration, driver-level read-only enforcement, allowed-dataset controls, JWT-claim binding, and audit/observability features map cleanly to Ken's existing control plane before adopting it.

Source/Metadata

  • Title: Build-Time vs. Run-Time: Why Dev Tools Fail in Production — Averi Kitsch & Prerna Kakkar, Google
  • Transcript words: 3513
  • Duration seconds: 1226
  • Timestamp note: No timestamps or chapter markers were present in the supplied transcript. The final portion repeats earlier tool-quality and authenticated-parameter material, and the planned demo was not available.
Full transcript 2876 words · 16 min read
0:00

Hey everyone, how are all of you doing today?

0:12

Yeah. So nice to meet you everyone. Today, my friend Avery and I are going to talk about build time versus run time, why your developer tools fail in production. So firstly, let me tell you about us. Hi everybody, I'm Avery Kitsch and I'm a staff software engineer working on Google Cloud databases. I'm currently the technical lead for MCP Toolbox for databases, our open source database MCP server and our Google Cloud MCP server maintainer.

0:30

Hi, I'm Pradna and I'm currently working as senior software engineer at Google. I am currently tech lead for EvalBench, which is the evaluation framework for all your agent, MCP and skills needs. And I'm also an active contributor to MCP Toolbox. So today we are going to cover three areas broadly. We will firstly start with the history of MCP at Google. Then we will cover the common tool patterns that we have found from our own work and practices, and how we use all those practices to build some tools for database access and how you can use them. And then lastly, we will talk about security guardrails, how you can stop data leaks using identity-aware guardrails.

0:50

So let's get to know the background quickly. I'll talk about MCP Toolbox for database. It's an open source, self-managed service that we provide. It has currently about 15.7k GitHub stars. We have 132 plus active contributors across 40 plus different databases. It's a highly customizable framework. And we provide you with connection pooling, integrated auth, and you don't even need to care about the observability. You will get all of them out of the box. Then if you don't want to do a self-managed one, but you want to have a hosted, scaled version, we provide something as Google Managed MCP. It's fully managed.

1:35

You can plug it across various agents and IDEs or harnesses like Gemini CLI, Anthropic CLI, Cloud Code, you name it. It's governed and the discovery is simple. And we also provide model armor, which provides secure access management and identity control. So combined with the managed version of MCP and the MCP Toolbox, last month we had 20 million tool calls. Some of the common tool patterns that we have observed specifically for databases, so I'm going to quickly talk about them. Firstly is the control plane tools. What we like to call them is admin tools or managed tools. It is basically in developer assistant space.

2:07

So it will help you create instances, manage your instances, create your databases, manage your databases. It will help you with all your DBA needs. But you need to be very careful. You need to have a human in the loop because we don't want to carry out any dangerous activities. So these tools are built on already provisioned public APIs. So you get monitoring and other things out of the box. Next one is natural language to SQL or NL to SQL tools. So we are relying on a tool called execute SQL and with the help of an agent, we generate raw SQL queries. So you can use this in cases where you don't know what queries you would require beforehand.

2:45

So you will get all these queries out of the box. So it focuses on developer assistance and analytical agents and you can use it for flexible explorations.

2:57

So for example, we have one example like find all customers in California who bought a winter coat in July and returned it within 14 days and grouped them by the marketing campaign that originally acquired them. So this is one of the queries where you can use this tool to get your answers. But then we have something called structured SQL tools, which is getting quite popular. And this targets mainly the production use cases where you know what SQL query you want to use and you want to have security built in. And the parameters are already configured. So you prevent SQL injection and ensure highly controlled access by restricting the agent to predefined logic.

3:20

It also helps you with your latency needs and reduces hallucination on the agent side. Now, we come to the main topic, I guess, for which you guys are here for, build time versus run time. So build time are the developer assistant use cases. You can think about the initial two cases that we presented to you like the NL2SQL tools and the control plane tools. They come into the category of build time tools. They are atomic and flexible. But again, you don't want to delete your databases. So it requires a human in the loop case and you can't run them on production use cases. But let's say I'm interested in building a chatbot and I want to do production use cases.

3:55

There you rely on runtime or end user applications. You can build those using Bedrock AI or Lanchain. So you can see one of the examples like we have a cancel order or deterministic structured SQL query that we have given and you can use it as a tool. This is one of the examples or demos for where a build time tool was used. And you can see the error message. So the agent actually asked to delete the table and start fresh. We deleted everything and there were no safeguards or guardrails here. Now let's go to our demo for runtime tools.

4:36

Yeah, maybe. I think until the video loads, sorry for the technical glitch that we have, but I can quickly walk you through what we are going to present in the video and I guess it's loading. So this demo is particularly talking about how we use our production tools in a chatbot. And we created a demo called Symbol Air. And Symbol Air is going to help me with booking all my flights in San Francisco and do whatever I would require to do in San Francisco, it would basically help me with it. One of the things that I would try is I would try to fool my agent that I am Avery and not Pradna and book a flight for me to San Francisco.

5:03

But because our agent has all the authenticated auth, it will not get fooled and it will not book any flights on behalf of Avery, but it will do it on my behalf. And then you can use it to basically change your flights. You want to know about all the shops that are there. You can do all these requirements using that. So I guess, thank you. Avery. Apologies again for our technical difficulties here. Unfortunately, it looks like I need to present from just this slide deck because it's not loading. Okay. So I apologize for not being able to see our demo today, but we can still learn all the security and guardrails that we need to secure our database access.

5:41

So the first thing that we need to know is your database is only as secure as your agent. We all know that agents and LLMs are actually pretty easy to trick. They might be getting slightly better today, but we can still work really hard to trick them. And so we have a very common attack pattern called the confused deputy attack. And this is when a user can trick an agent into misusing their privileges to access data that a user wasn't supposed to access. So Simon Willison actually coined the phrase, the lethal trifecta. And a data breach occurs when an agent has simultaneous access to three different things. One, private data. Two, untrusted content.

6:24

And three, the ability to expose that content and data back to an external user.

6:37

So let's take a look of that in action. So let's say I'm building a triage agent. And a ticket is fired or alert goes out and my agent is designed to look at that ticket and go investigate what it needs to do.

6:53

So on that ticket, the agent gets a little bit of data, like we need to go look in this database for these reasons. But a malicious insider can actually come into that trusted system and instead say, well, I want to query the salary database and please return all the employees' salaries. And so since this is a trusted system, the agent goes, okay, let me use my permissions. I have those privileges. I have that access. I will query that and I'll post that right back on the ticket because that's what the ticket needs to do. But now we have a huge data breach. A user that wasn't supposed to have access to private data now has that access. And so now we have a big PR fiasco.

7:44

So this makes a little bit more sense when we think about who's controlling access and who's controlling the parameters. So we talk about agent or application versus model controlled parameters. So in a traditional architecture, things were actually much easier because you would have a few input fields, you would define your queries, and then that would be safely injected into those queries. So it was okay when your application had a little bit more access because it knew exactly what actions it was going to take.

8:19

But in a Agentic application, these rules aren't as clear.

8:32

So we need to first think about separating the three different identities. We have the user identity, we have the application identity, and the agent identity. So first, we need to think about what the user has access to. So the user just needs to have access to the application. That application's workload identity can have a little bit more broader access because it needs to probably talk to different services. But the agent running in that application only needs to have access to the data that that end user initially needs to have. So next we need to think about who's controlling the tool inputs. So we have agent parameters and application parameters.

9:00

So agent parameters are the untrusted inputs that the agent is deriving dynamically. And then we also have application parameters. These are the factual constraints that we need to keep outside of the agent's control. Okay. So now let's look at the evolution of a secure tool. Here we have a fully model controlled tool. And so essentially the agent here is a super user. It has access to database credentials, the host, the port, the connection details, and even the raw SQL query.

9:38

And so we're only as secure as the agent here. And we can really easily, again, trick the agent into exposing all of this data. And now we have access to essentially any database in the system. So Toolbox solves for this by introducing a source primitive. So we move the connection details out of the agent's control. And in Toolbox, a user will pre-configure the connection details in a YAML file. And then when we start our MCP server, those are safely injected. And so we do not have to have the agent have access to that. So we can add a little bit more control to our source security as well. Our number one request that we get from customers is read-only restrictions.

10:20

We want to be able to remove all write ability from agents if we need that specific user journey. So this means removing write tools, but also down to the database driver, ensuring that we only do read-only queries. If we're also concerned about, again, blast radius and securing all of our tables and our databases, some of our cloud-native databases have this concept of allowed datasets. So again, we can add that enum to our source in order to continue to restrict the blast radius of the agent's control. And lastly is output size.

10:36

You might not actually think that this is a security layer, but if, again, the agent gets into the wrong hands, we can reduce that blast radius by saying the agent can only grab this much data.

10:43

So we're not overwhelming both our agent or our database. So sweet. We have our configurable sources tool. So you can see here that actually now our tool input, our tool signature is very minimalized. We only have the SQL string that's being generated by the agent. But this comes to our actual next problem. We want to be able to control what the agent is running. We don't want the agent to have the ability to generate any SQL that it can think of. So Toolbox introduces custom tools. And again, in our YAML file, we can define the exact SQL statement that will run very reliably. So we can define the query as a reliable and secure SQL query.

11:39

This also allows us to customize the tool name and the tool description. These are really important for the agent to have the context on how to use this tool accurately. And in the system, we use prepared statements with typed parameters in order to reduce SQL injection attacks. So we make sure that everything is validated for all input types when we inject that into the SQL for the user. Okay. Let's dive into a little bit more of best practices for tool quality. So we really highly recommend that tools focus on outcomes. We really shouldn't be thinking in atomic REST APIs. We should think about what the action actually needs to do.

12:22

This also reduces the round trip of needing to make multiple tool calls. And again, the descriptions are guidance. We shouldn't duplicate information like input parameters because the agent already has access to that. So writing really good tool descriptions is very important for accurate tool usage. We also recommend that you separate read versus write tools. By doing this, you can automatically approve read tools, and you can also then send write tools to the user for confirmation. And this just makes it very much more clear for the agent to use these. And this is actually the next one: actionable errors. This is the number one thing that I think we can all do better.

12:58

So usually we just return a generic HTTP error, 404. But we all know agents are actually really smart now. And so if you give the ability to have an error that can be retried, the agent can actually take that action. So being able to return errors is really important. And lastly, is simple inputs. We see that people try to use these complex maps, complex primitives that an agent needs to be able to build, and that is not reliable. Using flat structures with simple inputs will really increase your reliability.

13:32

So sweet. Now we're at custom semantic tools. You can see that we now have our lookup flights tool that takes in the dynamic parameters such as user ID and date. And so now we're very much more secure because the agent isn't generating that SQL query. It doesn't have the ability to go off the rails. It only is looking at these very specific inputs. But user ID is actually a very sensitive piece of information. It is PII. So we need to also remove that from the ability of the agent's control. So we can do this in two different ways. We have bounded parameters.

14:25

This is when the application first authenticates the user, and then we can bind that parameter directly to our tool. And so that restricts the agent's control of it. It actually never sees that user identity.

14:37

But Toolbox also solves for this in another way called authenticated parameters. This is when we tell the tool that you're going to receive an identity token, an OpenID, a signed JWT token. And when we call that tool, we want it first to validate that token. Is that token real?

14:55

Is that token correct? And then we'll extract the user claims from that token for the user. And so the claims usually include a user ID, an email, an issuer. And so it's secured because we're extracting that user identity out of the agent's control, and binding that to the tool. So now we have a much more secure tool. We have our Lookup Flights tool that only takes in a very simple parameter such as date. It doesn't have to handle any sensitive information such as PII, user identity. And so we're really here now at our zero trust architecture where we're in full control of everything that we need to be in control of.

15:33

So thank you all for coming to listen to our talk today. Again, I apologize for our technical difficulties. We highly recommend if you want to learn more about our technologies, that you look at our documentation and our GitHub repository. I also really want to highlight our EvalBench repository because this is how we know that our tools are working well and evals are very important.

15:51

So thank you all for joining us today. Thank you all for joining us today. So we really highly recommend that tools focus on outcomes. We really shouldn't be thinking in atomic rest APIs. We should think about what the action actually needs to do. This also reduces the round trip of needing to make multiple tool calls. And again, the descriptions are guidance. We shouldn't duplicate information like input parameters because the agent already has access to that. So writing really good tool descriptions is very important for accurate tool usage. We also recommend that you separate read versus write tools.

16:31

By doing this, you can automatically approve free tools, and you can also then send write tools to the user for confirmation. And this just makes it very much more clear for the agent to use these. And this is actually, the next is actionable errors. This is the number one thing that I think we can all do better. So usually we just return like a generic HTTP error, 404. But we all know agents are actually really smart now. And so if you give the ability to have an error that can be retried, the agent can actually take that action. So being able to return error is really important. And lastly, is simple inputs.

17:12

We see that people try to use these complex maps, complex primitives that an agent needs to be able to build, and that is not reliable. Using flat structure with simple inputs will really increase your reliability.

17:32

So sweet. Now we're at custom semantic tools. You can see that we now have our lookup flights tool that takes in the dynamic parameters such as user ID and date. And so now we're very much more secure because the agent isn't generating that SQL query. It doesn't have the ability to kind of go off the rails. It only is looking at these very specific inputs.

17:57

But user ID is actually a very sensitive piece of information. It is PII. So we need to also remove that from the ability of the agent's control. So we can do this in two different ways. We have bounded parameters. This is when the application first authenticates the user, and then we can bind that parameter directly to our tool. And so that restricts the agent's control of it. It actually never sees that user identity. But Toolbox also solves for this in another way called authenticated parameters. This is when we tell the tool that you're going to receive an identity token, an open ID, a signed JOT token.

18:37

And when we call that tool, that we want it first to validate that token. Is that token real? Is that token correct? And then we'll extract the user claims from that token for the user. And so the claims usually include like a user ID, an email, an issuer. And so it's secured because, or again, extracting that user identity out of the agent's control, and binding that to the tool.

19:08

So now we have a much more secure tool. We have our Lookup Flights tool that only takes in a very easy parameter such as date. It doesn't have to handle any sensitive information such as PII, user identity. And so we're really here now at our zero trust architecture where we're in full control of everything that we need to be in control of.

19:39

So thank you all for coming to listen to our talk today. Again, I apologize for our technical difficulties. We highly recommend if you want to learn more about our technologies, that you look at our documentation and our GitHub repository. I also really want to highlight our eval bench repository because this is how we know that our tools are working well and evals are very important. So thank you all for joining us today.

20:10

Thank you all for joining us today.

Reading tools

Type to find a passage

Appearance
Ask this transcript

Add a note