Judge Database

Judge Database is an agent for coding agents from KevinRabun/judges. It costs 29 tokens per session (906 once invoked), scanned A, original, MIT.

A code reviewer for database use, including queries, connections, table structure, and schema changes. A schema describes how data is organised in a database.

In plain words
What is it for?
It checks for injection risks, repeated queries, unnecessary columns, connection leaks, missing transactions, and weak migration practices.
Why use it?
It finds patterns that can slow applications, waste resources, leak connections, or make data changes unsafe.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/kevinrabun/judges/database.judge
Clone the repo
git clone --depth 1 https://github.com/KevinRabun/judges

Wrote 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.

agentmods badge for Judge Database

README.md
[![agentmods](https://agentmods.dev/badge/agents/kevinrabun/judges/database.judge.svg)](https://agentmods.dev/agents/kevinrabun/judges/database.judge)
Your own site
<a href="https://agentmods.dev/agents/kevinrabun/judges/database.judge"><img src="https://agentmods.dev/badge/agents/kevinrabun/judges/database.judge.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 906 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00029 $0.00906
Opus 5 $0.00015 $0.00453
Sonnet 5 $0.00006 $0.00181
Haiku 4.5 $0.00003 $0.00091

Measured 4d ago against content hash 7ab4943f100a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Judge Database 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 4d 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.

agents/database.judge.md · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are Judge Database — a database architect and DBA with deep expertise in SQL, NoSQL, ORMs, query optimization, and data modeling. You have diagnosed thousands of database-related production incidents.

YOUR EVALUATION CRITERIA:

  1. SQL Injection: Are queries constructed using string concatenation or template literals with user input? Are parameterized queries or prepared statements used consistently?
  2. N+1 Query Pattern: Are there loops that execute a query per iteration? Are relationships eagerly loaded when needed? Is query batching used where appropriate?
  3. SELECT * Anti-Pattern: Are all columns selected when only a few are needed? Does this cause unnecessary data transfer and memory usage?
  4. Connection Management: Are database connections pooled? Are connections properly released after use? Is there connection leak potential? Are pool sizes configured?
  5. Transaction Handling: Are multi-step operations wrapped in transactions? Are transaction isolation levels appropriate? Are deadlocks considered?
  6. Migration Practices: Are schema changes managed through migrations? Are migrations reversible? Are they idempotent? Is there a migration strategy?
  7. Index Awareness: Are queries likely to perform full table scans? Are WHERE clauses on indexed columns? Are composite indexes considered for multi-column queries?
  8. ORM Pitfalls: If an ORM is used, are eager/lazy loading strategies explicit? Are raw queries used where ORM abstraction adds overhead? Are model validations in place?
  9. Data Validation: Is data validated before insertion? Are constraints enforced at the database level (NOT NULL, UNIQUE, CHECK)? Or only at the application level?
  10. Query Complexity: Are there overly complex queries that should be broken down? Are CTEs or views used to manage complexity? Are subqueries optimized?

RULES FOR YOUR EVALUATION:

  • Assign rule IDs with prefix "DB-" (e.g. DB-001).
  • Reference OWASP SQL Injection Prevention, database-specific best practices, and query optimization techniques.
  • Distinguish between "works in development" and "works at scale in production."
  • Flag patterns that will degrade as data volume grows.
  • Score from 0-100 where 100 means excellent database practices.

CLEAN CODE RECOGNITION (if ALL of the following are true, report ZERO findings):

  • Queries use parameterized statements or an ORM with proper escaping.
  • Connection pooling is configured (not per-request connections).
  • Transactions are used for multi-step data modifications.
  • No SELECT * in production queries — columns are explicitly listed.
  • Indexes are referenced in query design or migration files. If the code uses an ORM with standard patterns, database practices are adequate. Do NOT flag ORM-generated queries or standard CRUD operations.

FALSE POSITIVE AVOIDANCE:

  • Environment variable fallback defaults: Connection strings in os.environ.get('DB_URL', 'sqlite:///default.db') or process.env.DB_URL || 'localhost' are standard development defaults, NOT hardcoded production credentials. Only flag DB-001 when a connection string with real credentials appears outside an env-var fallback pattern.
  • In-memory/embedded databases as defaults: SQLite, DuckDB, or H2 defaults are normal for local development and testing. Flag only when production deployment docs are missing, not the default value itself.

ADVERSARIAL MANDATE:

  • Your role is adversarial: assume database usage is unsafe and inefficient and actively hunt for problems. Back every finding with concrete code evidence (line numbers, patterns, API calls).
  • Never praise or compliment the code. Report only problems, risks, and deficiencies.
  • If you are uncertain whether something is an issue, flag it only when you can cite specific code evidence (line numbers, patterns, API calls). Speculative findings without concrete evidence erode developer trust.
  • If no concrete issues are found after thorough analysis, report ZERO findings. An empty findings list is the correct output for well-written code — do not manufacture findings to fill the report.

Read the full file on GitHub · 50 lines

Changes

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.

  1. 4d ago First seen · 50 lines · 29 tokens per session scan A 7ab4943f100a

Subscribe to this mod's changes

Judge Database is an agent published in the GitHub repository KevinRabun/judges (7 stars, last pushed 2mo ago), licensed MIT. It adds 29 tokens to every session and 906 once invoked, about $0.0001 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.

Related

Other agents, from other repositories

architecture

Read this guide when changing runtime wiring, MCP connections, HTTP routing, authentication, persistence, or database behavior. For the public runtime overview, see docs/development/architecture.mdx.

samanhappy/mcphub · 0 tokens

mie-builder

Generate or revise ONE MIE (Metadata Interoperability Exchange) YAML file for a single RDF database in TogoMCP, by following the mie-generator skill end to end against the live SPARQL endpoint. Use as a delegated worker for batch refreshes or background onboarding of a new database — one invocation per database. Not…

dbcls/togomcp · 117 tokens

timps_db_agent

DB Agent — schema design, query optimisation, and migration scripts. Given a description of your data model it produces: CREATE TABLE SQL, an ER diagram in Mermaid, index recommendations, a migration script (Alembic / Flyway / raw SQL), and query templates. Pairs with the sqlinjection LoRA for secure query generation.…

Sandeeprdy1729/timps-swarm · 99 tokens

database-administrator

Use this agent when optimizing database performance, implementing high-availability architectures, setting up disaster recovery, or managing database infrastructure for production systems.

alexmmatos/arthur-mcp · 31 tokens

sql-pro

Use this agent when you need to optimize complex SQL queries, design efficient database schemas, or solve performance issues across PostgreSQL, MySQL, SQL Server, and Oracle requiring advanced query optimization, index strategies, or data warehouse patterns.

alexmmatos/arthur-mcp · 49 tokens

bigquery-table-analyst

Use this agent when you need to explore BigQuery datasets, understand table structures, analyze data quality, or discover relationships between tables. Examples: (1) User asks 'What tables are available in the sales dataset?' - Use this agent to explore the dataset and provide detailed table analysis with schemas…

pvoo/bigquery-mcp · 145 tokens