Repository navigation
Kernel: record a refusal decided outside the kernel - #44
Merged
Merged
Conversation
`record_external_denial(proposal, policy, authority, reason)` lets a system that refuses for its own reasons (a gateway out of budget or over a rate limit) put that refusal on the chain with its real reason. It can only deny: the verdict is fixed, so nothing outside the kernel can widen what the kernel permits. reason_codes are ["EXTERNAL_DENY", reason], and the decision names the deciding authority instead of claiming kernel_is_sole_verdict_authority. Proposal and policy hash as in evaluate(). Receipt format, contracts and ickverify.py are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Why
llm-gateway writes Wicket receipts for its own refusals (out of budget, over a rate limit, model not allowed). The only way to get a
denyfrom the kernel today isevaluate(), so the gateway had to label every refused request awriteunder a policy that denies writes. Every refusal receipt then readPOLICY_DENIED_EFFECT, the real reason was unrecoverable from the log, and the decision claimedkernel_is_sole_verdict_authorityfor a call the kernel did not make.What
record_external_denial(proposal, policy, authority, reason) -> Decision:deny; there is no external allow or await, so nothing outside the kernel can widen what it permits;reason_codesare["EXTERNAL_DENY", reason], distinct from every kernel code;invariants_checkednamesexternal_verdict_can_only_denyandverdict_authority:<authority>instead ofkernel_is_sole_verdict_authority(covered by the decision hash);evaluate();reasonmust match the decision contract's code pattern (upper case, max 64),authoritya short lower-case name.Receipt format, JSON contracts and
verifier/ickverify.pyare unchanged.Checked
cargo fmt --check,cargo clippy --tests -- -D warnings: clean.cargo test: 59 passed, including two new tests (origin and reason shown, hashes matchevaluate(), a signed chain mixing kernel and external receipts verifies; malformed reasons and authorities refused).🤖 Generated with Claude Code