We're in a new era now, where agents are gaining more powers and access to data. In this paradigm, engineers must somehow balance the need to share data with agents with the overwhelming pressure to avoid sharing the wrong data.
This pressure is especially acute in financial industries, where not complying with regulations against oversharing personally identifiable information (PII) is a real, present risk.
Much of today's AI activity centers on building applications, says Sanjay Mishra, Apress author and principal software engineer at Fidelity Investments. But when it comes to giving agents access to enterprise databases, "people are right now talking less on this," he says, calling it a "brand new topic." (Mishra notes that his views reflect his own independent research, not those of his employer.)
This is highly problematic, given the access control issues inherent in allowing nondeterministic AI to interact with sensitive data. AI is easily coerced and routinely over-permissioned.
Coercing an agent to get data
One big vulnerability is that access levels for employees don't always match AI agent access levels. Often, service accounts for agents are far more permissive than user accounts. "There are so many vulnerabilities," says Mishra, which is why many enterprises haven't yet allowed agents direct database access.
In a written follow-up, Mishra offered a concrete example. "Say an analyst asks for revenue by region last quarter. That task needs four columns. The shared account can read seventy," he says. "So what limits the agent is that account, not the small question."
This isn't just anecdotal. In a 2026 Teleport survey of over 200 US infrastructure security leaders, 70% said their AI systems hold more access rights than a human in the same role would get, and organizations with over-privileged AI saw 4.5 times more security incidents.
Without strong guardrails, it's easy for risk to accumulate, too. As Mishra says, an agent's willingness to interact with a database can be manipulated based on how you prompt. He shares an example having to do with employee information.
Take an example like asking an agent to see a colleague's salary information. The agent says no. But ask for the total salary of that person's department, then ask for the same total for everyone except that person, and you get a result you can infer from.
The core issue: nondeterminism
SQL written by developers is deterministic, explains Mishra. But when AI generates the queries, the same question can lead to "multiple answers," he says.
Revealing too much information is just one example of many authorization and privilege implications that arise in the age of agents. To his point, the OWASP MCP Top 10 currently lists Insufficient Authentication & Authorization as a top risk.
In data engineering, the issue of nondeterminism must be met by scoping agentic access to the right "views," which offer slices of databases to the client. This is foundational for generating API-based access to select internal data, for instance.
Yet, staying within the scope of views isn't dependable for AI agents. Handling the views "will be pretty much complex," he says, "because, again, everything is decided on the runtime." He notes that agents are typically given more granular, account-level access.
Guarding the whole conversation
The answer, Mishra later added, is to judge the conversation as a whole rather than each query on its own. "Many guardrails check each prompt and response on its own, so they miss failures that only show up over a dialogue," he says.
Views can't do that job alone, either. "If the agent connects through one shared account, the database sees that account, not the person behind the question," he says. That means carrying the real user's identity all the way through to the database. And even then, a view "doesn't remember what earlier answers already gave away."
Official MCP database servers relieve (some) stress
Another saving grace is the arrival of official MCP servers for popular databases and database platforms across PostgreSQL, MySQL, Elasticsearch, Neo4j, and plenty of others.
Such servers can provide more intent-based actions for agents that are more scoped than giving them direct database access. Yet, the downside is that this creates new configuration headaches for MCP server administrators, who must then set them up for safety.
An MCP server is also only as constrained as the credentials behind it. In his follow-up notes, Mishra pointed out that a database MCP server runs "as whatever database account you connect it with, so if that account is broad, the agent's access is broad too."
Nearly every major database now offers an MCP server, says Mishra, and the rules and validations built into them are "mitigating a lot of problems." Problems still exist, he acknowledges. According to Mishra, the providers of these MCP servers, including Oracle, have documented some of the problems and are "trying to mitigate as much as possible."
His advice for teams connecting agents to their databases is blunt. "Don't trust generated SQL just because it looks right," he says. "The model is a helpful drafter, not someone you leave to run things on its own."
Sources
- OWASP MCP Top 10, OWASP
- Over-Privileged AI Drives 4.5 Times Higher Incident Rates, Infosecurity Magazine