Agent tools
Local MCP server with read-only SQL, dangerous-function denial, result limits, masking, and JSONL audit.
Protect the path your feature uses: MCP for agent tools, the PostgreSQL proxy for backend and ORM traffic, or the REST filter for supabase-js and PostgREST.
SUPABASE PGWhy this exists
AI features reach Supabase through different protocols. Safe Boundary provides a dedicated enforcement surface for each major data path while keeping masking rules and audit fields aligned.
Start in observe mode, test the real application, then enforce. Keep RLS and least-privileged roles in place, and remove direct credentials or URLs from callers that must not bypass the boundary.
What it does
Local MCP server with read-only SQL, dangerous-function denial, result limits, masking, and JSONL audit.
PostgreSQL wire proxy for ORMs and clients, with upstream role preservation by default.
PostgREST filter that forwards JWT and RLS semantics, masks responses, and blocks inference operators.
Surface decision
| Decision | If the feature uses… | Start with… | Validate… |
|---|---|---|---|
| AI tool calls | Local MCP | Tool list, row/byte limits, local audit | |
| Backend SQL / ORM | PostgreSQL wire | Driver compatibility, role preservation, direct DSN closure | |
| supabase-js / HTTP | PostgREST filter | JWT/RLS, response masking, inference operators |
How it works
List every production database URL, REST URL, and MCP tool the feature can reach.
Place Safe Boundary on each in-scope access path.
Run production-like traffic and refine masking rules.
Enforce policy and restrict direct credentials and network routes.
Protected when
Important boundaries
Continue the story
Give AI tools a bounded PostgreSQL query surface with local audit.
Mask PostgREST responses and stop filters from becoming inference oracles.
See how the three enforcement surfaces share policy and audit semantics.
Start in observe mode and validate the policy against representative traffic before you enforce it. That gives the team evidence for each decision, along with explicit bypass controls for the cases that need a deliberate exception.