Skip to content

SQLGuard Ninja v0.2.0

Choose a tag to compare

@Pratik653 Pratik653 released this 24 Oct 15:41
· 20 commits to main since this release

SQLGuard Ninja v0.2.0

Lineage-aware privacy and tenant enforcement, and a more rigorous benchmark.

Highlights

  • Lineage through CTEs and derived tables. Aggregate-only columns can now be projected raw in an inner scope when every downstream use is a statistical aggregate, while filters, ordering, windows, MIN/MAX, whole-row or any raw use stay denied. Tenant pins applied to an unmodified projection of the tenant column now cover the inner read, under strict conditions (no aggregation, windows or row limits; every consumer pinned). The small-cohort check follows identifiers through derived scopes.
  • Benchmark rigour. Internal versus independent dataset tiers, policy versus unsupported-SQL basis for denials, F1, 95% Wilson intervals, throughput, CSV export, and per-file SHA-256 dataset hashes.
  • Reviewed relabels. Label changes must be listed in the CODEOWNERS-protected LABEL_CHANGES.yaml, or the CI gate fails.
  • Corpus 1.1.0: 551 cases / 1,044 evaluations, including 21 lineage boundary cases.

Behaviour changes

Exactly two corpus cases changed decision (PRV-026, TEN-021: deny → allow). Both are documented false positives of 0.1.x, and both relabels are approved in LABEL_CHANGES.yaml.

Known limitations (unchanged)

  • No restricted-function or system-catalog benchmark cases (issue #5), and no independent external dataset yet (issue #6). All published benchmark numbers are internal.
  • Only PostgreSQL and SQLite are supported; writes are denied; no guarantee against SQL injection or data leakage.

Installation

python -m pip install sqlguard-ninja==0.2.0

PyPI: https://pypi.org/project/sqlguard-ninja/0.2.0/