Skip to main content
Glama
larik15

supabase-security-mcp

by larik15

Audit RLS policies in Postgres

audit_policies

Audit database security policies to identify RLS disabled tables, permissive policies, PUBLIC access, and risky SECURITY DEFINER functions.

Instructions

Connects to the database (read-only queries on pg_class, pg_policies, pg_proc, information_schema) and flags: tables with RLS off but granted to anon/authenticated, policies with using(true) / with check(true), policies without a TO clause (apply to PUBLIC), and SECURITY DEFINER functions executable by anon/authenticated. Needs a Postgres connection string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseUrlNopostgres://... connection string (Supabase → Project Settings → Database). Or env DATABASE_URL

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The description discloses that the tool performs read-only queries on system catalogs, which is a significant behavioral trait. It also lists the exact security checks it performs. However, it does not describe the output format or any error handling, and since there are no annotations, it carries the full transparency burden. It is mostly transparent but lacks output details.

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?

The description is two sentences long, with the first sentence front-loading the core functionality and the list of checks. The second sentence states the prerequisite. Every word is purposeful, and there is no redundancy or fluff.

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?

The description covers the tool's purpose, the specific checks, and the connection requirement. However, it does not specify the format of the audit results (e.g., list, report, JSON) or any potential limitations (e.g., requires table-level permissions). Since there is no output schema, the description should address the return value, but it is still fairly complete for a read-only audit tool.

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?

The input schema already fully documents the databaseUrl parameter, including how to obtain it and the environment variable fallback. The description adds only a redundant statement about needing a connection string, providing no additional semantic value beyond the schema. Given 100% schema coverage, the baseline of 3 is appropriate.

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?

The description explicitly states the tool's purpose: auditing RLS policies in Postgres. It details the specific checks performed (RLS off but granted, using(true)/with check(true), missing TO clause, SECURITY DEFINER functions) and the read-only nature. This is a specific verb+resource and clearly distinguishes it from generic database tools.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus siblings like probe_anon or security_report. It does not mention alternative tools or conditions under which this audit is appropriate. The only hint is the prerequisite of a Postgres connection string, which is a requirement, not a usage guideline.

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