Comparison

Built-in read roles are broader than they look.

Every database ships a quick way to make a reader. Each one reads more than intended, keeps reading as the schema grows, and never switches itself off. Here is exactly how, per database.

  • 9 databases
  • Runs entirely in your browser
  • No sign-up, no tracking, no network requests
  • Free and open source
Built-in shortcutWhat it really allowsWhat a ROUA does instead
PostgreSQL pg_read_all_dataEvery table and view in every schema, including tables created later and every secret column. Columns cannot be excluded.SELECT per table, or per visible column, as tables exist today. Secret columns hidden.
PostgreSQL GRANT SELECT ON ALL TABLES + default privilegesDefault privileges make future tables readable automatically. Inherited roles, owned objects and SECURITY DEFINER functions are not checked.No default privileges. The audit follows every role the account can reach and every object it owns.
MySQL / MariaDB GRANT SELECT ON db.*Every current and future table in the database, every column.Per-table and per-column grants computed when setup runs; nothing database-wide.
SQL Server db_datareaderEvery table and view, now and later, every column. Nothing stops another role membership from adding writes.Per-object SELECT, secret columns left out, and DENY on every write and DDL permission, which wins over any role added later.
Oracle SELECT ANY TABLE / READ ANY TABLEEvery schema, now and later. SELECT also allows LOCK TABLE and SELECT … FOR UPDATE.READ per table (no locks), never ANY privileges.
MongoDB read / readAnyDatabaseEvery collection in the database (or every database), including future ones.A custom role with find on named collections only.
Redis +@read ~*Every key, plus KEYS, which can stall the server.Read commands on chosen key patterns only, no dangerous, admin, scripting or pub/sub commands.
Snowflake FUTURE grantsNew tables become readable automatically; new users default to all secondary roles.Point-in-time grants and DEFAULT_SECONDARY_ROLES = ().
BigQuery project-level dataViewerEvery dataset in the project, now and later, through a key file that never expires.Table-level grants and query rights that end through an IAM condition.

What no built-in role gives you

  • An owner and a purpose, recorded on the account itself.
  • An expiry that the database (or a scheduled job) enforces.
  • One-step revoke that also ends open sessions.
  • Proof: an audit with stable check IDs you can run in CI, before handover and on a schedule.

Audit the read-only account you already have

Most “read-only” accounts aren’t.

Hidden write paths

A role it inherits, a table it owns, a procedure it can run, a default grant: any one of them turns “read-only” into read-write.

Secrets in plain sight

Password hashes, API tokens, card numbers and MFA seeds sit in ordinary columns that a plain SELECT can read.

Never switched off

The demo ends, the contractor leaves, the agent is retired. The account stays, and forgotten accounts are where breaches start.

What every ROUA guarantees, on every database

  1. No write path of any kind. No writes, no schema changes, no procedures, no ownership, no roles that could add them.
  2. Never reads secrets. Secret-looking columns are hidden automatically; you add anything the detector misses.
  3. An owner and an expiry. Every account names who is accountable and switches itself off on a date.
  4. Instant revoke. One script locks the account and ends its open sessions.
  5. Checked before handover. An audit script proves all of the above. Run it any time, on any account.

Create a read-only account

Pick your database, describe the account, and download the scripts. Your password never leaves this page.

1. Choose your database

2. Describe the account

Account

Database
Your schema (optional, recommended)

Not sure what your tables are called, or want to be certain nothing is missed? Run this read-only script, paste its output, and pick tables from a list. You will see exactly what the account can read before you generate anything. Nothing leaves this page.

1. Get the discovery script

          

Scope

Limits and network
Sign-in

Your scripts appear here.

You get a setup script, an audit script that proves the account is read-only, a revoke script, and a clean-up script.

Check an account you already have

Is your “readonly” user actually read-only? Get an audit script for any existing account. It only reads, so it is safe to run on production.

Account to check

Choose a database and an account name, then Get the audit script.

