TL;DR: Teleport shows AI agents in PostgreSQL inherit whatever broad role a service account permits, leaving DBAs unable to tell which agent ran a query, bound access to a task, or attribute misuse reliably. That makes short-lived identity, column-level permissions, and session attribution the real control plane for agentic database access.
Editorial analysis by NHI Mgmt Group, based on content published by Teleport: “PostgreSQL: How to Control and Audit Agent Access with Identity”.
Key questions
Q: What breaks when AI agents share PostgreSQL service account credentials?
A: Shared credentials collapse multiple actors into one database role, which removes the ability to tie a query to a specific agent or task.
Q: Why do static PostgreSQL credentials increase the risk of agent misuse?
A: Static credentials extend the trust window far beyond the task that justified them.
Q: What are the signs that administrative access to an agent platform is too broad?
A: The clearest warning sign is when everyone can build, execute, and administer everything.
Practitioner guidance
- Implement per-task database identities Issue agent credentials at connection time and expire them when the task ends so the credential cannot outlive the work it was meant to perform.
- Replace broad schema grants with object-level permissions Use column-level privileges and row security policies so the agent can only query the fields and records needed for the task.
- Attribute every session to the initiating agent Record the agent identity, session ID, target database, and authorization result so DBAs can reconstruct who initiated each query chain.
Bottom line: AI agents do not fit cleanly into PostgreSQL role models because the database cannot tell which actor initiated the connection or what task justified it.
What's in the full article
Teleport's full blog post covers the operational detail this post intentionally leaves for the source:
- The database session controls that create and drop a user at connection time for agent access
- The exact PostgreSQL grant patterns for column-level and row-level restrictions
- The sample Teleport audit events that tie a query back to a specific agent identity
- The session replay output that DBAs can use to reconstruct a query chain
👉 Read Teleport's analysis of AI agent PostgreSQL access control and identity →
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Shared database roles create identity blindness for agents: PostgreSQL role-based access was designed for systems whose identity is stable enough to be represented by a single credential. That assumption breaks when an AI agent can act on inputs, shift query scope, and execute without a human-style pause. The implication is that database governance must stop treating role membership as proof of actor identity.
A few things that frame the scale:
- 62% of organisations are at least experimenting with AI agents, but only 23% have scaled one into a single business function, according to McKinsey's 2025 State of AI survey.
A question worth separating out:
Q: How should teams decide between schema-level and row-level controls for agents?
A: Use row-level and column-level controls when the task needs a narrow slice of data and the agent should never see the rest of the table. Schema-wide access is too coarse for most agents because it assumes the workload will self-limit, which is not a safe governance assumption.
👉 Read our full editorial: Control and audit AI agent PostgreSQL access with identity