How to Configure Goose Neon Credentials
You set up goose neon credentials by making a database role and giving it to the agent. You store the login string in your local settings so the tool can run queries. Most teams start by handing the agent a default owner key to move fast. That broad role lets the agent read sensitive rows or drop tables by mistake. A safer path uses tight database roles and clear rules for every single session. How to set up goose neon credentials with native roles Neon runs on Postgres and uses standard data
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.
You set up goose neon credentials by making a database role and giving it to the agent. You store the login string in your local settings so the tool can run queries. Most teams start by handing the agent a default owner key to move fast. That broad role lets the agent read sensitive rows or drop tables by mistake. A safer path uses tight database roles and clear rules for every single session.
How to set up goose neon credentials with native roles
Neon runs on Postgres and uses standard database roles to control who logs in. When you create a project, the platform makes a default owner role with full power. You should not use that main owner key for your local AI agent. Instead, make a new Postgres role inside your database branch just for the agent.
Grant this new role read access only to the specific tables it needs to check. If the agent must write data, limit those write rights to safe schemas. Next, copy the login string for that specific role from your cloud dashboard. You then place that string into the local variable store that your agent reads. When the agent starts up, it reads the secret and opens a session to Postgres. Using branch roles also helps you test agent actions away from live user data. You can create a fresh database branch for a task and delete it later.
Why static database roles leave runtime gaps
Native Postgres roles do a great job of deciding who can log into the database. They also block an agent from touching tables outside its assigned schema list. Still, static credentials sit on developer laptops in plain text files or local stores. Anyone or any process on that machine can read the file and reuse the key. Rotating those keys across a big team takes hours of manual work.
More importantly, database roles cannot inspect what an individual query does in flight. Once the agent logs in, the database trusts every command that fits the role permissions. If a role can read a user table, it can pull every email and phone number. Native roles cannot rewrite matched fields like card numbers or national IDs in query results. They also cannot pause a risky delete statement and ask a human for approval first. Standard database logs also tie actions to the shared role name, not the human user.
Ephemeral Credentials + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Scoping permissions for local AI agents
Teams need a way to link every agent query back to a real person. You should separate the identity of the engineer from the underlying database login key. Start by removing long-lived passwords from local config files and shell scripts. Review which tables hold private data like emails, phone numbers, and card numbers.
Keep those tables off limits to standard agent roles whenever you can. Set strict statement timeouts on the agent role so bad queries do not lock tables. Limit how many concurrent sessions the agent role can open at the same time. Combine branch isolation with strict role rules to keep your main database safe.
Add query and result controls beside Postgres
Grants and pools govern who logs into PostgreSQL. Yet every query in an open session still runs with that role's full scope. In practice, hoop.dev runs beside your database as a sidecar for your Postgres. It reads plain and prepared queries on the wire with no change to your users or drivers.
When a tool or agent sends SQL, hoop.dev Postgres controls check each statement against your deny rules. An AI Analyzer you configure can also score intent or hold a risky query for human review. Matched sensitive columns in result rows are masked in memory before they reach the caller. Each query and decision is logged per listener, which generates evidence for SOC 2, HIPAA, and GDPR audits. View the binary on GitHub.
Frequently asked questions
Should I give my AI agent the default database owner role?
No, the default owner role can drop tables and read every row in your project by default. Always create a separate Postgres role with read rights on only the needed tables.
How do database branches help secure agent workflows?
Branches give the agent an isolated copy of your schema and data for testing. If the agent runs a bad write query, your main production branch stays safe.
What data risks remain after setting up least-privilege roles?
A read role still returns full rows from any table it has permission to query. Without field masking, query results will include raw emails, phone numbers, and card numbers.
Related guides
In this post