-
Notifications
You must be signed in to change notification settings - Fork 65
feat: add private research controls on top of URL denylist #1112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ElegantLin
wants to merge
4
commits into
main
Choose a base branch
from
feat/research-url-block-policy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ec3a49b
feat: add private filtered research policies
ElegantLin 43dae53
test: link research policy regressions to PR
ElegantLin 6a0a9c6
fix: route Claude subscription auth through research gateway
ElegantLin 47cf868
fix: harden research policy live paths
ElegantLin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Filtered web research | ||
|
|
||
| Some research benchmarks need ordinary Internet access while keeping a small | ||
| set of papers or answer-bearing pages unavailable. Use a private, run-scoped | ||
| research policy: | ||
|
|
||
| ```bash | ||
| bench eval run \ | ||
| --tasks-dir tasks/my-research-task \ | ||
| --agent codex-acp \ | ||
| --sandbox docker \ | ||
| --research-policy /secure/frontierphysics-policy.yaml | ||
| ``` | ||
|
|
||
| The policy is deliberately not part of the task package. Do not commit it next | ||
| to `task.md`, put its values in a prompt, or pass it through `--agent-env`. | ||
|
|
||
| ## Policy format | ||
|
|
||
| ```yaml | ||
| version: 1 | ||
| tasks: | ||
| my-research-task: | ||
| blocked_urls: | ||
| - https://example.org/papers/answer.html | ||
| blocked_url_prefixes: | ||
| - https://example.org/supplements/answer | ||
| blocked_hosts: | ||
| - private-corpus.example.org | ||
| blocked_terms: | ||
| - Exact Paper Title | ||
| - 10.1234/example.doi | ||
| blocked_content_sha256: | ||
| - 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | ||
| ``` | ||
|
|
||
| Every selected task needs its own entry. A missing task or an entry that blocks | ||
| nothing stops the run. `blocked_urls` ignores query strings, fragments, and an | ||
| HTTP/HTTPS scheme change. `blocked_url_prefixes` also covers descendant paths. | ||
| `blocked_hosts` includes subdomains. Terms are case-insensitive and filter both | ||
| search-result titles and fetched text; content hashes cover exact binary or text | ||
| bodies. | ||
|
|
||
| The optional top-level `search_endpoint` selects an HTTP(S) search HTML | ||
| endpoint. It defaults to DuckDuckGo's Lite HTML endpoint. | ||
|
|
||
| ## Enforcement model | ||
|
|
||
| On Docker, BenchFlow disables each harness's native web tools and provides the | ||
| same `benchflow-research` MCP server to ACP and native-MCP-config agents. It | ||
| offers `web_search`, `web_fetch`, and `web_download`. The server talks only to a | ||
| root-owned loopback gateway, which checks the destination, every redirect, and | ||
| the returned content. | ||
|
|
||
| The model provider uses a separate loopback proxy. Before the agent process is | ||
| launched, an owner-based IPv4/IPv6 firewall blocks every other connection from | ||
| the sandbox user. This prevents `curl`, sockets, or an unregistered harness tool | ||
| from bypassing the gateway. Private, loopback, link-local, and other non-global | ||
| fetch destinations are rejected to prevent SSRF. | ||
|
|
||
| Claude subscription authentication cannot be translated through LiteLLM because | ||
| there is no operator-owned API key. In that mode, the research gateway also | ||
| provides a fixed-destination loopback relay for the native Anthropic protocol. | ||
| The relay forwards only to `api.anthropic.com`; it is not a general HTTP proxy, | ||
| and rejects provider-side web-search/web-fetch tools plus remote MCP requests, | ||
| so the sandbox user remains unable to connect directly to research sites. | ||
|
|
||
| Policy-enabled runs currently require Docker, Python 3 in the task image, and a | ||
| non-root `sandbox_user`. Unsupported sandboxes and already-started external | ||
| sandboxes fail closed. | ||
|
|
||
| `config.json` records only the resolved policy SHA-256, rule counts, and whether | ||
| the gateway plus firewall became active. The private path and all rule values | ||
| are omitted from durable worker payloads and rollout artifacts. | ||
|
|
||
| This mechanism can guarantee that the sandbox cannot directly retrieve the | ||
| listed resources. It cannot guarantee that a model has never seen a paper in | ||
| pretraining or that an unlisted mirror/citation cannot reveal its existence. | ||
| Use terms, content hashes, and URLs for known mirrors when discovery leakage is | ||
| part of the benchmark threat model. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Resumes mix research policies
Resuming with a changed or removed policy leaves completed tasks skipped.
_check_resume_mismatchignoresresearch_policy_path, so final scores combine different access rules.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.