Skip to main content
The adversarial corpus is how Midplane earns trust: a curated set of SQL bypass attempts that must stay denied and legitimate queries that must stay allowed. It is intentionally short on marketing and long on SQL. It exists to answer one question — what does Midplane actually catch, and where are its limits? The corpus lives in the repo as docs/adversarial-corpus.md and mirrors the test suite under packages/engine/test/adversarial/ one-to-one: every row maps to one assertion. Humans review the doc; CI gates on the tests. The corpus is the contract, and the repo is its source of truth.
100+ bypass attempts denied and 50+ legitimate-query controls allowed (and growing), with 100% line coverage on the policy surface (packages/engine/src/policy/*). The repo is the live source of truth for the exact counts. The denials prove Midplane blocks what it should; the allowed controls prove it doesn’t break legitimate work. False positives are bugs we triage; bypasses are release blockers.

Conservative by default

When in doubt, the corpus denies. Anything the parser can’t faithfully model is denied rather than allowed — Midplane accepts false denials to never accept a false allow. Tightening a known gap is a feature; a missed bypass is a release blocker.

Categories

The corpus is organized by the rule each shape exercises — table_access, multi_statement, dangerous_statement, parse_error edges, and exec side-effects. The repo groups every entry under these, and what Midplane blocks explains the rules in plain language.

Illustrative examples

A few entries, lifted directly from the corpus. The full set lives in the repo — the source of truth these snippets read from.

Must stay denied

Must stay allowed

Known limitations

A few shapes currently allow where an audit mindset would prefer a deny. These are documented gaps, not patched-around bypasses — Midplane ships a small, predictable rule surface, and tightening any of these adds policy state deferred to a follow-up release. The repo tracks the full list of gaps. If your threat model needs any of these tightened today, that’s a known gap rather than a bug — open an issue and we’ll either backport the tightening or prioritize it.

Contribute a bypass

Found a SQL shape that gets through? That’s the single highest-leverage contribution to the project. Add a row to the markdown table and a matching assertion in the test suite — kept one-to-one. See contributing for the workflow.

Adversarial corpus on GitHub

The full corpus, every category, with the bypass logic cited row by row.

Next steps

Threat model

What the corpus is proving — the vectors in and out of scope.

Table access & guardrails

The rules in plain language, with examples.