How to Configure Amazon Q Neon Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up amazon q neon read only access, create a Postgres role with select rights. Then give that database string to the local tool that your coding agent runs. Many engineering teams start by sharing a default project owner role with their local tools. That broad role lets an automated assistant change tables or drop data by mistake. Scoping the database role down to read rights stops write queries at the database level. How amazon q neon read only access works in practice Amazon Q Develop

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To set up amazon q neon read only access, create a Postgres role with select rights. Then give that database string to the local tool that your coding agent runs. Many engineering teams start by sharing a default project owner role with their local tools. That broad role lets an automated assistant change tables or drop data by mistake. Scoping the database role down to read rights stops write queries at the database level.

How amazon q neon read only access works in practice

Amazon Q Developer runs on a developer machine inside the editor or command line. The agent can run local shell commands or call external tools to inspect data. When the agent needs database context, it uses the local database string to log in. Neon runs serverless Postgres and supports standard Postgres roles and permissions for every branch. You can set up a dedicated Postgres role that only has permission to read tables.

First, an admin logs into the Neon database and creates a new user role. The admin grants usage on the target schema and select rights on the tables. You also set default privileges so future tables allow read queries from this role. Next, you place those new role credentials into the local shell where the agent runs. When Amazon Q runs a query tool, Postgres checks the role and blocks any writes.

Neon also offers read compute endpoints that point to the same underlying storage branch. Pointing a read role at a read compute endpoint separates agent traffic from main apps. Even on a read compute node, a scoped Postgres role keeps table permissions strict. You can limit which schemas the role can read while blocking secret system tables.

What native roles solve and what they leave open

Native Postgres roles and Neon read endpoints are a strong first step for safety. They stop an AI coding agent from deleting rows, altering schemas, or corrupting tables. If the agent writes a bad update statement, the database rejects the command right away. This setup is simple to build using built-in Postgres permissions that teams already know.

Still, a database role only checks who logs in and which tables they can read. It does not check what individual queries do in flight or what data comes back. A read role still lets an agent pull every row from a customer table by default. If that table holds emails, phone numbers, or card numbers, those values enter the prompt. Native roles cannot rewrite matched fields in results before the coding agent processes them.

Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static database credentials on a laptop also create work for the security team. Developers store the database string in plain text files so local tools can read it. Every developer uses the same shared read role, so database logs show one generic user. You cannot tell which person or which agent session ran a heavy select query. When a laptop is lost, the team must rotate the shared password across every machine.

Managing live queries and sensitive fields

Safe agent workflows need controls that look at each query and its output in flight. Instead of granting full table reads, teams want to mask sensitive columns during the query. Rewriting matched fields in results keeps emails, phone numbers, and national IDs out of prompts. The coding agent still gets the table structure and sample rows it needs to work. Tying each query to an individual user identity also fixes the shared role audit problem. Teams can see who ran each query and block huge full-table scans before they run.

Run guardrails and masking on the Postgres connection

Role grants and firewall rules are needed setup. Setup alone cannot check single SQL statements or mask sensitive rows in a response. By design, hoop.dev is an open-source proxy that sits beside Postgres, RDS, or Aurora as a sidecar for your Postgres. Clients and agent tools keep their credentials and point their connection string at the listener.

On each query, hoop.dev guardrails refuse disallowed drops, deletes, or table reads before they run. Next, hoop.dev data masking rewrites sensitive fields in returned rows that match your rules. Furthermore, hoop.dev holds SOC 2 Type II and logs every statement and verdict per resource. Check out the project on GitHub.

Frequently asked questions

Can a Neon read role still expose sensitive customer data to Amazon Q?

Yes, a standard Postgres select grant returns all columns and rows in the allowed tables by default. If those tables store emails, phone numbers, or card numbers, the agent receives raw values. You must restrict specific columns or use data masking to rewrite matched fields in results.

How do Neon read compute endpoints differ from Postgres read roles?

A Neon read compute endpoint is a separate compute instance that rejects write operations. A Postgres read role is a user account with permissions limited to select statements. Using both together isolates agent compute load and restricts which schemas the agent can read.

Why are local database strings risky for AI coding agents?

Local tools read database strings from text files or shell variables on the user machine. Any script or agent command running in that shell can read and use those credentials. Shared static passwords also make it hard to trace queries back to one specific person.

The query runs. The emails stay hidden.