It checks for write privileges, inherited roles, ownership, secret columns, missing expiry and more, with one PASS, WARN or FAIL line per check.

Supported databases

Full: complete toolkit with the roua CLI, masking and live verification. Tested: every change runs the generated scripts against the real engine in CI, logs in as the account and proves writes fail. Preview: built from the vendor’s documentation and not yet run against a live service; review before use, and tell us what breaks.

DatabaseSupportVersionsLevelsHow ROUA works thereAlso covers
PostgreSQL
Full13 to 17L0–L5Full ROUA: levels L0 to L5 with masking, CLI apply, audit and live verify.Amazon RDS and Aurora, Google Cloud SQL and AlloyDB, Azure Database, Supabase, Neon, Crunchy, Timescale
MySQL
Tested in CI8.0, 8.4, 9L1, L2Per-table and per-column SELECT computed at setup, caching_sha2 verifier, locked by a scheduled event at expiry.Amazon RDS and Aurora MySQL, Google Cloud SQL, Azure Database for MySQL, Percona Server
MariaDB
Tested in CI10.6, 10.11, 11.4L1, L2Per-table and per-column SELECT computed at setup, password hash only, locked by a scheduled event at expiry.Amazon RDS for MariaDB, SkySQL
SQL Server
Tested in CI2022 (tested), 2017+, Azure SQLL0, L1, L2Login with a hashed password, per-object SELECT, column DENY for secrets, database-wide DENY on every write.Azure SQL Database and Managed Instance, Amazon RDS for SQL Server
Oracle Database
Tested in CI23ai (tested), 19cL1, L2READ (not SELECT, so no row locks) per table, a dedicated profile, and a scheduler job that locks the account at expiry.Oracle Autonomous Database, Amazon RDS for Oracle, Exadata
MongoDB
Tested in CI6.0, 7.0, 8.0L0, L1, L2A custom role with find on chosen collections only (no readAnyDatabase), SCRAM-SHA-256 and optional client IP restriction.MongoDB Atlas (use the Atlas notes), Percona Server for MongoDB
Redis
Tested in CI7.2, 7.4, Valkey 8L1, L2An ACL user limited to read commands on your key patterns, no dangerous or admin commands, no pub/sub, hashed password.Valkey, Amazon ElastiCache and MemoryDB (RBAC), Azure Cache for Redis, Redis Cloud
Snowflake
PreviewcurrentL0, L1, L2A dedicated role with point-in-time SELECT (no future grants), key-pair login, no secondary roles, and DAYS_TO_EXPIRY.
Google BigQuery
PreviewcurrentL0, L1, L2A service account with table-level Data Viewer, and query rights that expire through an IAM condition.

Giving an AI agent database access

Three steps

  1. Create a ROUA above with the AI agent profile. Leave out tables the agent has no business seeing.
  2. Put its connection string in the agent’s environment or MCP server configuration, never in a prompt or a repository.
  3. Let the agent explore, query and explain. If it tries to change anything, the database refuses.
{
  "mcpServers": {
    "database": {
      "command": "your-database-mcp-server",
      "env": { "DATABASE_URL": "postgres://roua_agent_docs:@db.internal/appdb" }
    }
  }
}

Know the limits

  • Read-only is not “nothing leaves”. Anything the account can read, the agent can repeat. Scope it to what the agent should know.
  • Expensive queries are still possible. Use the connection and time limits, and a small warehouse on cloud warehouses.
  • Applications need their own guard. For demo and app-review accounts that click through your app, pair ROUA with ROUA-App, which blocks writes at the API.

Who uses read-only accounts

AI agents

Text-to-SQL, coding agents and MCP servers that learn your schema and answer questions.

App review

Store and marketplace reviewers who must try every feature without touching real data.

Demos and training

Sales demos and workshops on synthetic data, with accounts that expire after the event.

Auditors

Internal and external auditors who need to see, never to change, with masked personal data.

Vendor support

Short-lived access for a support session, revoked the moment it ends.

BI and analytics

Dashboards and analysts reading aggregates, with limits that keep costs predictable.

