Local, direct connection
The npm package runs beside the MCP client and uses DATABASE_URL directly; credentials do not pass through Spectral Core infrastructure.
Safe Boundary runs as a local stdio MCP server and connects directly to PostgreSQL. Every query tool call passes through the SQL parser, masking engine, read-only gate, and audit writer.
TARGETPOSTGRESQLWhy this exists
The MCP surface exposes query and schema-description tools, blocks non-read-only statements, denies dangerous functions, masks configured fields, and applies row and byte limits to returned results.
Agent information supplied through environment settings is recorded for attribution. It helps investigations, but is not a substitute for cryptographically verified workload identity or a scoped database credential.
What it does
The npm package runs beside the MCP client and uses DATABASE_URL directly; credentials do not pass through Spectral Core infrastructure.
Read-only enforcement, dangerous-function denial, masking, row caps, and per-process session budgets constrain the tool path.
Every tool call is appended to rotating local JSONL. An optional console uplink is best-effort; the local file remains authoritative.
How it works
Add the package command and database URL to the MCP client.
Set stable agent attribution metadata for the environment.
Choose masking rules and row/byte ceilings appropriate for the job.
Inspect local audit records and optionally mirror them to the console.
Protected when
Important boundaries
Continue the story
Understand trust boundaries, credentials, identity, and bypass conditions.
Use stable agent metadata without calling it authentication.
Protect application, ORM, psql, and BI traffic on the PostgreSQL protocol.
Start in observe mode, validate the policy against representative traffic, and move to enforcement with explicit bypass controls.