How to Configure Make Postgres Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a make postgres sandbox by creating a limited database role for your workflows. Next, you restrict that role to specific schemas and columns before linking the automation tool. Many teams start by reusing a shared admin account to test scenarios quickly. That shortcut gives every automated task full read and write power over the whole database. If a scenario fails or loops, broad permissions can corrupt tables or expose private rows. How to set up a make postgres sandbox with native

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 a make postgres sandbox by creating a limited database role for your workflows. Next, you restrict that role to specific schemas and columns before linking the automation tool. Many teams start by reusing a shared admin account to test scenarios quickly. That shortcut gives every automated task full read and write power over the whole database. If a scenario fails or loops, broad permissions can corrupt tables or expose private rows.

How to set up a make postgres sandbox with native roles

A safe setup starts inside the database with role design. You can set up group roles to manage permissions when you have many users or apps. Then you grant the automation account membership in that group role. This keeps permission changes simple as your team adds new test workflows.

Next, you lock down what every role inherits by default. The special role name PUBLIC gives rights to every role on the system. By default, PUBLIC gets rights to connect and make temporary tables on databases. It also gets rights to run functions and procedures. The object owner can revoke these defaults to tighten the test database.

Schema rules also matter when you build a test space. In PostgreSQL 15 and later, the default setup stops every user from creating objects in the public schema. Older databases, or ones upgraded from earlier versions, still allow this behavior. In those cases, an admin must revoke create rights on the public schema from PUBLIC. Instead, give the automation role its own dedicated schema for test writes.

Finally, limit read rights on reference tables. The select privilege allows reads from a whole table, view, or materialized view. You can also grant select on specific columns of a table. Note that the select privilege also allows copying data out. By granting select only on safe columns, you avoid exposing columns with emails or phone numbers.

What native database roles solve and what they leave open

Native roles and schema grants do a great job at the login step. They decide which user can log in and which tables that user can touch. Column grants also stop a workflow from reading unapproved columns on a table. For basic testing, these built-in database controls form a strong base.

AI Sandbox Environments + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static grants cannot inspect what individual statements do in flight. Once the automation tool logs in, the database trusts every valid query from that role. If a table holds mixed data, column grants may not be enough. A workflow that needs a table might still pull raw emails, card numbers, or national IDs. Also, shared static keys stored in third-party workflow tools are hard to rotate. If a developer copies a test scenario into a shared workspace, the database credentials often travel with it. Native roles also lack a clear way to require human approval before a destructive query runs.

Keeping test data safe during workflow runs

Teams also need to think about the data living inside the test database. Many teams build a test database by restoring a snapshot of production. That snapshot holds real customer emails, phone numbers, and card numbers. Even if you restrict the automation role to a few tables, those tables still hold live data.

To reduce risk, teams pair strict role grants with runtime controls. Instead of handing out long-lived database keys, teams check each query as it runs. Dynamic data masking rewrites matched fields like emails or phone numbers in query results. This lets the Make scenario test its logic on realistic shapes without pulling raw sensitive values. Teams also log every statement from the workflow tool with the identity of the builder. That way, you always know which scenario ran a query and when it happened.

Check every Postgres query on the wire

Database roles and network rules decide who can open a session. They do not read what each SQL statement does after login. With hoop.dev, you run an open-source proxy, a sidecar for your Postgres. It runs beside your database and reads the Postgres wire protocol. Your apps and agents keep their login details and change only the host and port in the connection string their tool uses.

Before a query runs, hoop.dev guardrails check the statement by its effect, table, or pattern. They refuse bad deletes or drops with a real Postgres error. On the way back, hoop.dev data masking rewrites sensitive values in returned rows based on your rules. Every query and verdict goes to the audit trail. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and generates evidence for HIPAA, GDPR, and PCI DSS. See the code on GitHub.

Frequently asked questions

Why should I revoke default PUBLIC privileges in a test database?

The PUBLIC role grants connect, temporary table, and function execution rights to every role by default. Revoking these defaults stops your automation role from running unapproved functions or filling disk space with temporary tables.

Can I restrict my workflow role to read only specific columns?

Yes, PostgreSQL lets you grant the select privilege on specific columns of a table or view. This stops the workflow role from querying other columns that might hold private user details.

How do I stop an automation role from creating tables in the public schema?

PostgreSQL 15 and newer block this by default, while older or upgraded databases still allow it. On older setups, an admin must revoke create permissions on the public schema from the PUBLIC role.

The query runs. The emails stay hidden.