Jeff Smith on Safer Database Access for AI Agents

Oracle’s Jeff Smith explains why generated SQL can be misleading and shows how reviewed reports, schema context and database-level controls can limit agent risk.

JSJeff SmithSpeaker · Oracle
Channel
AI Engineer
Published
Oct 31, 2026
Video
21:39
Read
6 min
Slides
8
Original
English
Open on YouTube
Scroll to read and the video shrinks to the bottom-right corner. Captions follow your reading language.
Reading languageAvailable in 2 languages
You're reading the original English.
SUMMARY

In 30 seconds

Jeff Smith of Oracle describes three database use cases for agents: answering business questions, investigating performance and exploring unfamiliar schemas. He recommends reviewed parameterized reports, limited tools, human control and database-enforced identity and access rules, while presenting Oracle product examples and roadmap items.

  1. 1A plausible answer can be wrongA model-generated SQL query can return rows without representing the question the user meant to ask.
  2. 2Make reports available as toolsAgents can discover and execute reviewed, parameterized reports rather than generating each query.
  3. 3Investigate away from productionSmith describes using a read-only standby and retaining human control over changes.
  4. 4Give agents schema contextAnnotations and filtered metadata can explain business terms and reduce repeated exploration.
  5. 5Carry the user identityDatabase policies can filter results according to the authenticated user’s roles and permissions.

Takeaways

  1. A SQL query that runs successfully can still answer the wrong business question.
  2. Reviewed parameterized reports constrain generated SQL, though an agent can still choose the wrong report.
  3. A read-only standby and narrowly scoped tools can provide a safer place to investigate performance.
  4. Natural-language schema annotations can help agents understand business terms and reduce exploratory queries.
  5. Enforce user identity and data permissions at the database layer; read-only access alone does not prevent disclosure.
FULL TEXT

Read the edited text by chapter

Transcript only
01

Why agents need database context

Smith introduces the database capabilities and the problem of safe access.

I’m Jeff Smith from Oracle, and I’ve spent about 25 years working on database tools. One thing I learned early is that, however good a tool you build, people still want their answers in Excel. Even in the age of agents, the business questions behind those spreadsheets have not gone away.

People keep asking what the Oracle AI Database is. My short answer is that the database can participate in retrieval-augmented generation pipelines because it supports vectors natively. You can work with vectorized information alongside business data and query it through SQL, rather than replicating everything into a separate system for every workload.

Vector support in Oracle AI Database
SLIDE 1 / 8Vector support in Oracle AI DatabaseThe slide highlights native vectors and SQL access alongside other database capabilities.

Vectors are not the only workload we support. Alongside relational tables and columns, Oracle has added other data types and graph capabilities, including support for graph-based RAG. The company is old, but we continue to build and release new features.

The reason I care about MCP is straightforward: an organization’s data and knowledge are in databases, and agents need context. The difficult part is getting information to them safely without leaking personally identifiable information or otherwise harming the business. I’ll focus on use cases, the risks of natural language to SQL, and ways to reduce token use.

02

Business questions and the risk of generated SQL

Self-service analysis can help business users, but a successful query may still be wrong.

Self-service data access
SLIDE 2 / 8Self-service data accessThe use case frames natural-language questions alongside governance and read-only access.

The first use case is self-service data access. Database administrators and DevOps engineers are often the first to connect a new MCP server, because they have access to the infrastructure. But a much larger group of business users must answer questions about sales, regional performance or discounts for their leaders.

Today those people search data marts and BI reports, build spreadsheets and pivot tables, and bring the results to meetings where important decisions are made. The questions do not run out; the scarce resources are the time and people needed to answer them. Generative AI could help people investigate more of those questions.

There is a catch: the people who understand the business are not necessarily SQL experts. They may not recognize that an agent has chosen an inappropriate cross join. A query that runs and returns rows is not necessarily answering the question the user intended to ask.

That is why I think natural-language-to-SQL is powerful and dangerous. Models can produce plausible but wrong queries, and I would not let a returned result alone decide where the business should invest. The agent may also spend considerable time and tokens probing the data dictionary to find the right tables.

03

Expose trusted reports as tools

Parameterized, reviewed reports give agents a bounded alternative to generating every query.

Most organizations already have folders of reports they use repeatedly. My suggestion is to make those vetted reports available through the database or an MCP server as tools the agent can call. Instead of generating SQL from scratch, the agent can discover the relevant report and supply its inputs.

This takes preparation. Describe each report, what it means, the inputs it accepts and examples of questions it can answer. The inputs are parameterized while the underlying report query is largely fixed. The model can still choose the wrong report, but it has one fewer opportunity to invent the wrong SQL.

Discovering available reports
SLIDE 3 / 8Discovering available reportsThe example shows an agent listing parameterized reports rather than creating each query from scratch.

I do not need to expose 500 reports as 500 separate tools. I can offer a list-reports tool and an execute-reports tool. The agent searches the catalog using a key phrase, receives matching reports and runs the selected one. Keeping the tool surface compact also avoids crowding the context with hundreds of definitions.

Oracle’s MCP servers can also execute arbitrary ad hoc SQL or stored procedures, but they support disabling that capability and limiting access to custom tools and reports. Which mode to use is a security and governance decision; the existence of an execution tool does not mean every agent should receive it.

Reports can serve another purpose: they show how the business and its data model work. If an OAuth 2 session has the appropriate scope or role, a tool can expose the SQL behind a report. The agent can use that example as context when it needs to formulate a new query, rather than guessing the organization’s definitions.

04

Investigate performance with limited access

Smith describes a read-only standby and controlled tuning tools, with humans retaining control.

