Skip to main content
Glama

scan_site_for_exposed_key

Scan a deployed Supabase site for an exposed service_role key and check for downloadable .env, served .git, or public source maps before attackers can bypass RLS.

Instructions

Scan a DEPLOYED website's HTML, JavaScript bundles and source maps for an exposed Supabase service_role key (a service_role JWT or an sb_secret_... key), and check whether /.env is downloadable (fail), /.git/ is served (fail) or source maps are public (warn). Needs only the public URL: no database, no credentials. A found service key bypasses ALL Row Level Security, giving anyone full read/write to the database. Also reports whether the public anon/publishable key is present, which means RLS is the only lock (follow up with audit_supabase_rls). Use right after deploying a Supabase app. Never prints a key or an .env value. Does not touch the database; for that, use audit_supabase_rls.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site_url": "<site_url>"
    },
    "name": "scan_site_for_exposed_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
site_urlYesPublic https URL of the deployed site to scan (e.g. https://myapp.com). Only public http(s) hosts are allowed.
max_scriptsNoHow many JS bundles to read (default 50). If the site has more, the result says how many went unscanned instead of implying it looked at all.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it states no credentials/database are needed, that the scan is non-mutating toward the database, that keys and .env values are never printed, and it grades outcomes (fail for /.env and /.git/, warn for public source maps). It also explains the severity implication — a service_role key bypasses all RLS — and warns about partial coverage when max_scripts is exceeded.

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

Conciseness4/5

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

Dense but front-loaded: the scan target and the finding types come first, then prerequisites, then severity, then the sibling boundary. All sentences carry information, though the description runs long and the anon-key/follow-up clause could be tightened.

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 two-parameter, annotation-free tool with no output schema, the definition covers inputs, safety posture, finding semantics, and next steps well. It stops short of describing the shape of the returned report (per-check statuses, unscanned-bundle counts), which the agent must infer.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description still adds meaning by emphasizing that only the public URL is required and no database or credentials are involved, which explains why no auth parameter exists. It does not add format or value detail for site_url or max_scripts beyond the schema.

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 and target ('Scan a DEPLOYED website's HTML, JavaScript bundles and source maps for an exposed Supabase service_role key') and enumerates exactly what is checked (/.env, /.git/, public source maps). It is clearly distinguishable from audit_supabase_rls, which it names as the database-side counterpart.

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

Usage Guidelines5/5

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

Explicit timing is given ('Use right after deploying a Supabase app'), and the boundary is drawn against the alternative ('Does not touch the database; for that, use audit_supabase_rls'), plus a follow-up route when only the anon key is present ('follow up with audit_supabase_rls'). The agent knows both when to call it and when to call something else.

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