Skip to content

FEAT-005 — Public benchmark of SQL guards for LLM agents #174

Done

Description

@jmmana

Parent epic: #165
Priority: P0

Problem

Agent frameworks ship their own SQL validators (keyword lists, first-word checks, regexes for CTEs) and nobody measures them. There is no public, reproducible comparison of how many attacks each one lets through and how many legitimate queries it blocks.

Proposal

Security impact

None on the guard. Disclosure risk is handled by the publication rule.

Acceptance criteria

  • Harness, legitimate-query corpus, and sqlguardllm and baseline adapters (public).
  • Publication checklist in docs/BENCHMARK.md.
  • First public table: sqlguardllm versus the baseline. Third-party columns are added only under the rule.

Relevant files

  • bench/ (new) · docs/BENCHMARK.md (new)

Size

M

Activity

  1. added
    type:feature
    type:corpus
    area:security
    size:m
    on Nov 30, 2026
  2. jmmana commented on Nov 30, 2026

    @jmmana
    OwnerAuthor

    Delivered in #177 (merged at f4144e6, all PR and main checks green).

    • Harness: benchmarks/guards/run.py (bypass rate, false-positive rate, ms/check, per dialect, JSON output). Reproduce with uv run python benchmarks/guards/run.py.
    • Legitimate-query corpus: benchmarks/guards/legitimate.yaml (34 queries). Attack corpus: 69 read-only-class cases from tests/corpus.
    • Adapters: sqlguardllm and two keyword baselines. No third-party adapters, by the publication rule.
    • Publication checklist and first table: https://jmmana.github.io/sqlguardllm/BENCHMARK/ (HTTP 200 verified).
    • Result (0.5.0a8): sqlguardllm 0/69 bypass, 0/34 false positives; keyword list 59/69 and 3/34; first-word 56/69 and 1/34.
    • Tests: tests/test_guard_benchmark.py; ruff, mypy and pytest green in CI.

    All three acceptance criteria are met. Third-party columns will be added later under the publication rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:securitysize:mtype:corpustype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions