<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/0zasgoelm" -->

---
title: We Gave an AI Agent a read_only Neon Role. Here Is What...
description: A Neon read_only role blocks every write when accessed directly, but nine probes out of 40 still left a trace. Through a direct connection, the role still let...
canonical: https://daily.dev/posts/0zasgoelm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: We Gave an AI Agent a read_only Neon Role. Here Is What It Blocked | daily.dev
og:description: A Neon read_only role blocks every write when accessed directly, but nine probes out of 40 still left a trace. Through a direct connection, the role still let...
og:url: https://daily.dev/posts/0zasgoelm
og:image: https://api.daily.dev/og/posts/0zaSGoElm.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# We Gave an AI Agent a read_only Neon Role. Here Is What It Blocked

**[DevOps Daily](https://daily.dev/sources/devopsdaily)** · [@bobbyiliev](https://daily.dev/bobbyiliev) · 28 upvotes · 4 comments

## Summary

A Neon read_only role blocks every write when accessed directly, but nine probes out of 40 still left a trace. Through a direct connection, the role still let two rows get written via a SECURITY DEFINER function, created a large object, and stored a setting on the role itself. The hosted Neon MCP Server with readonly=true and a pinned role blocked all four durable writes. The bigger risk wasn't writes: a 15-second agent read held a routine ALTER TABLE for 11.3 to 12.8 seconds, stalling the app's writers, while running the same read on a replica cut it to 0.14 to 0.16 seconds.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://devops-daily.com/posts/neon-read-only-role-agent-probes>

## Community discussion

Top comments from developers on daily.dev.

**@webkmsyed** · 3 upvotes

> Useful real-world test. “Read-only” is never as simple as it sounds once SECURITY DEFINER functions and role-level settings enter the picture. The locking impact of long reads is an especially easy thing to miss until it hits production traffic.
>
> Running heavy agent reads against a replica feels like the practical takeaway here.

**@ristotoldsep** · 1 upvotes

> The read_only role finding a write path through SECURITY DEFINER is nightmare fuel. Great test.

## Similar posts on daily.dev

- [I Gave My AI Read-Only Access to the Warehouse. Here’s Why “Please Don’t Delete Anything” Isn’t Security.](https://daily.dev/posts/i-gave-my-ai-read-only-access-to-the-warehouse-here-s-why-please-don-t-delete-anything-isn-t-secu-oroaao2e6) · Medium · 0 upvotes · 0 comments
- [AI agent backup protection for enterprise data](https://daily.dev/posts/ai-agent-backup-protection-for-enterprise-data-ains6awd1) · Snowflake · 0 upvotes · 0 comments
- [Claude on SQL Server: Read, Prove, Then Change](https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej) · SQL Authority · 0 upvotes · 0 comments
- [Give Your Agent Write Access](https://daily.dev/posts/give-your-agent-write-access-wxmvt2mis) · MotherDuck · 3 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#postgresql](https://daily.dev/tags/postgresql), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/0zasgoelm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/0zasgoelm","headline":"We Gave an AI Agent a read_only Neon Role. Here Is What It Blocked","text":"Shared: We Gave an AI Agent a read_only Neon Role. Here Is What It Blocked","url":"https://daily.dev/posts/0zasgoelm","datePublished":"2026-11-11T12:34:38.120Z","dateModified":"2026-11-11T12:35:59.776Z","author":{"@type":"Person","name":"Bobby Iliev","url":"https://daily.dev/bobbyiliev","image":"https://avatars3.githubusercontent.com/u/21223421?v=4","description":"DevOps, DevEx, cloud \u0026 open source\n","worksFor":{"@type":"Organization","name":"Materialize","logo":"https://res.cloudinary.com/daily-now/image/upload/s--4mL2CrlK--/f_auto/v1725263959/companies/materialize"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":103960}},"image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":28},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/nNMnIuN1S"},"comment":[{"@type":"Comment","text":"Useful real-world test. “Read-only” is never as simple as it sounds once SECURITY DEFINER functions and role-level settings enter the picture. The locking impact of long reads is an especially easy thing to miss until it hits production traffic.\nRunning heavy agent reads against a replica feels like the practical takeaway here.","datePublished":"2026-11-15T13:34:56.251Z","url":"https://daily.dev/posts/0zaSGoElm#c-SppQTa7SS","author":{"@type":"Person","name":"Khishamuddin Syed","url":"https://daily.dev/webkmsyed","image":"https://media.daily.dev/image/upload/s--xXLX9Wi9--/f_auto/v1777551874/avatars/avatar_VqsDuiiXz6AnTS1eKLMWz?_a=BAMAMiWQ0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"The read_only role finding a write path through SECURITY DEFINER is nightmare fuel. Great test.","datePublished":"2026-11-16T09:26:43.895Z","url":"https://daily.dev/posts/0zaSGoElm#c-S763J3tMU","author":{"@type":"Person","name":"Risto Tõldsep","url":"https://daily.dev/ristotoldsep","image":"https://media.daily.dev/image/upload/s--i6RRoxB7--/f_auto,pg_1/v1794383659/avatars/avatar_ryDlbifZ1EuRuh3g51ryC?_a=BAMAMiiw0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/devopsdaily","name":"DevOps Daily"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DevOps Daily","item":"https://daily.dev/squads/devopsdaily"},{"@type":"ListItem","position":3,"name":"We Gave an AI Agent a read_only Neon Role. Here Is What It Blocked"}]}
```

