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.
MCP setup
Illustrative configuration only: use your client’s MCP format and keep the database credential scoped to the intended read path.
Illustrative client entry
{
"command": "npx",
"args": ["@spectralcore/safe-boundary-mcp"],
"env": {
"DATABASE_URL": "postgresql://readonly@db.internal/app",
"SB_AGENT_ID": "analyst-tool"
}
}Review before enabling
Allow: query, schema
Deny: writes, dangerous functions
Limit: rows and bytes per process
Audit: local JSONL is authoritativeHow 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 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.