A chatbot that answers questions about your orders is one thing. A piece of software that reads those orders, decides something is wrong, and updates the record on its own is something else. That second kind of system is arriving fast, and most of the conversation about it focuses on models and prompts. Very little of it focuses on the place where the action actually happens: your database.
Before an AI agent gets a login to your Oracle, SQL Server, or PostgreSQL environment, it’s worth asking whether that environment is ready for a user that never sleeps, works at machine speed, and occasionally gets things wrong. This guide looks at agentic AI from the DBA’s side of the table, covering permissions, audit trails, data quality, and the safety nets that let you undo a bad decision.
Agentic AI describes AI systems that pursue a goal by planning steps and using tools, rather than only replying to a prompt. Ask a chatbot why an order is late and it explains. Ask an agent the same thing and it might check the warehouse table, find the stuck shipment, and reschedule it.
That jump from answering to acting is why the database matters so much. Every tool an agent uses eventually turns into a query, a stored procedure call, or an API that writes to a table somewhere.
Adoption is moving quickly. Gartner expects 33% of enterprise software applications to include agentic AI by 2028, up from less than 1% in 2024. The same research predicts that over 40% of agentic AI projects will be canceled by the end of 2027, citing rising costs, unclear business value, and inadequate risk controls. That last reason is the one a well-prepared database can fix.
ERP is where many teams will meet agents first, since vendors are building them straight into finance, supply chain, and HR modules. If you’re already weighing AI-powered ERP, the questions in this guide apply to the databases underneath it, too.
The risk lands on the database because that’s where an agent’s mistakes become permanent. A wrong sentence in a chat window is easy to ignore. A wrong UPDATE across 40,000 customer rows isn’t.
Agents also behave differently from human users. They don’t get tired, they can repeat an action thousands of times a minute, and they can be steered by text they read, including text planted in an email or a document. Database controls are built for people and applications, so they need tuning for this new kind of user.
A RalanTech health check reviews configuration, security, and performance, so you know what needs fixing before an AI agent connects.
Every agent should connect with its own database account that can reach only the data its job needs. That sounds obvious, but the easy path is to reuse an existing application account, and those accounts usually have far more access than any single agent should.
OWASP lists this problem as Excessive Agency in its Top 10 for LLM applications. Its guidance is direct: apply proper database permissions to the identity the AI tool connects with, so an agent that only needs to read a products table can’t insert, update, or delete anything.
In practice, least privilege for an agent looks like this:
Here’s what a narrow, read-only agent account can look like in PostgreSQL:
CREATE ROLE agent_order_status LOGIN;
GRANT USAGE ON SCHEMA reporting TO agent_order_status;
GRANT SELECT ON reporting.order_status_v TO agent_order_status;
ALTER ROLE agent_order_status SET statement_timeout = '15s';
ALTER ROLE agent_order_status SET default_transaction_read_only = on;The grants do the real work here. The read-only default and timeout are backstops, since a session can change its own settings.
One detail catches teams out. PostgreSQL’s row security documentation notes that superusers, roles with BYPASSRLS, and normally the table’s owner aren’t bound by these policies. If your agent connects as the table owner, the row rules you wrote won’t apply to it.

