File-access denial
Recognize configured server-file functions inside expressions, nested queries, and multi-statement input.
Safe Boundary inspects function calls inside parsed SQL and denies known operations that can read server files, export large objects, or reach outside the intended database path.
pg_read_file()→lo_export()→dblink()→Why this exists
PostgreSQL exposes powerful functionality through callable functions. A statement can begin with SELECT and still attempt file access, large-object export, cross-database access, or another operation that is inappropriate for a bounded application or AI tool.
Safe Boundary walks the parsed function calls and compares them with an explicit dangerous-function policy. A match is blocked before PostgreSQL executes it, even when the surrounding statement otherwise looks read-only.
What it does
Recognize configured server-file functions inside expressions, nested queries, and multi-statement input.
Deny known large-object operations that can move data beyond the intended result path.
Refuse configured functions that can turn an approved connection into a bridge to another data source.
How it works
Build the complete PostgreSQL syntax tree instead of scanning keywords.
Inspect function calls throughout the statement structure.
Compare resolved names with the configured dangerous-function policy.
Return a controlled policy error and record the reason before execution.
Protected when
Important boundaries
Continue the story
See how complete statements are classified before execution.
Give AI tools a bounded PostgreSQL query surface with local audit.
Understand trust boundaries, credentials, identity, and bypass conditions.
Start in observe mode, validate the policy against representative traffic, and move to enforcement with explicit bypass controls.