The second use case is performance tuning. Database documentation and examples are widely available, so models can often suggest what to inspect when a query is slow. Even so, I do not trust an LLM to drop or create an index in production on its own. I want advice that a person can evaluate and act on.

Ideally I would keep the agent away from production altogether. A test environment may not mirror production, but Oracle Data Guard can provide a read-only standby that serves reports and queries. If the performance problem also appears there, the agent has a safer place to investigate possible improvements.

Performance tuning with human control
SLIDE 4 / 8Performance tuning with human controlThe slide frames agent recommendations and database administrator control.

Read-only access is not enough by itself: an agent may still be able to read information it should not see. Enforce security at the database layer, not only in a particular client tool. Otherwise someone can point a different tool at the same database and bypass controls that existed only in the first one.

A controlled performance operation
SLIDE 5 / 8A controlled performance operationThe example illustrates a custom operation for gathering statistics.

For a tuning example, I built a custom tool with six operations I am comfortable allowing. One collects statistics about the data. A cost-based optimizer uses information such as the number of distinct values in a column to choose an execution plan; fresher, better statistics can improve its chances of choosing a good plan.

Rather than expose a separate tool for every single action, I group related operations into a few tools with options. A performance tool might produce an Automatic Workload Repository report or collect statistics. The agent can help investigate, while the database administrator retains control over consequential changes.

05

Document the schema for agents

Annotations and compact metadata help agents understand an unfamiliar data model.

The third use case is schema exploration and documentation. A new employee rarely finds a perfect map of internal terminology, table names and business rules. A sales figure might live in a surprisingly named table because of a decision made decades ago. Models face that same gap when asked to generate SQL.

We can use existing documentation, such as Confluence pages, to add natural-language annotations to schema metadata. This is context engineering: give the model information about the environment instead of making it repeatedly reverse-engineer the database. The annotations can help people as well as agents.

Our schema-information tool returns a compressed dictionary of attributes in JSON. It can provide different levels of detail and filter by keywords. That replaces a series of exploratory calls to list every table and column, retrieve comments and sample rows just to work out where the relevant data might be.

Schema exploration tools
SLIDE 6 / 8Schema exploration toolsThe slide shows schema information and annotation tools for context engineering.

A retrieve-context tool can use that information for vector search. A generate-annotations tool can process documents such as PDFs, presentations, spreadsheets and Word files, extract and organize the text, and store annotations in the database. The aim is to provide more useful context for a later natural-language query.

Annotated Strava activity schema
SLIDE 7 / 8Annotated Strava activity schemaThe example illustrates natural-language descriptions of database fields.

I use my own Strava workout history as an example. I collect the data via an API and store it in the database, but some columns use different units or contain things their names do not make obvious. Annotating those details makes it easier for an agent to interpret my history when I ask about a future workout.

06

Enforce identity and data security

Single sign-on and database policies determine which information may reach the agent.

Identity, access and audit
SLIDE 8 / 8Identity, access and auditThe slide groups single sign-on, scoped read-only access and an audit trail.

Finally, security starts with knowing who is asking. My colleague and I may be entitled to see different information. In the design I describe, the agent uses the organization’s single sign-on identity and the associated scopes and roles, so access can reflect the actual user rather than a shared, unrestricted identity.

For example, the database can permit an HR manager to see salary data while restricting others. When generated SQL runs, database policies filter the result before it reaches the agent; Oracle calls this deep data security. This depends on correctly configured identity, roles and database policies—it is not something to assume merely because an agent is connected.

I close with a brief product roadmap: Oracle is building MCP apps for database interfaces inside agents and offers skills and automated RAG pipelines. The specific capabilities and availability I describe are Oracle’s product plans; the broader lesson is to make database access useful while retaining explicit control over identity, privileges and execution.

More from this channel

18:52EN
AI Engineer· Nov 1, 2026Hahnbee Lee and Lincoln Murr on Documentation and Payments for AI AgentsHahnbee Lee, Lincoln Murr · MintlifyAs agents increasingly read docs and use services, Mintlify and Coinbase describe the importance of accurate content, APIs, payment permissions and maintenance.Agent engineeringAgentic commerceDeveloper productivity
Slides18:45EN
AI Engineer· Nov 1, 2026Ramakrishnan Lokanathan: Evaluate the AI Agent’s Job, Not Just Its AnswerRamakrishnan LokanathanA practical framework for testing complete AI workflows, combining human feedback and regression checks with more challenging evaluations.Agent engineeringAI SafetyMachine Learning
7 slides14:44EN
AI Engineer· Oct 31, 2026Supriya Subudhi on Five Lessons From A/B Testing AI at BumbleSupriya Subudhi · BumbleA positive test is only the start: usage, output quality, model cost and regulation all shape whether an AI feature can scale.AI Product ManagementProduct & UXEvals+2
7 slides18:29EN
AI Engineer· Oct 31, 2026Steven Latré on the Economics of Running Your Own AI ModelsSteven Latré · imecAn imec study compares APIs, rented GPUs and owned infrastructure for long-running coding agents.InferenceAI cost & performanceInfrastructure & deployment+2
5 slides17:02EN
AI Engineer· Oct 31, 2026How Upstart Evaluates Voice Agents for Regulated Lending CallsBrooke Hopkins, Shiv Indap · CovalShiv Indap and Brooke Hopkins explain human review, LLM judges and simulation in a continuous evaluation loop.Voice AIEvalsAgent engineering+2
7 slides25:47EN
AI Engineer· Oct 31, 2026Richmond Alake on Memory and the Intelligence Plane for AI AgentsRichmond Alake · OracleOracle’s Richmond Alake proposes an intelligence plane to connect agent memory, enterprise knowledge and continual learning. He illustrates the idea with architecture diagrams and demonstrations.Agent memoryAgent engineeringContext engineering+2