Repository navigation
feat(policy): add log-only mode to the policy engine - #617
Merged
Merged
Conversation
|
Assessment: Approve Re-reviewed at Since the last review
Thanks for the quick fix and the tests that pin it. |
|
Assessment: Approve Re-reviewed at Checked and held
|
ferdingler
approved these changes
Nov 23, 2026
8 tasks done
6 of 8 tasks
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.
Description
Design 0005 adds a box-wide log-only mode. This PR is the policy-engine half; the Box wiring (the
box.tomlsetting, the stored record, the decision-record fields, and the startup notice) follows in a second PR built on this one.PolicyEngine::log_only()puts an engine in log-only mode for its whole life. In that mode, a denial from aforbidor from nopermitmatching comes back asDecision::Allowwithwould_denyset to the denial's reason, keeping the denial's rule and attribution. It flips only for a request that entered history, so the caller records the action's real outcome and later temporal rules see what actually ran. The flip happens in the authority, before a per-tool MCP call's pending response would be dropped, so a let-through tool call still records its::response.Will be handled in a follow up PR, not here
This PR wires nothing into the binary, so no Box code turns the mode on yet. There will be follow-up Box PR, stacked on this branch.
Related Issues
Design:
team/designs/0005-log-only-mode.md(#310).Type of Change
New feature
Testing
just check, orcargo test --workspace --all-features)cargo fmt --allandcargo clippy --workspace --all-targets --all-features -- -D warningsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.