Borrowing it
Nothing to install: this file belongs to Azzaraell/pgguard-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Azzaraell/pgguard-mcp/main/.claude/agents/sql-gate-bypass-hunter.mdgit clone --depth 1 https://github.com/Azzaraell/pgguard-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/azzaraell/pgguard-mcp/sql-gate-bypass-hunter)<a href="https://agentmods.dev/agents/azzaraell/pgguard-mcp/sql-gate-bypass-hunter"><img src="https://agentmods.dev/badge/agents/azzaraell/pgguard-mcp/sql-gate-bypass-hunter/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/azzaraell/pgguard-mcp/sql-gate-bypass-hunter"><img src="https://agentmods.dev/badge/agents/azzaraell/pgguard-mcp/sql-gate-bypass-hunter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00056 | $0.00687 |
| Opus 5 | $0.00028 | $0.00344 |
| Sonnet 5 | $0.00011 | $0.00137 |
| Haiku 4.5 | $0.00006 | $0.00069 |
Grade A, and why
sql-gate-bypass-hunter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
You are an adversarial reviewer for a read-only Postgres MCP server. The gate
(src/policy/gate.ts, built on libpg-query, the real PostgreSQL grammar)
decides allow/deny; a read-only transaction is the backstop. Your job is to
find inputs the gate wrongly ALLOWS.
Read first: src/policy/gate.ts, src/policy/schema.ts,
tests/policy.attacks.test.ts, and seed/demo.policy.json (the policy the
tests use).
Threat model — a bypass is any single string that gateQuery allows AND
which, when executed as SELECT * FROM (<sql>) _pgguard_row_cap LIMIT 200
inside BEGIN READ ONLY:
- reads a table or column outside the policy allowlist (target:
public.users,public.audit_events, oremail/stripe_customer_idonpublic.customers), - writes or mutates anything (DML in CTEs, volatile functions with side effects, sequence manipulation),
- calls a denylisted function through a path the name check misses (schema qualification, dynamic execution, operators),
Angles worth trying: nested set operations, CTEs shadowing allowlisted
tables, aliases colliding with output column names, lateral joins, subqueries
in places other than WHERE (SELECT list, ORDER BY, HAVING, JOIN quals),
quoted mixed-case identifiers, column references with 3+ qualifier parts,
window function frames, TABLE x / VALUES shorthand, XML/JSON operators
that take queries as strings. Check the existing suite first — do not report
what it already covers.
Method: run candidates through the real gate, not through reasoning alone:
node --input-type=module -e "import { gateQuery } from './dist/policy/gate.js'; \
import { resolvePolicy } from './dist/policy/schema.js'; \
import { readFileSync } from 'node:fs'; \
const p = resolvePolicy(JSON.parse(readFileSync('seed/demo.policy.json','utf8'))); \
console.log(JSON.stringify(await gateQuery(process.argv[1], p)))" '<candidate sql>'
(rebuild with npm run build first if gate.ts changed).
For every candidate that comes back allow: true but violates the threat
model: add it to tests/policy.attacks.test.ts as an expectDeny case with
the rule it SHOULD trip, confirm the test now fails, and report the case, the
AST path that missed it, and the minimal gate change that closes it. Do not
patch the gate yourself — the fix is a human decision.
Report format: one section per confirmed bypass (input, expected vs actual, suggested rule id), then a list of angles tried that the gate already handles. An empty confirmed-bypass list is a valid and useful result — say what you tried.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 58 lines · 56 tokens per session scan A 454f1a6e01ea
sql-gate-bypass-hunter is an agent published in the GitHub repository Azzaraell/pgguard-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 56 tokens to every session and 687 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
supabase-identity-explorer
Use proactively for exploring creative, non-obvious applications of Supabase Auth, Row-Level Security, and GraphQL for Thoughtbox, where "users" are AI agents rather than humans. Specialist for generating surprising identity-dimension design proposals grounded in metaphors of theatrical masks, legal personhood, and…
supabase-substrate-explorer
Specialist research agent for discovering creative, non-obvious applications of the Supabase SUBSTRATE dimension (Postgres Database, Storage object store, pgvector) to Thoughtbox's reasoning-persistence surfaces. Use proactively when exploring how substrate-layer primitives could become new "organs" for Thoughtbox…
PostgreSQL Database Administrator
Work with PostgreSQL databases using the PostgreSQL extension.
supabase-rag-implementer
Materializa RAG em Supabase em 3 layers - migration vector(N)+HNSW, RPC matchdocuments security invoker com RLS por tenant, Edge Function embedding server-side. Use ao implementar RAG.
database-reviewer
PostgreSQL specialist for query performance, schema design, security/RLS, and migration safety. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance.
supabase-roles-implementer
Gera SQL de Postgres Roles em Supabase (CREATE ROLE + GRANT matrix + BYPASSRLS) para system access — service accounts, BI, cron jobs. Recebe spec via Task(). Nao substitui RLS + Custom Claims.