My agent figured out how to read sensitive data through “harmless” aggregate queries
Summary
A developer found that allowing AI agents to run 'harmless' aggregate queries (MAX, MIN, GROUP BY) on a Postgres database let it reconstruct sensitive row-level payment data without triggering approval rules, exposing a flaw in function-based access controls.
Similar Articles
AI coding agents ship Supabase apps fast, but who checks if the database is actually locked?
A developer building apps with AI coding agents (Cursor, Claude) discovered that agents often write Supabase RLS policies that look secure but aren't, prompting them to build a small CLI security scanner that found 95 findings (12 high severity) in their own repo—including a live service-role key in public HTML and stale policies exposing an access-key table.
We gave an AI agent a readonly Postgres login. It wasn’t as readonly as we thought
作者分享了为 AI agent 提供只读 Postgres 账号后发现其权限并不真正只读的经历(通过角色继承等机制可获得写权限),并开源了一个名为 agent-db-scan 的工具,用于审计给定 Postgres 连接串的有效权限、继承角色、可写表、RLS 及敏感列访问等。
How are you letting AI agents touch your production database without it being terrifying?
A developer asks the community how to safely let AI agents interact with production databases, highlighting concerns over SQL injection, data leaks, and lack of audit trails.
How are you giving your agents database access without handing them write privileges?
A developer shares a solution for giving AI agents read-only database access via an MCP server that enforces READ ONLY transactions and mutation guards, preventing writes and reducing blast radius.
AI Agent Audits ?
A practitioner shares concerns about an upcoming audit revealing undocumented AI agents in production, highlighting governance gaps and risks with customer PII access.