Policy Decision Points (PDP) and Enforcement Points (PEP)
You'll learn: How to separate authorization logic from your application code by introducing centralized decision-making components.
The Core Pattern
A Policy Decision Point (PDP) is a dedicated service that evaluates authorization policies and returns allow/deny decisions. A Policy Enforcement Point (PEP) is the component in your application or gateway that intercepts requests, asks the PDP for a decision, and enforces it.
Think of it like airport security: the PEP is the checkpoint officer who stops you and checks your documents. The PDP is the system that runs your credentials through databases and watch lists to decide if you can proceed. The officer enforces the decision but doesn't make complex judgments—that's the system's job.
Why Separate Decision from Enforcement?
When authorization logic lives inside application code, you face:
- Duplication: Every service reimplements similar rules
- Inconsistency: Authorization decisions vary across services
- Hard to audit: Policy logic scattered everywhere
- Difficult updates: Changing rules requires redeploying applications
By extracting this logic to a PDP, you centralize policy management while PEPs remain lightweight.
How It Works
- Request arrives at your service or API gateway (the PEP)
- PEP extracts context: user identity, requested resource, action
- PEP queries PDP: "Can user X perform action Y on resource Z?"
- PDP evaluates policies using RBAC, ABAC, or other models
- PDP returns decision: allow or deny
- PEP enforces: proceeds or rejects the request
This pattern supports the fine-grained authorization and ABAC policy engines you've already learned—the PDP is where those policies actually execute.
Key Takeaway: Separating PDPs (decision-makers) from PEPs (enforcers) centralizes authorization logic, improves consistency, and lets you update policies without touching application code.