Docs/Authority/Fastest Local Validation

Fastest Local Validation Path

Use this path for Day 1 validation with minimal setup.

You do not need enterprise IdP setup, two browser agents, or a hosted control plane to prove authority behavior locally.

Day 1 goal

Validate allow/deny behavior and sidecar operations in a single local environment before integrating enterprise identity.


Step 1: validate allow/deny in-process

from predicate_authority import ActionGuard, InMemoryProofLedger, LocalMandateSigner, PolicyEngine
from predicate_contracts import ActionRequest, ActionSpec, PolicyEffect, PolicyRule, PrincipalRef
from predicate_contracts import StateEvidence, VerificationEvidence

rules = (
    PolicyRule(
        name="allow-orders-create",
        effect=PolicyEffect.ALLOW,
        principals=("agent:checkout",),
        actions=("http.post",),
        resources=("https://api.vendor.com/orders",),
    ),
)

guard = ActionGuard(
    policy_engine=PolicyEngine(rules=rules),
    mandate_signer=LocalMandateSigner(secret_key="replace-with-strong-secret"),
    proof_ledger=InMemoryProofLedger(),
)

request = ActionRequest(
    principal=PrincipalRef(principal_id="agent:checkout", tenant_id="tenant-a"),
    action_spec=ActionSpec(action="http.post", resource="https://api.vendor.com/orders", intent="submit order"),
    state_evidence=StateEvidence(source="sdk-python", state_hash="sha256:abc123"),
    verification_evidence=VerificationEvidence(signals=tuple()),
)

decision = guard.authorize(request)
print("allowed=", decision.allowed, "reason=", decision.reason.value)

Step 2: simulate delegated flow with two scripts


Step 2b (optional): check Okta OBO compatibility

Before enterprise rollout, run the capability-gated compatibility check to decide delegation path:

export OKTA_OBO_COMPAT_CHECK_ENABLED=1
export OKTA_SUPPORTS_TOKEN_EXCHANGE=true   # or false
python3 -m pytest tests/test_okta_obo_compatibility.py -k "live_check_when_enabled"

Step 2c (optional): check Entra OBO compatibility

Use this to determine whether Entra OBO can be used directly or if mandate delegation fallback should be used:

export ENTRA_OBO_COMPAT_CHECK_ENABLED=1
export ENTRA_SUPPORTS_OBO=true   # or false
python3 -m pytest tests/test_entra_obo_compatibility.py -k "live_check_when_enabled"

If ENTRA_SUPPORTS_OBO=true, also provide ENTRA_USER_ASSERTION for true OBO exchange validation.


Step 2d (optional): check OIDC token exchange compatibility

Use this when your enterprise IdP is generic OIDC (not Okta/Entra-specific) to decide delegation path:

export OIDC_COMPAT_CHECK_ENABLED=1
export OIDC_SUPPORTS_TOKEN_EXCHANGE=true   # or false
python3 -m pytest tests/test_oidc_compatibility.py -k "live_check_when_enabled"

If OIDC_SUPPORTS_TOKEN_EXCHANGE=true, also provide OIDC_SUBJECT_TOKEN for true token exchange validation.


Step 3: optional sidecar smoke test

Optional control-plane checks after sidecar smoke passes:

When this path passes, then add enterprise IdP and web-agent E2E.