Engineering guide · ICAM
Entitlement Policy Preview And Activation
On this page
Authority BoundaryPolicy ResourceBounded Selector GrammarGrant And Revocation SemanticsREST APICreate A DraftPreviewActivate With Exact PreviewReconciliation And ReviewsLifecycle, Rollback, And DeletionPostgreSQL IntegrityError ContractOkta Compatibility And Atlas ExtensionsVerificationAtlas entitlement policies automatically calculate application entitlement grants and revocations from current Universal Directory, group, account, catalog, and separation-of-duties state. The developer surface preserves the useful Okta entitlement-policy workflow—rules, user and group conditions, preview, draft activation, and automatic assignment—while making policy execution a dedicated, reviewable authority.
The REST contract is available in the gateway OpenAPI document at
/openapi.json and Swagger UI at /docs/. The service contract is also
available over GovernanceService gRPC.
Authority Boundary
An EntitlementPolicy is not the existing AccessPolicy.
AccessPolicy-
Routes an access request through questions, approvals, and tasks.
EntitlementPolicy-
Calculates desired application entitlements for currently assigned subjects and stages the exact grant or revoke diff.
Keeping these authorities separate prevents an access-request routing change from silently becoming automatic assignment authority. Governance insights are also separate. An insight can recommend a policy change, but neither an insight, an AI response, nor free-form text can activate or execute a policy.
The source-of-truth flow is:
Only users represented by a live ApplicationAccount for the policy
application enter evaluation. A directory user who is not assigned to the
application is not implicitly provisioned by this policy family.
Policy Resource
| Field | Authority | Contract |
|---|---|---|
|
immutable |
Tenant-qualified policy identity and its application. Moving a policy to a different application requires a new policy. |
|
administrator |
Bounded, non-secret policy context. |
|
administrator |
One through 50 ordered |
|
administrator |
Fail-closed population bound from 1 through 10,000. |
|
administrator |
Independent blast-radius limits. A preview exceeding either limit has a blocking finding and cannot be activated. |
|
server |
|
|
server |
Monotonic CAS revision. Protobuf JSON encodes this |
|
server |
Runtime authority generation. It advances only on activation. |
|
server |
Exact immutable preview accepted during activation. |
|
server |
Maker-checker identities and activation time. |
|
server |
SHA-256 state seal verified on authoritative reads. |
Only one policy may be active for one application in one tenant. The database enforces this with a partial unique index in addition to service checks.
Bounded Selector Grammar
Atlas does not execute Okta Expression Language, JavaScript, CEL, SQL, regular expressions, templates, or an AI-generated expression as policy authority. Selectors use a small structured grammar that can be validated before storage and evaluated deterministically.
Supported fields are:
-
user.id -
user.username -
user.email -
user.status -
user.clearance -
group.id -
assignment.entitlement_id -
profile.<attribute-key>
The profile key must begin with a letter and contain at most 128 letters,
digits, underscores, periods, or hyphens. Supported operators are equals,
not_equals, in, not_in, contains, and present. A selector combines
one through 20 conditions with ALL or ANY. An in or not_in condition
accepts at most 50 bounded non-secret values.
Example:
{
"id": "finance-active",
"name": "Active finance users",
"priority": 10,
"effect": "grant",
"selector": {
"match": "ALL",
"conditions": [
{
"field": "profile.department",
"operator": "equals",
"value": "finance"
},
{
"field": "user.status",
"operator": "equals",
"value": "ACTIVE"
}
]
},
"entitlementIds": ["ent-payroll-user"],
"revokeWhenUnmatched": true
}
Grant And Revocation Semantics
A matching grant rule adds its listed entitlements to desired state.
Multiple matching grant rules combine their entitlements.
When revokeWhenUnmatched is true, an unmatched grant rule removes only the
entitlements that rule manages. It does not remove entitlements managed by
another rule and does not remove an unmanaged current entitlement.
A matching exclude rule takes precedence and removes all entitlements managed
by this policy. An exclude rule cannot list grants. Entitlements outside the
policy’s managed set remain unchanged.
Every subject result contains:
-
matching rule IDs;
-
human-readable bounded reasons;
-
current and desired entitlement IDs;
-
exact additions and removals; and
-
a source-evidence hash.
REST API
| Method | Path | Purpose |
|---|---|---|
|
|
List tenant policies with |
|
|
Create a draft. |
|
|
Read policy and |
|
|
Revise a draft or inactive policy with exact |
|
|
Retain a deleted tombstone. |
|
|
Create an immutable live-source preview. |
|
|
Read and verify one preview. |
|
|
|
|
|
Restore an event snapshot as a new inactive revision. |
|
|
Read the verified append-only state history. |
|
|
Evaluate the current active generation and stage its exact live diff. |
Every mutation requires Idempotency-Key. Every existing-policy mutation and
preview requires exact If-Match. The gateway derives actor, tenant, roles,
AAL, FAL, factor class, certificate binding, session, and authentication time
from authenticated request context; a REST body cannot choose those fields.
Create A Draft
POST /api/v1/governance/control/entitlement-policies HTTP/1.1
Authorization: Bearer <fresh-aal2-policy-admin-token>
Idempotency-Key: finance-payroll-policy-create-0001
Content-Type: application/json
{
"policy": {
"name": "Payroll finance access",
"appId": "app-payroll",
"maximumPreviewSubjects": 5000,
"maximumAdditions": 250,
"maximumRevocations": 50,
"rules": [
{
"id": "finance",
"name": "Finance staff",
"priority": 10,
"effect": "grant",
"selector": {
"match": "ALL",
"conditions": [
{
"field": "profile.department",
"operator": "equals",
"value": "finance"
}
]
},
"entitlementIds": ["ent-payroll-user"],
"revokeWhenUnmatched": true
}
]
}
}
The response is 201, status is draft, revision is "1", and the
gateway returns ETag: "v1".
Preview
POST /api/v1/governance/control/entitlement-policies/epol-123/preview HTTP/1.1
Authorization: Bearer <fresh-aal2-policy-admin-token>
If-Match: "v1"
Idempotency-Key: finance-payroll-policy-preview-0001
Content-Type: application/json
{"ttlSeconds": 900}
Preview TTL is from 60 through 1,800 seconds. The response binds:
-
policy ID, revision, and generation;
-
application ID;
-
directory generation;
-
entitlement-catalog generation;
-
application-assignment generation;
-
active SoD generation;
-
combined source generation;
-
deterministic subject decisions and findings;
-
counts and blockers;
-
stable preview digest;
-
creator, creation time, expiry, and evidence hash.
The digest excludes preview identity and timestamps. Re-evaluating the same policy revision over the same source generations yields the same result digest. The preview record itself is immutable and has an independent payload seal.
Blocking findings include:
| Code | Meaning |
|---|---|
|
No live directory subject has an application-account assignment. |
|
The assigned population exceeds |
|
A rule references a missing, inactive, or different-application entitlement. |
|
Calculated additions exceed |
|
Calculated revocations exceed |
|
Desired state intersects both sides of an active SoD policy. |
Activate With Exact Preview
POST /api/v1/governance/control/entitlement-policies/epol-123/lifecycle/activate HTTP/1.1
Authorization: Bearer <independent-phishing-resistant-aal3-token>
If-Match: "v1"
Idempotency-Key: finance-payroll-policy-activate-0001
Content-Type: application/json
{
"reason": "Independent review completed for payroll scope",
"previewId": "epprev-456",
"previewDigest": "5ab1...64-hex-characters..."
}
Activation fails unless all of these remain true at commit:
-
actor has policy-administrator authority;
-
authentication is fresh AAL3;
-
the factor is phishing resistant through FAL 2, certificate binding, or the validated factor-class signal;
-
actor differs from
lastModifiedBy; -
policy revision matches
If-Match; -
preview ID and digest match one immutable preview for this revision;
-
preview has not expired and has no blockers;
-
directory, catalog, assignment, and SoD generations still match;
-
re-evaluated subject results still match;
-
no other policy is active for the application; and
-
the SQL serializable transaction wins its CAS.
Successful activation increments both revision and policy generation. The same
transaction appends the signed policy event, stores actor-bound replay
evidence, and stages deterministic grant or revoke FulfillmentAction rows
from the accepted preview.
The outbox action binds policyRevision, policyGeneration,
sourceGeneration, previewDigest, subjectEvidenceHash, entitlement ID,
application, subject, and operation. externalWriteback remains false until a
configured connector executes and verifies target acceptance.
Reconciliation And Reviews
Activation stages the accepted preview diff. Later source changes do not reuse that old decision. A reconciler calls:
POST /api/v1/governance/control/entitlement-policies/epol-123/reconcile HTTP/1.1
Authorization: Bearer <fresh-aal2-policy-admin-token>
If-Match: "v2"
Idempotency-Key: finance-payroll-policy-reconcile-20260726
Content-Type: application/json
{"reason": "Reconcile current directory and application state"}
The service requires the exact active revision and generation, snapshots every authoritative source again, calculates a new diff, rejects blocking findings, and atomically stores an applied evaluation plus deterministic outbox actions. This is the assignment and review boundary: a campaign, reviewer, connector, or worker must consume evidence bound to the active policy generation and current sources rather than treating the policy document alone as proof of current access.
Repeated requests with the same actor-bound idempotency key return the same preview and do not duplicate outbox actions. A different request, operation, actor, or revision using the same key is a conflict.
Lifecycle, Rollback, And Deletion
Active policy configuration is immutable. Deactivate before editing or rollback. Rollback reads a verified historical event snapshot, restores its configuration as a new inactive revision, preserves the current application identity and generation, and requires a reason. It never rewinds revision or deletes history.
retired and deleted are terminal. Delete is a tombstone; physical delete is
rejected in PostgreSQL.
PostgreSQL Integrity
Migration 079_governance_entitlement_policy_authority.sql creates dedicated:
-
governance_entitlement_policies; -
governance_entitlement_policy_events; -
governance_entitlement_policy_previews; and -
governance_entitlement_policy_idempotency.
Database constraints and triggers enforce tenant-qualified primary keys, policy identity immutability, revision-by-one, monotonic activation generation, lifecycle transitions, active configuration immutability, one active policy per application, tombstones, payload-to-authoritative-column agreement, SHA-256 payload seals, foreign-key restriction, and append-only event, preview, and replay evidence.
Policy state and its evidence event commit in one serializable transaction. Activation also validates the immutable preview and source generations and inserts the fulfillment outbox in that transaction. A crash cannot expose an active generation without its event and calculated assignment intent.
Error Contract
| Status | Meaning |
|---|---|
|
Malformed, unsupported, unbounded, secret-looking, or unsafe selector input; missing idempotency; invalid TTL or reason. |
|
Missing policy authority, stale assurance, activation below phishing-resistant AAL3, or maker-checker violation. |
|
Tenant policy, preview, or historical revision is absent. |
|
CAS, generation, lifecycle, replay binding, source generation, digest, dependency, SoD, blast-radius, one-active-policy, evidence, or concurrency conflict. |
|
|
|
The configured durable governance authority is unavailable. |
Okta Compatibility And Atlas Extensions
Okta documents entitlement policies as application-scoped rules that assign or revoke entitlements from current profile attributes and group membership. Okta also documents draft editing, user preview, active-policy application, and combining entitlement results when several rules match:
Atlas preserves that developer model. Atlas extensions are the bounded non-executable grammar, exact source generations, per-subject explanations, stable digest, SoD and dependency findings, explicit blast-radius gates, phishing-resistant AAL3 independent activation, policy-generation revalidation, actor-bound replay, serializable outbox materialization, rollback snapshots, retained tombstones, and independently sealed hash-chained evidence.
These are Atlas guarantees. They do not imply that Okta provides or requires the same storage, assurance, digest, transaction, or evidence mechanisms.
Verification
Run the focused model, race, gateway, OpenAPI, migration, and documentation checks:
Internal implementation checks are omitted from this public guide.
Compile the Docker-tagged integration test without starting infrastructure:
Internal implementation checks are omitted from this public guide.
Run the isolated tmpfs PostgreSQL validation only in the serialized Docker slot:
scripts/test/run-governance-entitlement-policy-docker-validation.sh
The validated run passed source invalidation, concurrent CAS, restart,
transactional outbox, replay, and direct SQL tamper checks. Its verified
manifest is
artifacts/governance-entitlement-policy-docker-validation/20260726T174114Z/manifest.sha256.