OPA Policy Bundle Lifecycle (v2)¶
Status: Active baseline Last updated: 2026-05-28
This document defines a minimal, auditable lifecycle contract for OPA policy bundles used by external policy decision rollout.
Scope¶
This lifecycle covers bundle structure and compatibility checks for the pre-decision path:
/v1/data/orca/policy/pre- package
orca.policy.pre
Runtime safety remains authoritative during staged rollout.
Bundle Layout¶
Expected files under policies/opa:
bundle_manifest.jsonpolicy_pre.rego
Manifest Contract¶
bundle_manifest.json must contain:
bundle_namebundle_versionpolicy_package(must beorca.policy.pre)decision_path(must be/v1/data/orca/policy/pre)compatibilityblocktenant_scopeblockpromotion_policyblock
Formal schema:
docs/schemas/PolicyBundleManifest.schema.jsontooling/verify_policy_bundle_lifecycle.pyvalidates manifest conformance against this schema
Required governance fields:
tenant_scope.modein{shared_with_tenant_constraints, tenant_scoped}tenant_scope.tenant_selection = context_tenant_onlytenant_scope.cross_tenant_allowed = falsepromotion_policy.required_reviews >= 1promotion_policy.enforce_requires_shadow_validation = truepromotion_policy.require_bundle_version_bump = truepromotion_policy.environment_promotion.sequence = [dev, staging, prod]promotion_policy.environment_promotion.rules.dev_to_staging.require_shadow_parity = truepromotion_policy.environment_promotion.rules.dev_to_staging.min_runtime_canary_pass_ratio >= 1.0promotion_policy.environment_promotion.rules.staging_to_prod.require_shadow_parity = truepromotion_policy.environment_promotion.rules.staging_to_prod.min_runtime_canary_pass_ratio >= 1.0promotion_policy.environment_promotion.rules.staging_to_prod.required_approvals >= 2
Rego Contract¶
policy_pre.rego must contain:
package orca.policy.predefault resultdecision baseline
Verification¶
Run:
python tooling/verify_policy_bundle_lifecycle.py --bundle-root policies/opa --report-file artifacts/policy_bundle_lifecycle_report.json
Report fields:
- status
- summary.total/passed/failed/pass_ratio
- checks[]
- contract (
opa_policy_bundle_lifecycle_v2)
Promotion-readiness evidence (runtime canary):
artifacts/policy_promotion_readiness_report.json- contract:
policy_promotion_readiness_v1 - Includes
dev_to_staging.readyandstaging_to_prod.automated_ready staging_to_prod.required_approvalsremains an operational branch-protection control in GitHub settings
Production Interpretation Rules¶
Treat policy lifecycle governance as production-ready only when all are true:
opa_policy_bundle_lifecycle_v2report status ispassedpolicy_promotion_readiness_v1report status ispassed- readiness verification report status is
passed - no schema or workflow freshness drift is present in CI governance artifacts
No-Go conditions:
- Manifest schema conformance fails
- tenant-scope constraints fail
- environment promotion rules fail (
dev_to_stagingorstaging_to_prod) - runtime canary pass ratio is below required threshold for promotion path
Rollout Intention¶
- Keep bundle checks in CI as a readiness gate.
- Expand decision coverage over time without breaking runtime-safe defaults.
- Enforce explicit environment promotion controls before production-enforce cutover.