Build-Time vs. Run-Time: Why Dev Tools Fail in Production — Averi Kitsch & Prerna Kakkar, Google
Read the talk
Build-Time vs. Run-Time: Why Dev Tools Fail in Production
Averi Kitsch and Prerna Kakkar show why flexible database tools become dangerous when exposed to end users—and how predefined SQL, restricted privileges, and application-bound identity turn an agent tool into a production interface.
From a talk by Averi Kitsch and Prerna Kakkar
At a glance
Ideas worth remembering
Keep control-plane and arbitrary SQL tools in human-supervised development workflows; production agents should invoke predefined operations with narrow, typed inputs.
Treat model-derived parameters as untrusted. Connection details, SQL statements, permissions, and authenticated user identity belong under application or server control.
Bound or authenticated parameters prevent a prompt from substituting another user’s identity; the final tool can expose only nonsensitive choices such as a date.
Design tools around outcomes, separate reads from writes, return errors an agent can act on, and prefer simple flat inputs.
Developer tools and production tools have different jobs
Averi Kitsch, technical lead for MCP Toolbox for databases, and Prerna Kakkar, technical lead for EvalBench, begin with a practical distinction: database tools that help developers explore or administer a system are usually the wrong tools to place behind a production agent. MCP Toolbox supplies database connectivity, authentication, connection pooling, and observability, but those capabilities do not decide how much freedom an agent should receive. The tool interface still determines what the agent can do.
The first two database patterns favor flexibility. Control-plane tools create and manage instances or databases. Because these administrative operations can be destructive, they belong in developer-assistance workflows with a human checking consequential actions. Natural-language-to-SQL tools let an agent generate raw SQL when the necessary query cannot be known in advance. They suit exploration, such as finding California customers who bought a winter coat in July, returned it within 14 days, and then grouping them by the campaign that acquired them.
Structured SQL tools target a different operating environment. The SQL statement and accepted parameters are defined before deployment, leaving the agent to select a known operation and supply a small set of values. That limits invented queries, supports injection defenses, and can reduce latency because the model no longer synthesizes SQL for every request. The lost flexibility is intentional: production software should expose the actions the product supports, rather than every action the database can perform.
Build-time flexibility versus runtime control
Read the diagram as text
- Control-plane tools. Build time — Create or manage databases and instances; powerful administrative operations require human supervision.
- Natural language to SQL. Build time — The agent generates raw SQL for queries that cannot be anticipated beforehand.
- Structured SQL tools. Run time — Predefined logic and configured parameters constrain production operations.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
“Delete the table and start fresh” is not a recovery policy
Build-time tools are atomic and flexible, which makes them useful under a developer’s supervision and hazardous inside an end-user application. A production chatbot instead needs runtime operations such as a deterministic cancel_order tool whose database behavior is fixed behind the interface.
The failure at 6:05 is blunt. After encountering an error, the agent proposed deleting the table and starting over. The table was deleted, with no guardrail stopping the operation. The observable result was total data removal; the causal chain was an error, a model-generated recovery idea, broad database authority, and no independent control capable of rejecting the destructive path. A plausible suggestion became an executable disaster because the tool exposed too much power.
The planned runtime demonstration used SimAir, a flight-booking chatbot. Prerna would claim to be Averi and ask the system to book a flight under Averi’s identity. Authentication was intended to keep the booking tied to Prerna instead. The demonstration did not load, so the recording explains the intended result without visibly verifying it; the identity-binding mechanism later in the talk shows how the application is meant to enforce that result.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The confused deputy turns a work item into a breach
“Your database is only as secure as your agent” captures the next problem. Language models can be manipulated, so database security cannot depend on the model consistently distinguishing legitimate instructions from malicious ones. In a confused deputy attack, someone convinces an agent to misuse privileges that the agent legitimately possesses but the requester does not.
The dangerous combination is the “lethal trifecta,” a phrase coined by Simon Willison: access to private data, exposure to untrusted content, and a channel that can return data to an external user. The triage-agent example at 9:38 contains all three. The agent reads a ticket, uses database permissions to investigate, and posts its findings back to the ticket.
A malicious insider inserts an instruction to query the salary database and return every employee’s salary. The agent complies because the ticket looks like a trusted work item and the database accepts the agent’s credentials. The breach does not require stealing those credentials. The attacker instead supplies content that persuades a privileged deputy to use them.
Traditional applications narrow this path with fixed fields and predefined queries. Agentic applications introduce values derived dynamically from language, so the system must distinguish agent-controlled parameters from application-controlled parameters. Agent parameters come from model interpretation and should be treated as untrusted. Application parameters encode facts and constraints—such as the authenticated user’s ID—that must remain outside the model’s control.
How a confused deputy leaks salary data
Read the diagram as text
- Triage ticket. Untrusted content — Contains a planted instruction requesting salary data.
- Privileged triage agent. Deputy — Interprets the ticket and has permission to query the database.
- Salary database. Private data — Returns private employee salary information under the agent’s privileges.
- Ticket response. External channel — Publishes the retrieved data where an unauthorized user can read it.
- Triage ticket → Privileged triage agent: Supplies malicious instruction.
- Privileged triage agent → Salary database: Queries with agent privileges.
- Salary database → Privileged triage agent: Returns private data.
- Privileged triage agent → Ticket response: Posts results back.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Tool quality precedes the final identity boundary
A constrained tool can still fail if the agent cannot understand or invoke it reliably. The recommended interface is outcome-shaped rather than a thin copy of atomic REST endpoints. A tool named for the complete action can replace several round trips, while its description should explain when and why to use it instead of repeating parameter definitions already present in the schema.
Several interface choices improve control and reliability:
- Separate reads from writes. Read tools can be automatically approved while write tools can require explicit user confirmation.
- Return actionable errors. A generic
404gives the agent little recovery guidance; an error that identifies a retryable condition gives it a useful next step. - Prefer flat, simple inputs. Complex nested maps are harder for models to construct consistently than a small set of typed fields.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Bind user identity outside the agent
The lookup_flights tool now has predefined SQL and accepts only specific fields such as user_id and date. That is safer than arbitrary SQL, but user_id remains sensitive: a prompt could still persuade the model to substitute another account. The final step removes this parameter from the agent-visible interface.
With bound parameters, the application authenticates the user and injects the resulting identity directly into the tool call without showing it to the agent. With authenticated parameters, the tool receives an OpenID-signed JWT, validates the token, and extracts claims such as user ID, email, and issuer. Both mechanisms make conversation text unable to select the account under which the query runs.
What changed from the original superuser tool to the final lookup at 19:08? The diagram follows the shrinking control surface. Connection details move into server configuration; driver restrictions and, where supported, allowed datasets limit the blast radius; custom tools replace generated SQL; and authenticated application state supplies the user identity. The agent is left with a nonsensitive choice such as the date.
The resulting design is described as a zero-trust architecture because meaningful privileges and factual constraints are not granted merely because the model appears cooperative. That label does not make the complete system automatically safe; it describes where enforcement occurs. The model proposes a date, while components outside the model determine the connection, permitted operation, reachable data, output size, and authenticated user.
The closing reminder is operational: tool behavior must be evaluated, not merely declared secure. EvalBench is highlighted as the framework used to check whether agentic tools work well. The recording does not provide evaluation results, but the dependency is clear: SQL and identity guardrails define permitted behavior, while evaluations test whether agents select and use those constrained tools successfully.
From database superuser to identity-bound operation
Read the diagram as text
- Model-controlled database tool. Build time — The agent controls credentials, connection details, and raw SQL.
- Configured source. Server configuration — YAML holds connection details outside the agent-visible signature.
- Driver and data limits. Server enforcement — Read-only enforcement and output caps bound the blast radius; some cloud-native databases also support allowed datasets.
- Custom semantic tool. Runtime tool — Exact SQL, typed parameters, and prepared statements replace arbitrary generated queries.
- Identity-bound flight lookup. Runtime tool — The application or a validated token supplies user identity; the agent supplies only a date.
- Model-controlled database tool → Configured source: Remove connection control.
- Configured source → Driver and data limits: Constrain reachable actions and data.
- Driver and data limits → Custom semantic tool: Replace arbitrary SQL.
- Custom semantic tool → Identity-bound flight lookup: Remove user identity from model control.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
Further reading
A practical introduction to MCP Toolbox for Databases, its supported databases, and database-aware development workflows. It provides useful context for the flexible build-time tools that this talk says should remain human-supervised.
Related talks
- How to Secure Agents using OAuth
A related talk on OAuth and agent security for readers interested in the identity discussion.
- CIAM for AI: Authn/Authz for Agents — Michael Grinich, CEO of WorkOS
A related talk focused on authentication and authorization for agents.
- Building Protected MCP Servers
A related talk on protecting MCP servers, complementing the database-tool security discussion.
Transcript & slides
Loading transcript and slides…