feat(policy): spike policy envelope and narrowness prover#1843
Draft
zredlined wants to merge 3 commits into
Draft
feat(policy): spike policy envelope and narrowness prover#1843zredlined wants to merge 3 commits into
zredlined wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spike Z3-backed policy-envelope checks in
openshell-proverfor two related use cases:This PR is draft / not merge-ready. It exists to make the spike branch, walkthrough, test evidence, and review feedback easy to share while we continue evaluating the production shape. The latest local review revisions have not been pushed yet; they are pending human review.
Related Issue
Related #1840
Recommendation
The spike supports the core thesis: the OpenShell policy prover can be used successfully for both maximum-policy envelope checks and narrowness-budget checks on the modeled OpenShell policy surface. The formal queries line up cleanly with the security/policy intent, and no major gap was identified between that intent and what we can express with Z3 for the modeled L4, REST, and WebSocket layers.
Remaining production gaps are explicit and fail closed rather than silently approved. They are engineering follow-ons to widen the modeled policy surface, not blockers to the underlying prover approach.
Changes
envelope::check_within_maximumfor maximum-policy containment.envelope::check_narrownessfor candidate-policy deltas against the current policy.binary,host,port,layer,method, andpathaction variables in Z3.allowed_ips, and other unmodeled surfaces fail-closed.crates/openshell-prover/MAXIMUM_POLICY_ENVELOPE_SPIKE.md.Production Gaps
These surfaces currently return
Unsupportedor remain explicit follow-ons before production auto-approval relies on them:allowed_ipsendpoint scoping;Review Notes
Principal review found several important tightening points, all incorporated in the local review state:
read-onlyshould not implyWEBSOCKET_TEXTsend authority.Testing
Latest local review state:
mise exec -- cargo test -p openshell-prover(64tests)mise run pre-commitEarlier pushed draft state may differ until the final reviewed local changes are pushed.
Checklist