Skip to main content
Glama

audit_supabase_rls

Scan a Supabase/Postgres database's Row Level Security to fail on disabled RLS, permissive policies, tenant leaks, and exposed views using read-only catalog metadata.

Instructions

Audit a Supabase/Postgres database's Row Level Security. Fails when a table has RLS disabled, when a policy is permissive (USING (true) / WITH CHECK (true) or anything that reduces to always-true), when an anon or authenticated policy does not scope rows to the caller (tenant leak), and on exposed materialized views. Reads ONLY catalog metadata (pg_tables, pg_policies, grants, functions, views) — never your row data. A read-only connection string is enough.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allowNoPolicy names that are intentionally permissive (e.g. a public status page). Prefer the qualified form "table.policy".
db_urlYesPostgres connection string for the project to audit (e.g. postgresql://... — get it from `supabase status` locally or your project's connection settings). A read-only role is enough.
schemaNoSchema to audit (default: public).public

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and largely meets it: it discloses auth/permission needs (read-only role suffices), data-access scope ('reads ONLY catalog metadata... never your row data'), and the detection semantics. It does not describe the response shape or how findings are reported, which is a residual gap for a mutation-free but output-heavy tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four tight sentences ordered by importance: purpose, detection scope, data-access boundary, and permission requirement. Nothing is repeated from the title or schema and every sentence carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-param audit tool with no output schema, the description covers purpose, detection rules, data scope, and permissions well. The main omission is what the call actually returns (finding structure/severity/remediation), which with no output schema would have been helpful to state.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters (db_url, allow, schema) are already documented in the schema, including the qualified 'table.policy' convention for allow. The description adds no parameter-level detail beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (audit) and resource (Supabase/Postgres Row Level Security) and immediately enumerates the exact conditions it flags, so an agent knows precisely what a call returns semantically. The single sibling (scan_site_for_exposed_key) is a different domain, so no sibling disambiguation is needed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use context by defining the failure conditions the tool detects, plus the practical prerequisite that 'a read-only connection string is enough.' It stops short of explicit when-not or alternative routing, but for a single-purpose audit tool the usable context is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools