Skip to content

Kernel: record a refusal decided outside the kernel - #44

Merged
warheart1984-ctrl merged 1 commit into
mainfrom
claude/external-denial
Oct 20, 2026
Merged

warheart1984-ctrl merged 1 commit into
mainfrom
claude/external-denial

Conversation

@warheart1984-ctrl

Copy link
Copy Markdown
Owner

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 deny from the kernel today is evaluate(), so the gateway had to label every refused request a write under a policy that denies writes. Every refusal receipt then read POLICY_DENIED_EFFECT, the real reason was unrecoverable from the log, and the decision claimed kernel_is_sole_verdict_authority for a call the kernel did not make.

What

record_external_denial(proposal, policy, authority, reason) -> Decision:

  • always deny; there is no external allow or await, so nothing outside the kernel can widen what it permits;
  • reason_codes are ["EXTERNAL_DENY", reason], distinct from every kernel code;
  • invariants_checked names external_verdict_can_only_deny and verdict_authority:<authority> instead of kernel_is_sole_verdict_authority (covered by the decision hash);
  • proposal and policy hashed exactly as in evaluate();
  • reason must match the decision contract's code pattern (upper case, max 64), authority a short lower-case name.

Receipt format, JSON contracts and verifier/ickverify.py are unchanged.

Checked

  • cargo fmt --check, cargo clippy --tests -- -D warnings: clean.
  • cargo test: 59 passed, including two new tests (origin and reason shown, hashes match evaluate(), a signed chain mixing kernel and external receipts verifies; malformed reasons and authorities refused).
  • Python suites not run locally; CI covers them.

🤖 Generated with Claude Code

`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>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T22:44:03.899034Z
We couldn’t complete this review. Comment @codex review to try again.
dc81c88 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@warheart1984-ctrl
warheart1984-ctrl merged commit b60606d into main Oct 20, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant