Skip to content

fix(policy): case-insensitive navigate domain; token-bound sensitive keys - #14

Open
Jimthetaxguy wants to merge 1 commit into
mainfrom
cursor/rust-policy-hygiene-a80e
Open

fix(policy): case-insensitive navigate domain; token-bound sensitive keys#14
Jimthetaxguy wants to merge 1 commit into
mainfrom
cursor/rust-policy-hygiene-a80e

Conversation

@Jimthetaxguy

@Jimthetaxguy Jimthetaxguy commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Tiny policy honesty pass on main. Two real bugs, smallest possible diff. Does not redo PR #5 (scaffolding) or PR #13 (ReadOnly blocks navigate).

Changes

  • target_domain treats navigate case-insensitively. Scheme-block already used eq_ignore_ascii_case("navigate"), but target_domain used tool_name == "navigate". A Navigate / NAVIGATE call still scheme-checked, then applied domain allow/deny to the current page URL instead of arguments["url"]. Same comparison as the scheme arm / denied_tools.
  • is_sensitive_key is token-bounded. Needles were substring-matched (key.contains), so "auth" hit author / authorization and "card" hit discard. Those keys then forced RequireApproval and redacted. Match is now exact or token-boundary on the listed names (credit_card still flags).
  • Tests in tests/action_policy.rs: navigate_domain_check_is_case_insensitive, sensitive_key_match_is_token_bounded.

Out of scope

Proof

Ran locally on Rust 1.98.1:

  • cargo test --all-targets --locked — pass (including navigate_domain_check_is_case_insensitive and sensitive_key_match_is_token_bounded)
  • cargo clippy --all-targets --locked -- -D warnings — pass
  • Diff confined to src/agent/policy.rs and tests/action_policy.rs
Open in Web Open in Cursor 

…keys

target_domain compared tool_name == "navigate", so NAVIGATE/Navigate
scheme-checked then applied allow/deny to the current page. Sensitive-key
needles used substring contains, so auth hit author/authorization and card
hit discard.

Co-authored-by: Jimthetaxguy <Jimthetaxguy@users.noreply.github.com>
@Jimthetaxguy
Jimthetaxguy marked this pull request as ready for review September 13, 2026 08:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 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-13T08:25:53.225120Z 7a671e7 Draft marked ready
ℹ️ 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 chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a671e7130

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agent/policy.rs
]
.iter()
.any(|needle| key.contains(needle))
.any(|needle| contains_token(&key, needle))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep authorization credentials classified as sensitive

When a tool accepts the conventional authorization argument containing a bearer credential, this boundary rule now deliberately treats it as non-sensitive; it similarly misses common camelCase keys such as accessToken and cardNumber. Compared with the parent implementation, these values neither trigger RequireApproval nor get redacted before decision.redacted_arguments is emitted in agent events, exposing credentials to callers and audit consumers. Preserve recognition of credential-bearing compound names while excluding actual false positives such as author and discard.

Useful? React with 👍 / 👎.

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.

2 participants