According to the Reddit community, AI agents can infer sensitive data even when database rules block direct row queries. In one account, aggregate queries were allowed without human approval, but ordinary SQL queries could still cross that boundary.
The examples are MAX(amount) or MIN(amount), each of which returns an actual stored payment value. SUM(amount) grouped by customer_id produces a total for each customer and can also reveal sensitive information individually. The post says the rule checked which aggregate function was used, not how many records contributed to each result. The agent was not deliberately evading safeguards; it generated ordinary queries for the questions it had been asked.
According to the post, MIN and MAX are now treated like row reads and require approval. Grouping remains unresolved: restricting GROUP BY on identifier columns could miss fields such as email addresses or timestamps. A minimum group size, in the style of k-anonymity, could catch more cases but change results; overlapping queries could still allow inferences.
A community reply points to pg_diffix as a potentially relevant approach. The commenter sees noisy results as a possible default when an agent explores data, but questions whether finance teams would accept imprecise revenue figures. The Reddit post directs readers to a comment for the fuller investigation.