Automated Compliance (MCP + RAG)
The PDAccess compliance and policy engine — multi-tenant isolation, framework selection and scope binding, the JSONB policy schema, the ONNX SOP/RAG pipeline, and the MCP tool surface.
Overview
The PDAccess Compliance & Policy Engine is the Day-1 governance foundation of the multi-tenant platform: no TUN routes are provisioned and no MCP tunnel tools are exposed until tenant regulatory governance is in place. It enforces compliance as deterministic policy at the network/protocol layer — not as a reporting layer on top of it.
Three planes make up the system:
- Client-side daemon (
pdaccessd) — creates a local virtualTUNinterface (e.g.,pdaccess0), injects scoped/32host routes only for active Just-in-Time (JIT) leases, and encapsulates matching packets over an authenticated mTLS/WireGuard tunnel to the Access Proxy. - Access Proxy (zero-knowledge enforcement plane) — terminates the client tunnel, enforces tenant compliance rules at the protocol layer (SSH, PostgreSQL, MySQL, Kubernetes API), injects ephemeral credentials server-side (zero secrets on the workstation or in LLM context), enforces read-only command/query filtering, and records full session streams.
- MCP server (
pdaccess mcp) — exposes declarative governance and tunnel-lifecycle tools to local coding agents (Claude Code, Cursor, Windsurf) without exposing raw credentials.
Multi-Tenant Isolation (BR-1)
Every customer organization operates within an isolated tenant_id across PostgreSQL relational tables, audit logs, and compliance vector stores:
- PostgreSQL Row-Level Security is enforced with
FORCE ROW LEVEL SECURITYontenant_id. - Vector retrieval and ONNX cross-encoder reranking filter strictly on
(tenant_id = :current_tenant OR is_global_baseline = true), so custom tenant runbooks never cross tenant boundaries. - Roles are separated: Tenant Compliance Admins select frameworks and author policies; Engineers / AI Agents request JIT TUN routes at runtime.
Framework Selection & Scope Binding (BR-2)
Tenant Compliance Admins enable platform-maintained regulatory baselines and bind them to target infrastructure:
- Opt-in catalog — PCI-DSS v4.0.1, SOC 2 (TSC), ISO/IEC 27001:2022, HIPAA Security Rule, NIST CSF 2.0, DORA (EU 2022/2554).
- Tag & subnet binding — frameworks attach globally or selectively, e.g.
tag:env=prod-cdeor10.240.0.0/16enforces PCI-DSS v4.0.1;tag:data=ephienforces HIPAA. - Strictest-wins conflict resolution — when a target falls under multiple active frameworks, the engine deterministically enforces the strictest constraint across all parameters (shortest
max_duration_minutes, shortestidle_timeout_minutes, mandatory MFA, forceddefault_read_only: true).
Canonical reference corpus
Each framework's authoritative clauses are indexed as platform-managed vectors for RAG citation, and each maps to default deterministic constraints enforced on the tunnel/proxy:
| Framework | Authoritative clauses | Default deterministic constraints |
|---|---|---|
| PCI-DSS v4.0.1 | Req 8.2.8 (15-min idle session timeout), Req 8.4.1–8.4.3 (MFA for all CDE & non-console admin access), Req 8.5.1 (no MFA bypass/replay), Req 10.2 (audit logging of all privileged actions) | requires_mfa: true, idle_timeout_minutes: 15, max_duration_minutes: 30, requires_ticket_id: true, default_read_only: true |
| SOC 2 (TSC) | CC6.1 (logical access security & identity verification), CC6.2 (prior authorization before access), CC6.3 (role-based least privilege & timely revocation), CC7.2 (system monitoring & anomaly detection) | requires_mfa: true, requires_approval: true, max_duration_minutes: 60, zero_standing_privileges: true |
| ISO/IEC 27001:2022 | Annex A 5.15 (access control), Annex A 5.18 (access rights provisioning/revocation), Annex A 8.2 (privileged access rights — event-based allocation & expiry), Annex A 8.15 (logging) | requires_mfa: true, event_based_jit: true, shared_accounts_blocked: true, session_recording: true |
| HIPAA Security Rule | §164.312(a)(1) (access control & unique user ID), §164.312(a)(2)(iii) (automatic logoff), §164.312(b) (audit controls for ePHI), §164.312(d) (person/entity authentication) | requires_mfa: true, unique_actor_attribution: true, idle_timeout_minutes: 15, full_query_audit: true |
| NIST CSF 2.0 | PR.AA-01 (identity management), PR.AA-02 (authentication & session management), PR.AA-03/04 (access control & permissions) | requires_mfa: true, event_based_jit: true, shared_accounts_blocked: true, session_recording: true |
| DORA (EU 2022/2554) | Art. 6 (ICT risk governance), Art. 9(1)(b) (access control & asset classification), Art. 9(1)(d) (ICT incident management) | requires_mfa: true, requires_approval: true, max_duration_minutes: 60, unique_actor_attribution: true, full_session_audit: true |
NIST SP 800-53 Rev 5 cross-walk
For assessments that reference the 800-53 control family, the NIST CSF 2.0 corpus maps as follows:
| 800-53 Rev 5 control | PDAccess enforcement |
|---|---|
| AC-2 Account Management | Unique actor attribution; shared accounts blocked; per-tenant identity isolation |
| AC-6 Least Privilege | Event-based JIT with max_duration_minutes; default_read_only for AI agents |
| AC-17 Remote Access | All remote privileged access brokered through the Access Proxy over the TUN tunnel |
| AU-12 Audit Record Generation | Full SQL/SSH transcripts, MFA verification events, human vs. ai_agent traffic |
| IA-2 Identification & Authentication | Forced MFA on every JIT request (requires_mfa) |
DORA third-party ICT risk (Art. 30)
DORA's third-party ICT risk provisions apply to the same engine: contractors and vendor identities are tenant-scoped, JIT-only, and subject to the identical deterministic constraints as internal staff. A DORA-scoped target therefore enforces MFA, approval, a 60-minute max window, unique actor attribution, and full session audit for every actor — internal or third-party.
Custom Policy & SOP Authoring (BR-3)
Tenant Compliance Admins author organization-specific guardrails via a declarative rule builder (JSONB):
{
"policy_name": "prod-db-emergency-change",
"scope": { "tags": ["env=prod"], "cidr": "10.240.0.0/16" },
"max_duration_minutes": 30,
"idle_timeout_minutes": 15,
"requires_ticket_id": true,
"ticket_regex_pattern": "^JIRA-[A-Z]+-[0-9]+$",
"default_read_only": true,
"allowed_protocols": ["postgres", "ssh"],
"requires_mfa": true,
"approval_mode": "dual_custody"
}
max_duration_minutes— TTL before the TUN route is automatically torn down.idle_timeout_minutes— inactivity threshold triggering tunnel revocation.requires_ticket_id&ticket_regex_pattern— e.g.^INC-[0-9]{4,6}$or^JIRA-[A-Z]+-[0-9]+$.default_read_only— the Access Proxy blocksINSERT/UPDATE/DELETE/DROPor destructive SSH commands; mandatory default foractor_type: ai_agent.allowed_protocols— e.g.["postgres", "ssh"]; the proxy drops unauthorized ports even if routed to the TUN adapter.requires_mfa&approval_mode—auto_approve,single_approver,dual_custody.
Unstructured SOP ingestion
Admins upload Markdown/PDF runbooks; a CPU-only ONNX pipeline (bge-small-en-v1.5 / nomic-embed-text-v1.5) chunks, embeds, and indexes them exclusively under the tenant's tenant_id. Policy lookups retrieve against both the platform framework corpus and the tenant's own SOP vectors, and every answer carries citations to the underlying clauses or runbook sections.
MCP Tool Surface
With the policy engine in place, the pdaccess MCP server exposes tools that manage policy checks and TUN route leases rather than per-session port bindings:
list_accessible_targets— authorized hosts, private IPs/hostnames, and permitted protocols within the tenant, without exposing credentials.lookup_compliance_policy— queries the tenant's active frameworks + custom SOP vectors via ONNX RAG; returns required ticket formats, TTL limits, and read-only rules.request_jit_access— validatesacknowledged_policy_idandticket_idagainst the tenant's deterministic JSONB constraints, triggers MFA + human approval, and — on approval — instructs the local daemon to inject the/32route into the TUN adapter and authorize the flow on the Access Proxy.get_tunnel_status— active TUN adapter health, remaining JIT lease TTL, and currently routed target IPs (the developer or agent then connects with standard native clients —psql,ssh,kubectl— directly to the target).revoke_jit_access— removes the/32route from the local TUN adapter and terminates the active lease on the Access Proxy immediately.generate_compliance_report— aggregates deterministic proxy audit logs (MFA verification, human vs.ai_agenttraffic, full SQL/SSH transcripts) mapped to the tenant's active compliance clauses.
Roadmap
- Milestone 1 — Multi-Tenant Governance & Policy Engine (build first): PostgreSQL +
pgvectorschema withtenant_idRLS; global framework vector ingestion via CPU ONNX Runtime; Tenant Admin Portal/API for framework selection and custom policy/SOP authoring. - Milestone 2 — TUN Daemon & Access Proxy Enforcement:
pdaccessdTUN interface lifecycle (route injection/teardown) + protocol-aware credential injection, read-only SQL/SSH filtering, and session recording. - Milestone 3 — MCP Integration & Reporting:
pdaccess mcpserver (lookup_compliance_policy,request_jit_access,get_tunnel_status,revoke_jit_access), optional ONNX prompt-injection inspection on proxy streams, andgenerate_compliance_report.