> ## Documentation Index
> Fetch the complete documentation index at: https://warden.buildlab.in/llms.txt
> Use this file to discover all available pages before exploring further.

# wardencert — certification

> A connector is not done when it runs a query. It is done when it passes this.

> [!NOTE]
>
> `wardencert` ships in the source repository rather than in a release: it is the tool that proves a connector before it ships, and it needs the certification profiles and fixtures that live beside the code. Running it needs access to that repository.

`wardencert` runs a connector against a real database and checks that every guarantee it claims is one it actually provides. It is how Warden avoids the failure mode of every governance tool: a feature list that nobody has tested against an engine that does not cooperate.

```bash theme={null}
go run ./cmd/wardencert                        # list engines with a profile
go run ./cmd/wardencert -engine memory -strict
go run ./cmd/wardencert -engine postgresql -strict
go run ./cmd/wardencert -engine mongodb -strict
go run ./cmd/wardencert -engine neo4j -strict
```

| Flag | Meaning |
| - | - |
| `-engine` | Which profile to run. Omit to list the available ones |
| `-strict` | Treat an unchecked case as a failure, so a gap cannot be shipped as a pass |

For PostgreSQL it connects to a local development database, overridable for CI:

| Variable | Default |
| - | - |
| `WARDEN_PG_ADMIN_DSN` | `postgres:///warden_dev?sslmode=disable` |
| `WARDEN_PG_DSN` | `postgres://warden_gateway@/warden_dev?sslmode=disable` |

`make pg-fixture` creates that database, its schema, and the least-privilege role; `make pg-cert` runs the suite against it.

For MongoDB it connects to the server in the DSN, overridable for CI:

| Variable | Default |
| - | - |
| `WARDEN_MONGO_DSN` | `mongodb://localhost:27017` |

The certification profile seeds its own `warden_cert` database on every setup, so cases cannot cascade. `make mongo-fixture` seeds a development database instead (`WARDEN_MONGO_DB`, default `warden_dev`) with the same two tenants' documents; `make mongo-cert` runs the suite. CI certifies against a single-node replica set rather than standalone, because transactions — and so any honest fence — do not exist without one. If the DSN asks for a replica set but the address answers with a standalone (usually a local `mongod` squatting on the container's port), the connector names the mismatch instead of timing out — see [the troubleshooting note](https://warden.buildlab.in/install/source.md#run-it-against-a-real-mongodb).

For Neo4j the profile wipes and reseeds the configured database (`WARDEN_NEO4J_DB`, default `neo4j`) — Community serves only the default database, so point this at a throwaway server:

| Variable | Default |
| - | - |
| `WARDEN_NEO4J_DSN` | `bolt://neo4j:password@localhost:7687` |
| `WARDEN_NEO4J_DB` | `neo4j` |

`make neo4j-fixture` applies the same seed; `make neo4j-cert` runs the suite.

## What it checks

> [accordion] contract — the connector behaves like a connector
>
> Capability claims match the interfaces actually implemented; introspection returns a usable catalog; sessions close; an operation with no agent is refused, because one Warden cannot attribute is one it should not run.

> [accordion] parse and classification — structure, not keywords
>
> Each statement produces the Operation IR the specification requires: class, verb, targets, predicate, mutation, blast radius. A `WITH … DELETE … RETURNING` inside a `SELECT` classifies as a delete, because classification comes from structure and never from the leading keyword.

> [accordion] adversarial — the corpus that tries to get past it
>
> Around eighty cases per profile: homoglyph and zero-width identifiers, case folding, path separators and NUL bytes in names, identifiers supplied as parameters, malformed parameter tokens, writes smuggled into read-shaped requests, server-side code, statements carried alongside commands, and deletes bounded only by something the connector cannot normalise.
>
> A case passes only if the connector refuses it, flags the hazard, or classifies it at least as seriously as required. A case that its own request already satisfies is rejected by the suite itself — a test that cannot fail is not a test.

> [accordion] scope and governance — restrictions that survive contact with SQL
>
> Scope is applied to every reference to a governed table, including aliases, joins, subqueries, and CTEs; the scope value never appears in the rewritten statement as a literal; column restriction removes unpermitted columns from the projection; masking survives aliasing, functions, and joins; and applying scope never changes the blast radius a reviewer is shown.

> [accordion] limits, dry run, and fences
>
> Row caps are injected and reported honestly as truncation; statement timeouts cancel rather than complete; a preview's diff matches what committing actually does; and a fence detects a modification, a deletion, or a newly matching row between preview and commit.

> [accordion] identity — a lease is a real, narrow, revocable principal
>
> For a connector claiming native identity:
>
> * each lease gets its own principal, and statements actually run as it;
> * the principal is no wider than the base grant, and can't log in;
> * the engine refuses a read the base grant never included, with no policy involved;
> * revocation ends a transaction already in flight and removes the principal;
> * a principal named like a lease's but not made for it is never adopted or dropped.
>
> A connector claiming only gateway-enforced identity must mark every identity it hands out as emulated. A native claim with no identity suite behind it fails.

## Reading the output

```
CONTRACT  (5 passed)
PARSE  (17 passed)
CLASSIFICATION  (13 passed)
ADVERSARIAL  (19 passed)
SCOPE  (9 passed)
GOVERNANCE  (13 passed)
LIMITS  (2 passed)
DRY_RUN  (3 passed)
FENCE  (3 passed)
89 passed, 0 failed, 0 skipped in 819ms

CERTIFIED: postgresql satisfies the Warden connector specification.
```

Without `-strict`, a case a profile does not cover is reported as skipped. With it, a skip fails the run — which is what stops a profile being thinned out to make a build green.

## Where it runs

Every commit: the in-memory connector in the `check` job, PostgreSQL against a real server in the `postgres` job, MongoDB against a single-node replica set in the `mongo` job, and Neo4j against a live server in the `neo4j` job. A connector that stops satisfying the specification fails the build rather than shipping.

> [card] [Writing a connector](https://warden.buildlab.in/engines/roadmap.md)
>
> The certification profile is the contract a new engine implements against.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.