@@ -81,12 +81,98 @@ PYTHONPATH=. predicate-authorityd \
8181 --mandate-signing-key-env PREDICATE_AUTHORITY_SIGNING_KEY
8282```
8383
84+ ## 2b) Okta production hardening checklist + staging matrix
85+
86+ Use this section when validating enterprise IdP readiness for Phase 2.
87+
88+ ### Checklist
89+
90+ - [ ] Configure dedicated Okta OIDC app integration per environment (staging/prod split).
91+ - [ ] Verify configured ` issuer ` and ` audience ` are exact matches to the target environment.
92+ - [ ] Verify required claims/scopes/groups mapping used by authority role/tenant checks.
93+ - [ ] Enforce strict JWT checks (` iss ` , ` aud ` , ` exp ` , ` nbf ` , ` iat ` , required claims, alg allowlist).
94+ - [ ] Validate JWKS retrieval and cache behavior for normal operation.
95+ - [ ] Validate key rotation behavior (` kid ` rollover) without service restart.
96+ - [ ] Validate fail-closed behavior for cold-start JWKS failure and stale key scenarios.
97+ - [ ] Validate redaction: no token/secret leakage in logs on failures/retries.
98+ - [x] Validate startup diagnostics for missing/invalid auth configuration.
99+ - [ ] Validate revocation path behavior under Okta-backed principals.
100+
101+ ### Staging test matrix
102+
103+ | Test ID | Scenario | Expected Result |
104+ | --- | --- | --- |
105+ | OKTA-01 | Valid token (correct issuer/audience/scope) | Request authorized and audit emitted |
106+ | OKTA-02 | Wrong issuer | Denied with issuer mismatch reason |
107+ | OKTA-03 | Wrong audience | Denied with audience mismatch reason |
108+ | OKTA-04 | Missing required scope | Denied fail-closed before action |
109+ | OKTA-05 | Expired token | Denied with expiration reason |
110+ | OKTA-06 | Future ` nbf ` beyond leeway | Denied with temporal validation reason |
111+ | OKTA-07 | Unsupported signing algorithm | Denied before trust decision |
112+ | OKTA-08 | JWKS rotation (` kid ` changes) | Validation recovers without restart |
113+ | OKTA-09 | JWKS outage with warm cache | Existing key path continues until cache boundary |
114+ | OKTA-10 | JWKS outage with cold cache | Startup/auth fails closed with actionable diagnostics |
115+ | OKTA-11 | Tenant outside allow-list | Denied with tenant policy reason |
116+ | OKTA-12 | Principal/intent revocation during run | Subsequent action denied promptly |
117+ | OKTA-13 | Log redaction check | No raw tokens/secrets in logs |
118+
119+ ### Signoff evidence commands (deterministic integration tests)
120+
121+ Run these from ` AgentIdentity ` repo root and attach output to signoff evidence.
122+
123+ 1 ) Network partition fail-closed behavior:
124+
125+ ``` bash
126+ python3 -m pytest tests/test_daemon_phase2.py -k " network_partition_fail_closed_raises_and_tracks_failure"
127+ ```
128+
129+ Checkpoints:
130+
131+ - pass result proves fail-closed error path is enforced when control-plane is partitioned and ` fail_open=False ` ,
132+ - ` /status ` payload includes incremented control-plane failure counters.
133+
134+ 2 ) Restart recovery with persisted queue:
135+
136+ ``` bash
137+ python3 -m pytest tests/test_daemon_phase2.py -k " restart_recovers_queue_after_partition"
138+ ```
139+
140+ Checkpoints:
141+
142+ - pre-restart flush queue has pending event(s),
143+ - post-restart ` POST /ledger/flush-now ` reports ` sent_count >= 1 ` ,
144+ - post-flush queue is empty (` GET /ledger/flush-queue ` returns no items).
145+
84146When enabled, daemon bootstrap auto-attaches ` ControlPlaneTraceEmitter ` so each
85147authority decision pushes:
86148
87149- audit events -> ` /v1/audit/events:batch `
88150- usage credits -> ` /v1/metering/usage:batch `
89151
152+ ### Optional: use Okta identity mode
153+
154+ Provide Okta OIDC values via env vars:
155+
156+ ``` bash
157+ export OKTA_ISSUER=" https://<org>.okta.com/oauth2/default"
158+ export OKTA_CLIENT_ID=" <okta-client-id>"
159+ export OKTA_AUDIENCE=" api://predicate-authority"
160+ ```
161+
162+ Start daemon in Okta mode:
163+
164+ ``` bash
165+ PYTHONPATH=. predicate-authorityd \
166+ --host 127.0.0.1 \
167+ --port 8787 \
168+ --mode cloud_connected \
169+ --identity-mode okta \
170+ --okta-issuer " $OKTA_ISSUER " \
171+ --okta-client-id " $OKTA_CLIENT_ID " \
172+ --okta-audience " $OKTA_AUDIENCE " \
173+ --policy-file examples/authorityd/policy.json
174+ ```
175+
90176## 3b) Optional local identity registry (ephemeral task identities)
91177
92178Enable local identity support:
0 commit comments