A. Policy decision logic (PDP)
The control plane acts as your Policy Decision Point via a decidePdp function that evaluates:
subject (who is calling), action (read, create, delete, invoke for AI),
resource (GraphQuery, DSAR, orders, etc.), and rich context such as the
exact GraphQL selections requested.
- Deny-by-default: unmatched calls fall through to
allow: false— a Zero-Trust baseline. - Role-based gating: analysts are blocked from
create,delete, and introspection; DSAR actions are limited to admin / privacy roles. - AI-aware policy: AI invocations are explicitly gated so, for example,
isAnalyst && isAIcan be refused up front. - PII masking obligations: for an analyst’s
read, the PDP returnsobligations.mask = ["userEmail", …]instead of justallow: true.
B. Policy enforcement (PEP)
The same decision is enforced at two layers:
-
At the control plane gateway: handlers call
enforcePdpfirst. If the decision is not allowed, the request ends with403 Forbiddenbefore any business logic runs. A globalonRequesthook verifies JWTs when enabled. -
At the data plane: the obligations are sent alongside the request.
The federated GraphQL engine uses
obligations.maskto redact or drop fields as it resolves data — field-level PEP at the gateway / subgraph layer.
C. Observability & auditability
Helpers like tagPdpDecision and tagDsarSpan attach the decision
(allow flag, reason, resource, obligations) as attributes on every OpenTelemetry span.
That gives you an immutable, queryable audit trail that ties every API call to the
policy that governed it.