Skip to content

Disable web tools in the codex configs; document the cortex-code gap - #7

Open
sfc-gh-dhuang wants to merge 2 commits into
Snowflake-Labs:masterfrom
sfc-gh-dhuang:sfc-gh-dhuang/disallow-web-tools
Open

Disable web tools in the codex configs; document the cortex-code gap#7
sfc-gh-dhuang wants to merge 2 commits into
Snowflake-Labs:masterfrom
sfc-gh-dhuang:sfc-gh-dhuang/disallow-web-tools

Conversation

@sfc-gh-dhuang

Copy link
Copy Markdown
Contributor

Why

The tasks and their reference solutions are public now, so an agent that can reach the web can look up the answer instead of doing the dbt work. The bundled claude-code configs already disable web tools — but the codex configs did not, and the README's instruction to "disable the equivalent browsing tools for other agents" is advice that cannot currently be followed for cortex-code.

What each bundled config does after this

Config Web tools How
claude-code off (already) disallowed_tools: WebSearch,WebFetch
codex off (this PR) web_search: disabled
cortex-code still on no agent option exists yet — see below
terminus-2 (commented fallback) n/a harness has no web/browser tool

codex

Harbor's codex agent already exposes web_search as a CLI flag with choices disabled / cached / live, rendering -c web_search=disabled. So this takes effect immediately, no Harbor change needed. Verified with harbor run --print-config against Harbor 0.21.0:

"kwargs": { "reasoning_effort": "high", "web_search": "disabled" }

cortex-code — included but deliberately commented out

Cortex Code keeps web_search and web_fetch available in every agent mode, including code mode (I checked the mode allow-list — code mode drops the Snowflake data suite, teams, cron, and MCP, but keeps both web tools). Harbor's cortex-code agent has no option to switch them off; harbor#2787 adds disallowed_tools for exactly this.

The line is present but commented, with a pointer to that PR. Leaving it active would be worse than leaving it out: Harbor drops an unrecognised kwarg silently rather than rejecting it, so an active disallowed_tools: line would read as protection while changing nothing. Uncomment once #2787 ships.

README

Replaces the per-agent advice with the table above, states the cortex-code gap plainly, and promotes --allow-agent-host as the stricter control — it's the only one that doesn't depend on agent support, and it's the recommended mitigation for cortex-code in the meantime.

It also now warns that an unrecognised kwarg is dropped silently, so anyone adding a config for a new agent should verify the setting took effect rather than assume it.

Not in this PR

While testing I hit a few README commands that fail on Harbor 0.21.0 (--task-name no longer exists; --env DB_TYPE=duckdb is rejected because --env selects the environment type; the native cortex-code agent needs Harbor >= 0.21.0, not the 0.20.x the README cites). Those are usability rather than integrity, so I've kept them out to keep this focused — happy to send them separately.

The tasks and their reference solutions are public, so an agent that can reach
the web can look up the answer instead of doing the dbt work. The bundled
claude-code configs already disable web tools, but the codex configs did not,
and the README's "disable the equivalent browsing tools for other agents" is
advice that cannot currently be followed for cortex-code.

- codex configs: add `web_search: disabled`. Harbor's codex agent already
  supports this as a CLI flag (`-c web_search=disabled`), so it takes effect
  immediately. Verified with `harbor run --print-config` against Harbor 0.21.0.

- cortex-code configs: Cortex Code keeps `web_search` and `web_fetch` available
  in EVERY agent mode, including code mode, and Harbor's cortex-code agent has
  no option to switch them off. The setting is included but commented out,
  pointing at harbor-framework/harbor#2787, which adds it. It is deliberately
  not left active: Harbor drops an unrecognised kwarg silently rather than
  rejecting it, so an active line would read as protection while changing
  nothing.

- README: replace the per-agent advice with a table of what each bundled config
  actually does, state the cortex-code gap plainly, and promote the
  `--allow-agent-host` network allowlist as the stricter control that does not
  depend on agent support. Also warn that an unrecognised kwarg is dropped
  silently, so a new agent's setting should be checked rather than assumed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@snowflake-security-bot snowflake-security-bot 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.

Snowflake Security Review

Security grade: A — Passed

This PR was classified as LOW risk by the automated pre-screen.

@snowflake-security-bot snowflake-security-bot 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.

Snowflake Security Review

Security grade: A — Passed

This PR was classified as LOW risk by the automated pre-screen.

The previous comment said Harbor had 'no way to switch them off yet', which is
now stale: #2787 is merged. It is not in a release though -- v0.21.0 does not
carry it -- and Harbor drops an unrecognised kwarg silently, so uncommenting
before the next release would read as protection while changing nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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