Add interception example environments - #2178
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d41b94349e
ℹ️ 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".
ApprovabilityVerdict: Approved ff31809 Adds 4 self-contained example environments demonstrating interception patterns, with minimal core changes: publicly exporting an existing function and adding an optional disabled-by-default You can customize Macroscope's approvability policy. Learn more. |
295cec1 to
7aae47f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7aae47f960
ℹ️ 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".
7aae47f to
b1f77a4
Compare
b1f77a4 to
3113425
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 311342505e
ℹ️ 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".
3113425 to
4b92fe4
Compare
8dad0d9 to
b12342b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b12342b8be
ℹ️ 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".
b12342b to
ecb3b4b
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1dde940. Configure here.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |

Overview
This adds four small runnable environments that show the intended
@vf.interceptinterface directly on a task.interception-v1shows deterministic and ordinary LLM judge guards that rewrite matching messages, plus a termination guard that ends the rollout without a replacement message. The judge can use the canonical trace.grayscale-interception-v1shows typed user-message rewriting. It converts every inline image in the user message to grayscale with Pillow, preserves the other content parts, and returns a rewrittenUserMessagebefore the request reaches the model.bash-interception-v1shows that anAssistantMessageinterceptor can replace a Bash tool call before the Bash harness executes it. It records whether the call was intercepted and whether its sentinel side effect occurred.web-search-interception-v1enables Codex's provider-native web search. ItsAssistantMessageinterceptor detects a completedweb_search_call, inspects the search-backed response, and terminates when the response contains a blocked word. Because intercepted responses are buffered, the blocked response does not reach the Codex harness. The provider has already executed the search at that point.What this PR adds
Stack
This is PR 4 of 4. The stack should merge in order:
@vf.interceptand graph-owned rewrites. Adds typed request and response interception and stores canonical rewrites in the trace graph.Terminateand make its reward final. Adds non-retryable early termination and prevents later scoring from changing the terminal reward.Note
Add interception example environments for bash, grayscale, web search, and judge-based blocking
Adds four new example environments under
environments/to demonstrate the@vf.intercept()API across different interception patterns:interception_v1: Shows three intercept handlers — deterministic string blocking, early termination on a marker, and async judge-based blocking with configurable OpenAI/PRIME credentials.bash_interception_v1: Intercepts a specificbashtool call before it executes a sentinel command and rewards successful blocking.grayscale_interception_v1: Rewrites inline base64 image data URLs to grayscale using Pillow before they reach the model.web_search_interception_v1: Terminates rollouts with a positive reward when a Codex web-search response contains a blocked word.searchflag toCodexHarnessConfigthat passesweb_search="live"to the Codex process when enabled.Macroscope summarized ff31809.