Skip to content
mentoor

Database access for AI agents

For engineers

Letting coding agents, MCP servers and text-to-SQL features touch databases with scoped roles, limits, branches, audit logs and a way back

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

A text-to-SQL feature only needs to answer sales questions. Which setup is safest?

Choose one answer

Check yourself · 2 of 5

What is the main purpose of running an agent's schema change on a database branch first?

Choose one answer

Check yourself · 3 of 5

Why can a row returned by a database MCP server be a security risk?

Choose one answer

Check yourself · 4 of 5

Which statement should always need a person's approval from an agent?

Choose one answer

Check yourself · 5 of 5

Which set of facts makes an agent query log most useful for review?

Choose one answer

Topics

  1. Scoped database roles for agents5 min read · A dedicated role per agent or feature with read-only grants, row-level security, statement_timeout and row limits instead of the app's owner login
  2. Branch and scratch databases for agent work5 min read · Running agent migrations and experiments on a database branch, a restored copy or a local container before anything reaches production
  3. Connecting database MCP servers safely5 min read · What Postgres, Supabase and similar MCP servers expose, read-only modes, project scoping, and why query results can carry prompt injection
  4. Stopping destructive agent database commands5 min read · DROP, TRUNCATE and unscoped DELETE from agents, approval gates, and confirming backups and point-in-time recovery before granting write access
  5. Auditing the queries agents run5 min read · Logging every agent statement with its role, task and session, using query logs or pgaudit, and reviewing them for reads of sensitive columns

Start here

110 questions · last verified 2026-12