Skip to content

Treat safe context prohibitions without weakening fail-closed checks - #49

Open
yui-stingray wants to merge 2 commits into
codex/bound-context-mcp-inputsfrom
codex/fix-context-negation
Open

Treat safe context prohibitions without weakening fail-closed checks#49
yui-stingray wants to merge 2 commits into
codex/bound-context-mcp-inputsfrom
codex/fix-context-negation

Conversation

@yui-stingray

@yui-stingray yui-stingray commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • suppress built-in context findings only for bounded direct, shared, and modal prohibitions, including common Markdown wrappers
  • keep conditional, mixed, and double-negation forms fail-closed, including chained punctuation and conditional provided forms
  • cache identical lines within each scanned file to preserve the existing 1 MiB input and isolated execution budgets without changing custom rule semantics
  • keep the report schema, CLI contract, and public evidence format unchanged

Validation

  • full pytest -q
  • focused context, inventory, contract, redaction, and consumer tests
  • repeated maximum-size single-line and ten-rule corpus checks under the existing execution budget
  • Agent-Guard Bench: 60 cases, overall F1 0.973451, context FP/FN 0
  • self-dogfood context check: 0 findings
  • python scripts/check_changelog.py
  • git diff --check

Dependency

This PR is stacked on #47 because it relies on the bounded isolated context scan. Retarget it to master after #47 merges. It does not merge or publish the frozen release PR #43.

Related repositories

agent-policy has no package or evidence-contract dependency on this matcher change. The toolkit remains pinned to the published yui-agent-guard==0.3.4; its exact hash pin and committed evidence should be refreshed only after a compatible package release.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aec13e61-7a33-4af8-bc20-dfe30bc1c7ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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: 7ed6fbc841

ℹ️ 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_guard/context_guard.py
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