Profiles and levels

Profiles: why the account exists

ProfileMax lifetime
AI agent agent90 days
Demo demo30 days
App review review45 days
Auditor audit30 days
Support support7 days
Training training14 days
Analytics analytics180 days
Custom custom365 days

Levels: what it can see

LevelCan read
L0 MetadataStructure only: schemas, tables, columns, types. No rows.
L1 PublicOnly objects you list as public (catalogs, reference tables).
L2 OperationalBusiness tables minus your deny-list and all secret columns.
L3 AnalyticalOnly aggregate views you list. No base tables.
L4 MaskedAll in-scope tables through generated masked views. No base tables.
L5 Full (break-glass)All in-scope data unmasked, still never secrets. Max 24 hours, two approvers.

All levels are available on PostgreSQL. SQL Server, MongoDB, Snowflake and BigQuery also offer L0; the other databases offer L1 (only what you list) and L2 (everything in scope minus exclusions and secrets). See the Levels column above.

Questions

Is it safe to type a password into this page?

Yes. The page is a single file that runs entirely in your browser. Its security policy forbids every network request, so nothing you type can be sent anywhere. You can save the page and use it offline. Where the database accepts it, the scripts contain only a password hash (PostgreSQL, MySQL, MariaDB, SQL Server, Redis), never the password.

Why not just use GRANT SELECT ON *.*, db_datareader or a built-in read role?

Built-in read roles cover every table, including tables created next year, and they include tables full of secrets. They also leave whatever else the account inherited untouched. ROUA starts from nothing, grants read per table as it exists today, hides secret columns, denies writes explicitly where the database supports it, and adds an expiry.

What if my database doesn't have the tables or columns I expect, or changes later?

The scripts look at your real database when they run, not when they are generated. Under "Your schema", paste the output of the read-only discovery script to pick tables from a list and preview exactly what the account will read. The preview flags missing schemas, misspelled table names and hidden-column entries that match nothing, and blocks scopes that would read nothing. Setup checks again on the server: it refuses an empty scope and reports names that do not exist. Tables created later stay closed. On PostgreSQL, MySQL, MariaDB and SQL Server, grants are per column, so a column added later (even a secret one) stays hidden until you run setup again. On other databases, the audit catches secret-looking columns that became readable.

What happens when the account expires?

PostgreSQL: the password stops working (VALID UNTIL), and roua expire ends open sessions. MySQL and MariaDB: a scheduled event locks the account and ends its sessions. SQL Server: an Agent job disables the login. Oracle: a scheduler job locks the account. Snowflake: DAYS_TO_EXPIRY. BigQuery: query rights end through an IAM condition. MongoDB and Redis have no scheduler, so you schedule the revoke script; the audit flags it if you forget.

Does it work with managed databases?

Yes, as long as you have an administrator account: Amazon RDS and Aurora, Google Cloud SQL and AlloyDB, Azure SQL and Azure Database, Supabase, Neon, Oracle Autonomous Database and others. Each database in the table above lists the services it covers. Some checks that need superuser (such as reading pg_hba.conf) report a warning instead.

Does read-only stop data from leaving?

No, and nothing that can read can promise that. Read-only means the account cannot change or destroy anything. Decide what it may see with the scope, the exclusions and, on PostgreSQL, masking.

Can I use this in automation?

Yes. On PostgreSQL, the roua CLI plans, applies, verifies and revokes accounts from a roua.yaml file (npx @roua-dev/cli audit --role readonly), also as a Docker image (ghcr.io/promisegithub/roua). The GitHub Action fails a build when an account stops being read-only. AI agents can use the ROUA MCP server. For other databases, the generated scripts are plain files you can keep in version control and run in a pipeline.

Who is behind ROUA?

The term ROUA (Read-Only User Account) was coined by Promise Okoroji. ROUA is an open standard (draft 0.1) with Apache-2.0 tools. Reviews of the spec, bug reports and attempts to break the audit are very welcome on GitHub.