# PostgreSQL: How to Control and Audit Agent Access with Identity

DevFeed: [PostgreSQL: How to Control and Audit Agent Access with Identity](<https://devfeed.tech/articles/postgresql-how-to-control-and-audit-agent-access-with-identity-29789.md>)

Original publisher: [Read original article](<https://goteleport.com/blog/postgresql-control-audit-agent-access/>)

Author: info@goteleport.com (Megan Moore)

Published: 2026-06-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Teleport](<https://devfeed.tech/sources/teleport.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>), [audit](<https://devfeed.tech/topics/audit.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [audit](<https://devfeed.tech/tags/audit.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>)

## AI overview

This article explains that PostgreSQL cannot identify AI agents as distinct actors because they authenticate as database roles. It describes the resulting access-control and audit risks, including broad permissions, non-deterministic query behavior, and long-lived service-account credentials, and introduces short-lived, task-scoped access as an alternative.

## Source excerpt

PostgreSQL cannot distinguish an AI agent as a distinct actor. Here's how that impacts access control, and what DBAs can do about it.