sqlpermit.schemasure.com/v1/guard/sql
Decide whether an agent-authored PostgreSQL statement complies with an execution policy, using PostgreSQL's own parser rather than pattern matching. Detects statement stacking, data-modifying CTEs, COPY PROGRAM, privilege changes, and dangerous functions that read as ordinary SELECTs. Returns reason codes and an optional short-lived signed permit bound to the exact normalized statement. Never conn
POST
https://sqlpermit.schemasure.com/v1/guard/sqlUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://sqlpermit.schemasure.com/v1/guard/sql", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"audience":"executor:acme-prod-01","dialect":"postgresql","issue_permit":true,"policy":{"allow_multi_statement":false,"allowed_functions":["count","sum","avg"],"allowed_schemas":["analytics"],"allowed_tables":["analytics.orders"],"max_rows":1000,"read_only":true},"sql":"SELECT id, total FROM analytics.orders ORDER BY created_at DESC LIMIT 100","target_pg_major":18}),
});
console.log(await res.json());Example input
{
"audience": "executor:acme-prod-01",
"dialect": "postgresql",
"issue_permit": true,
"policy": {
"allow_multi_statement": false,
"allowed_functions": [
"count",
"sum",
"avg"
],
"allowed_schemas": [
"analytics"
],
"allowed_tables": [
"analytics.orders"
],
"max_rows": 1000,
"read_only": true
},
"sql": "SELECT id, total FROM analytics.orders ORDER BY created_at DESC LIMIT 100",
"target_pg_major": 18
}