All terms
Architecture

Policy Enforcement Point (PEP)

Thin code in your application that intercepts requests and asks the PDP "is this allowed?" The PEP enforces decisions but does not own policy logic.


A Policy Enforcement Point (PEP) is thin code in your application that intercepts requests, extracts the relevant context (subject, resource, action), calls the PDP, and enforces the decision. The PEP never contains authorization logic — it is a one-line question to the PDP.

What a PEP looks like

typescript
// PEP: one line, no business logic, identical everywhere
async function requirePermission(userId, scopeId, resource, action) {
  const { allowed } = await pdp.hasAccess({ subjectId: userId, scopeId, resource, action })
  if (!allowed) throw new Forbidden()
}

// In your handler:
await requirePermission(user.id, scopeId, 'invoice', 'delete')

The PEP is intentionally thin. It does not know which roles grant invoice:delete, whether deny-wins applies, or what the user's permissions are. It just asks the PDP and enforces the answer.