Skip to content

Add must-use authorization decisions and bound authorize helper - #70

Merged
hardbyte merged 2 commits into
mainfrom
codex/enforcement-ergonomics
Sep 19, 2026
Merged

hardbyte merged 2 commits into
mainfrom
codex/enforcement-ergonomics

Conversation

@hardbyte

@hardbyte hardbyte commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Awaited authorization decisions could be silently discarded. Add useful #[must_use] diagnostics to AccessEvaluation, GrantResult, and VetoResult, plus bound.authorize(&invoice).await? for enforcement at application boundaries. Method-level attributes on evaluate and evaluate_by also warn when their awaited batch results are discarded.

authorize returns Result<(), AccessError> by delegating directly to check(...).await.into_result(). It preserves denial versus indeterminate classification and complete error evidence without adding an evaluator. Documentation explains that must_use catches accidental omissions but still permits deliberate bypass.

Validation: formatting, Clippy with warnings denied, workspace build, all-target/all-feature tests, and doctests. Contract tests cover grants, denials, indeterminate outcomes, veto short-circuiting, preserved evidence, and one evaluation per applicable policy. Compile-fail doctests verify discarded awaited decisions fail under deny(unused_must_use) for all three result types and both batch methods.

Closes #68.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 19, 2026

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 Completed 2026-09-19T04:44:53.155772Z 11e9e56 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.

@hardbyte
hardbyte force-pushed the codex/enforcement-ergonomics branch from 11e9e56 to 124ba47 Compare September 19, 2026 11:25
@hardbyte
hardbyte merged commit 7c6b212 into main Sep 19, 2026
8 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.

Make enforcement the easiest call path

1 participant