{
  "aid": "sqlpermit.sqlpermit.schemasure.com",
  "name": "SQLPermit",
  "type": "index",
  "description": "SQLPermit parses a candidate statement with PostgreSQL's own grammar (libpg-query, PG 18), walks the syntax tree, and reports whether it complies with the policy you supply — read-only, schema and table allowlists, row ceilings, a function allowlist, single-statement enforcement. Detection is structural, so comments, dollar quoting, Unicode escapes, and stacked statements cannot hide a construct from it. On a compliant statement it can issue a signed Ed25519 permit, valid for seconds, bound to the sha256 of the deparsed canonical statement so it cannot be moved onto a different one. An offline reference verifier is published for your executor. What it cannot do: it never connects to your database, so it cannot see your schema, cannot resolve search_path, and cannot know the role a statement will run as. It is defence in depth alongside a least-privilege database role, not a replacement for one.",
  "image": "https://sqlpermit.schemasure.com/icon.svg",
  "tags": [
    "sql",
    "postgresql",
    "policy",
    "guard",
    "read-only",
    "agent-safety",
    "sql-injection",
    "permit",
    "x402",
    "deterministic"
  ],
  "created": "2026-08-03",
  "modified": "2026-08-05",
  "specificationVersion": "0.18",
  "apis": [
    {
      "aid": "sqlpermit.v1.guard.sql",
      "name": "SQLPermit — Check a PostgreSQL statement against an execution policy and optionally issue a signed permit",
      "description": "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 connects to your database.",
      "humanURL": "https://sqlpermit.schemasure.com/docs",
      "baseURL": "https://sqlpermit.schemasure.com/v1/guard/sql",
      "tags": [
        "sql",
        "postgresql",
        "policy",
        "guard",
        "read-only",
        "agent-safety",
        "sql-injection",
        "permit",
        "x402",
        "deterministic"
      ],
      "properties": [
        {
          "type": "OpenAPI",
          "url": "https://sqlpermit.schemasure.com/openapi.json"
        },
        {
          "type": "x402",
          "url": "https://sqlpermit.schemasure.com/.well-known/x402.json"
        },
        {
          "type": "Pricing",
          "url": "https://sqlpermit.schemasure.com/.well-known/pricing.json"
        },
        {
          "type": "Benchmarks",
          "url": "https://sqlpermit.schemasure.com/.well-known/benchmarks.json"
        },
        {
          "type": "LLMs",
          "url": "https://sqlpermit.schemasure.com/llms.txt"
        }
      ]
    }
  ]
}