Engineering guide · ICAM

Entitlement Policy Preview And Activation

Status: currentReviewed: 2026-07-26Audience: governance API developers, application integrators, policy administrators, security reviewers
On this pageAuthority BoundaryPolicy ResourceBounded Selector GrammarGrant And Revocation SemanticsREST APICreate A DraftPreviewActivate With Exact PreviewReconciliation And ReviewsLifecycle, Rollback, And DeletionPostgreSQL IntegrityError ContractOkta Compatibility And Atlas ExtensionsVerification

Atlas 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:

Process diagram
Process diagramArchitecture diagramOpen full size ↗

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

id, tenantId, appId

immutable

Tenant-qualified policy identity and its application. Moving a policy to a different application requires a new policy.

name, description

administrator

Bounded, non-secret policy context.

rules

administrator

One through 50 ordered grant or exclude rules. Priorities are unique integers from 1 through 1,000.

maximumPreviewSubjects

administrator

Fail-closed population bound from 1 through 10,000.

maximumAdditions, maximumRevocations

administrator

Independent blast-radius limits. A preview exceeding either limit has a blocking finding and cannot be activated.

status

server

draft, active, inactive, retired, or deleted.

revision

server

Monotonic CAS revision. Protobuf JSON encodes this int64 as a string.

generation

server

Runtime authority generation. It advances only on activation.

activePreviewId, activePreviewDigest

server

Exact immutable preview accepted during activation.

lastModifiedBy, activatedBy, activatedAt

server

Maker-checker identities and activation time.

evidenceHash

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

GET

/api/v1/governance/control/entitlement-policies

List tenant policies with appId, status, pageSize, and pageToken.

POST

/api/v1/governance/control/entitlement-policies

Create a draft.

GET

/api/v1/governance/control/entitlement-policies/{policyId}

Read policy and ETag.

PUT

/api/v1/governance/control/entitlement-policies/{policyId}

Revise a draft or inactive policy with exact If-Match.

DELETE

/api/v1/governance/control/entitlement-policies/{policyId}

Retain a deleted tombstone.

POST

/api/v1/governance/control/entitlement-policies/{policyId}/preview

Create an immutable live-source preview.

GET

/api/v1/governance/control/entitlement-policies/{policyId}/previews/{previewId}

Read and verify one preview.

POST

/api/v1/governance/control/entitlement-policies/{policyId}/lifecycle/{transition}

activate, deactivate, or retire.

POST

/api/v1/governance/control/entitlement-policies/{policyId}/rollback

Restore an event snapshot as a new inactive revision.

GET

/api/v1/governance/control/entitlement-policies/{policyId}/events

Read the verified append-only state history.

POST

/api/v1/governance/control/entitlement-policies/{policyId}/reconcile

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_ASSIGNED_SUBJECTS

No live directory subject has an application-account assignment.

SUBJECT_BOUND_EXCEEDED

The assigned population exceeds maximumPreviewSubjects.

ENTITLEMENT_DEPENDENCY_UNAVAILABLE

A rule references a missing, inactive, or different-application entitlement.

ADDITION_BLAST_RADIUS_EXCEEDED

Calculated additions exceed maximumAdditions.

REVOCATION_BLAST_RADIUS_EXCEEDED

Calculated revocations exceed maximumRevocations.

SOD_CONFLICT

Desired state intersects both sides of an active SoD policy. block enforcement is blocking; other enforcement modes remain explicit findings.

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

State lifecycle
State lifecycleState diagramOpen full size ↗

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

400

Malformed, unsupported, unbounded, secret-looking, or unsafe selector input; missing idempotency; invalid TTL or reason.

403

Missing policy authority, stale assurance, activation below phishing-resistant AAL3, or maker-checker violation.

404

Tenant policy, preview, or historical revision is absent.

409

CAS, generation, lifecycle, replay binding, source generation, digest, dependency, SoD, blast-radius, one-active-policy, evidence, or concurrency conflict.

428

If-Match is absent for an existing policy mutation, preview, lifecycle, rollback, or reconciliation.

503

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.