SQLGuard Protocol

Authorize-Before-Mutate Protocol (ABMP)

Status: LIVE · Reference: SQLGuard · Machine: /protocol · Lead: /lead

Sell: AI agents need permission before they modify production data.

Lead stack (we own layer 3)

Layer What Enough to authorize?
1 Identity OAuth / service account / MCP user No
2 Roles & tools DB roles, RBAC, read-only MCP, disable DML tools No — 2026 table stakes
3 Statement PASS SQLGuard Ed25519 Authorization Receipt Yes — which exact SQL may run
4 Execute postgres MCP execute / execute_write_query / execute_dml Only after verify/gate

Lint is not authorization. Model confidence is not authorization. EXPLAIN alone is not authorization. OAuth and DB roles are not statement authorize.

Axiom

No autonomous agent may mutate production state without a cryptographically verifiable authorize artifact issued by an external sandbox attestor.

Wealth compliance loop (primary)

Handshake: /handshake · MCP sqlguard_handshake


POST /v1/challenge → DENY + deny_id

POST /v1/challenge/unlock  Exact USDC $100 (amount 100000000)

POST /v1/session/cert → POST /v1/verify → execute only if ok

Companies: Gateway invoice $299/mo → hello@sqlguard.io · /gateway

Portable (free check): POST /v1/gate with certificate + signature + sql → ok → execute

MCP write embed

Before any mutating tool (execute, execute_write_query, execute_dml, postgresql_execute_write_query, CRUD write tools):

1. Set SQLGUARD_REQUIRE=1 / embed /require

2. Obtain PASS (Pilot unlock or existing cert)

3. POST /v1/verify or POST /v1/gate

4. Execute only if verified

Legacy (OFF TABLE as wealth)


POST /v1/session → Exact $0.25 burst   (legacy)

POST /v1/cert    → Exact $0.05 taste   (legacy)

POST /v1/bind    → Mandate Bind        (optional artifact)

Normative (MUST)

1. Fail closed on mutating SQL without a PASS attestation.

2. Verify the attestation signature before execute.

3. Deny DROP / TRUNCATE by default unless an explicit policy pack allows them.

4. Use a non-self payer when smoke-testing the payment path.

Adoption

Fail-closed agents. Leaders issue PASS. Followers lint.