Is Your Database Ready for AI Agents? Access, Audit Trails and Deletion
Follow one customer record through an AI stack to see where access, accountability and deletion break down

Here is a small thought experiment. A customer asks your company to delete their data.
A few years ago, that was mostly a solved problem. You ran a DELETE against the right tables, checked your backup retention policy and moved on.
Now add an AI assistant to the product. Where else might that customer live? In text chunks prepared for retrieval. In embeddings inside a vector store. In an old index snapshot nobody cleaned up. In prompt logs. In an evaluation dataset someone built to test answer quality. Possibly in fine-tuning data.
Suddenly, "delete this customer" is not a statement. It's a search.
That is one face of a broader problem Victor Horlenko, Head of AI Innovations at Devart, explores in The AI Readiness Problem Hiding in Your Database on HackerNoon. His argument: most readiness reviews ask whether an AI system works (model quality, infrastructure, security sign-off). Few ask whether you can account for what it did with your data. Let's follow one record through the stack and see where that accountability slips.
Stage 1: Data enters an answer by similarity
If you're new to retrieval-augmented generation (RAG), here's the short version. Documents are split into chunks, and each chunk is converted into an embedding: a vector of numbers that captures its meaning. When a user asks a question, the system fetches the chunks whose embeddings sit closest to the question's embedding and hands them to the model as context.
The catch is that the database only sees "give me the nearest vectors to this one." It never sees the question or the reason behind it. An HR assistant asked about parental leave might retrieve the leave policy plus a passage from a grievance file that also discusses leave. Both are relevant. Only one is appropriate.
Relevance is a math problem. Appropriateness is a policy problem. Vector search solves only the first, so permissions have to be applied as filters before or alongside the similarity search, not hoped for afterward.
Stage 2: Nobody knows who asked
Most AI assistants reach the database through a single service account, even when they serve thousands of people. Your logs show that the AI service read a record, but not whose request triggered it.
That matters most when something goes wrong. Knowing which service touched a record is not the same as knowing who needed it and why, and that is exactly what auditors and regulators ask. Closing the gap means carrying the end user's identity and a request ID down to the database layer, for example through session context, so every query can be traced back to a person.
Stage 3: Copies multiply, and they stay sensitive
It's tempting to treat embeddings as a safe, abstract version of the original text. Research says otherwise. In Text Embeddings Reveal (Almost) As Much As Text, Morris and colleagues reconstructed 92% of 32-token inputs exactly from their embeddings and recovered full names from embeddings of clinical notes.
The practical rule is simple: data keeps its sensitivity wherever it travels. A vector store, a cache, a prompt log or an evaluation set each needs its own access control, its own retention rule and its own way to delete things.
Stage 4: Deletion and reproducibility get harder
Back to our customer. Deleting them now means finding every derived copy, removing it and being able to prove it's gone. That looks less like a single transaction and more like a cleanup operation across several systems.
There's a mirror-image problem too. Suppose someone later challenges a decision an AI assistant helped make. Re-embedding a corpus or rebuilding an index can change what gets retrieved, so today's source records may not explain yesterday's answer. To reconstruct it, you need the index version and the exact records retrieved at the time.
The twist: schema changes can widen AI access
One subtler issue. If an AI agent can inspect your schema and write its own SQL, a schema change can quietly expand what it reaches. Add a column to a table the agent already queries, and that data may become visible to it without anyone touching the agent's configuration.
That turns a routine schema review into a permissions review. Comparing schemas between staging and production now also tells you whether a release changed what your AI can see.
So what do you actually do?
The good news is that most of the controls already exist, and database teams know them well:
- Review AI-generated SQL before it runs against production.
- Limit the tables and columns each agent can access, ideally with a separate least-privilege identity per agent.
- Track schema changes in version control and run checks in CI (GitHub Actions or Azure DevOps, for example) before deployment.
- Compare schemas across environments and check dependencies, with a rollback path ready.
- Extend retention and deletion policies to every derived store, not just primary tables.
AI tooling can take on some of the SQL-heavy work. dbForge AI Assistant, for instance, is an AI SQL copilot built into dbForge database tools that uses database metadata to generate, explain, troubleshoot and optimize queries. But tooling only enforces a policy. Deciding which data an agent should reach, and for what purpose, remains a human responsibility.
A quick self-test
Before you scale an AI feature that touches real data, check whether your team can answer these:
- Can we trace an AI answer to the queries, records and data version it used?
- Does each agent have its own least-privilege identity, linked to the person it served?
- Are AI-generated queries and schema changes reviewed before production?
- Do retention and deletion rules cover embeddings, caches, prompt logs, eval sets and replicas, and can we confirm deletion is complete?
- Can security trace database activity back to the AI request behind it?
If any answer is "not sure," that is your readiness gap.
The bottom line
Models will keep changing. The data layer underneath them won't. If accountability is weak there today, AI will expose that weakness rather than fix it. AI readiness, in the end, is less about the model and more about whether someone owns the answers to the five questions above.
Comments
Join the discussionNo comments yet. Be the first to comment.