If an agent must change data, let it propose the change and have a person approve it. The simplest pattern is a staging table: the agent writes a suggested update with its reasoning, and a reviewer or a scheduled job applies approved rows.
Where approval isn’t practical, don’t hand over raw UPDATE rights. Give the agent a stored procedure that checks business rules, caps how many rows it can touch, and refuses anything outside its scope. The agent can call the procedure, but it can’t write freely around it.
A useful audit trail answers two questions at once: which agent ran this statement, and which person was it acting for. Most databases already record the first part. The second part takes deliberate setup.
The built-in options are solid. Oracle has Unified Auditing, SQL Server has SQL Server Audit, and PostgreSQL teams usually add the pgAudit extension. Turn them on for the agent accounts specifically, so you capture every statement they run without flooding the logs with everything else.
To record the human behind the request, have the agent’s tool layer pass the user’s identity into the session:
In PostgreSQL, you can set application_name or a custom setting per session, then include it in your log format.
Keep the agent’s own log as well, with the prompt, the plan, and the generated SQL, tagged with a request ID. When something goes wrong, you’ll want to join the database audit record to the reason the agent gave for acting. If you’d like an outside view of who can touch what today, RalanTech’s database security audit maps accounts, privileges, and audit gaps across your environment.
| Field | Why it matters |
| Agent account and version | Shows which agent, and which release of it, made the change |
| End user or business process | Ties the action back to a person or workflow who is accountable |
| Exact statement and rows affected | Lets you see the size of a mistake and reverse it precisely |
| Request ID linking to the agent’s log | Connects the database action to the prompt and reasoning behind it |
An agent trusts the data it’s given far more than an experienced employee would. A person who sees a customer listed three times, or a price of zero, stops and asks. An agent may simply act on it, and do so hundreds of times before anyone notices.
The usual problems aren’t exotic. Duplicate records, stale reference data, inconsistent codes between systems, and missing values all cause trouble for reports today. With an agent in the loop, they cause wrong actions instead of wrong charts.
Meaning matters as much as accuracy. A column called STAT_CD tells an agent nothing, and a guess about what “active customer” means can send it down the wrong path. Add column comments, which both Oracle and PostgreSQL support with COMMENT ON, build clearly named views, and write down the business definitions that matter. Cleaning up how data moves between systems is often the bigger job, and it’s where data integration consulting pays off.
Teams that already have a governed semantic layer for reporting are ahead here. The same trusted definitions behind your dashboards can feed your agents, which is one more reason to treat business intelligence and AI as one data program rather than two.
Even with tight permissions and clean data, plan for the day an agent misbehaves. Good safety nets limit how much damage it can do and how quickly you can recover.
Use this checklist before any agent connects to production data. If you can’t tick every row, keep the agent in a test environment or on read-only access until you can.
| Area | You’re ready when… |
| Permissions | Each agent has its own account, limited to specific views, with no admin rights and writes behind approval or a validating procedure |
| Audit trails | Agent accounts are audited, the end user is recorded in each session, and audit records link to the agent’s own log |
| Data quality | Duplicates, stale data, and placeholders are checked, and key tables and columns have clear names and comments |
| Safety nets | Resource limits are set, reads can go to a replica, agent activity is monitored, and a recovery has been tested |
Picture a distributor that wants an agent to answer “where’s my order?” for its customer service team. The first version only needs to read, so it gets one account with SELECT on a single order-status view, filtered by row rules to the customer service region it supports.
Every request carries the service rep’s username into the session, so the audit trail shows exactly who asked. Reads go to a replica, queries time out after 15 seconds, and a dashboard flags any spike in volume.
A few months later, the team wants the agent to update delivery dates. Instead of granting UPDATE, the DBAs add a stored procedure that changes one order at a time, checks the new date against carrier rules, and writes every change to a review table. The agent gets more useful, and the database stays in control.
Agentic AI refers to AI systems that work toward a goal by planning steps and using tools, such as databases and APIs, with limited human direction. Unlike a chatbot, an agent can take actions, not just produce answers.
Sometimes, but rarely directly. Start read-only, then allow changes through approval queues or stored procedures that enforce business rules and limit how many rows can change at once.
Usually not. Most of the work is configuration: narrower accounts, auditing, cleaner data, replicas, and monitoring on the Oracle, SQL Server, or PostgreSQL systems you already run.
AI ERP usually means AI features built into an ERP system, such as forecasting or assistants. Agentic AI goes a step further by letting the software take actions inside those processes, which makes the database controls underneath even more important.
Agentic AI will reach your data one way or another, whether through an ERP vendor’s new features or a tool your own team builds. The organizations that benefit will be the ones that treat each agent like a new, very fast employee: limited access, a clear record of what it does, good data to work from, and a quick way to reverse its mistakes.
None of that needs new technology. It needs the database basics done well, and done before the agent logs in. If you’re exploring AI-powered SQL or agents for the first time, start with permissions and audit trails, and the rest gets much easier.
Talk to RalanTech’s database team about permissions, auditing, and data readiness, so your first agent goes live safely.
Raju Chidambaram is a seasoned technology executive with over 30 years of global leadership in enterprise IT, cloud architecture, and secure data operations. As the Co-Founder and Chief Technology Officer at RalanTech, Raju is the strategic force behind high-performance technology platforms that drive business transformation for Fortune 1000 companies and emerging growth companies. With deep expertise rooted in enterprise data center management and mission-critical database systems, Raju brings unparalleled depth in cloud strategy, database modernization, and multi-cloud migration. He has architected scalable, resilient, and secure data platforms across hybrid and public cloud environments, ensuring performance, compliance, and business continuity for over 200+ enterprise clients.
RalanTech is specialized in database managed services. We are passionate about leveraging cutting-edge solutions to drive innovation, efficiency, and growth for our clients.

Join thousands of professionals who rely on our newsletter for insights that drive real growth. Signup now and stay informed, inspired, and ahead.