Skip to content

fix(ai): the mcp benchmark tool takes no file path - #2738

Merged
dan-petty merged 5 commits into
mainfrom
fix/2704-mcp-benchmark-no-path-options
Oct 30, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/2704-mcp-benchmark-no-path-options

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The MCP tool ai_benchmark no longer publishes the options output, document and code.

Why: the model that calls the tool gives each value, and no guard checked it. output made the command write a report to a path that the model chose. document and code made the command read a file or a tree that the model chose and send its text to a model server. The tool needs none of them: it returns the report in its reply, and the embedding benchmark has a built-in corpus. A model must not choose a path that the tool writes or reads on the host. Confinement to the workspace was rejected: a model could still read or replace any file in the workspace.

  • The entry of ("ai", "benchmark") in _PATH_PARAM_RESTRICTIONS leaves out the three options. A call that gives one fails at the argument contract, before any command runs.
  • devops ai benchmark keeps --output, --document and --code for a person.
  • The help text of --samples names no flag, so the tool description does not name --code. A contract test holds that no tool text names a flag that the tool leaves out.
  • SECURITY.md principle 11 names a file path that a model gives.

Change: openspec/changes/archive/2026-10-30-2704-mcp-benchmark-no-path-options/

Closes #2704

@dan-petty dan-petty added scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak labels Oct 30, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Targeted tests on the rebased branch: 290 passed (tests/test_ai_benchmark_mcp_tool.py, test_fastmcp_contracts.py, test_mcp.py, test_ai_benchmark.py). Docs generation shows no diff. devops openspec archive validated.

Fail-to-pass of the first test commit (base origin/main, file .data/agent/sec/f2p-2704.txt): 4 failed on base: the schema test and the refusal tests for output, document and code.

  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_a_model_endpoint_is_refused_and_reaches_no_socket[second entry]
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_tool_dials_the_configured_server_at_the_configured_level[loopback without the flag]
  failed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_a_path_argument_is_refused_and_touches_no_file_and_no_socket[document]
  failed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_tool_publishes_no_servers_and_no_path_parameter
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_command_runs_on_the_server_that_a_person_types[model endpoint]
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_command_runs_on_the_server_that_a_person_types[servers]
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_a_servers_argument_is_refused_and_reaches_no_socket
  failed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_a_path_argument_is_refused_and_touches_no_file_and_no_socket[code]
  failed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_a_path_argument_is_refused_and_touches_no_file_and_no_socket[output]
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_tool_dials_the_configured_server_at_the_configured_level[private without the flag]
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_tool_benchmarks_each_model_on_the_configured_server
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_a_model_endpoint_is_refused_and_reaches_no_socket[one entry]
  passed on base: tests.test_ai_benchmark_mcp_tool.TestBenchmarkToolTakesNoServerUrlFromTheModel::test_the_tool_dials_the_configured_server_at_the_configured_level[private with the flag]
4 failed on base
4 failed on base (4 failed and 9 passed in tests/test_ai_benchmark_mcp_tool.py; 0 errored).

The later test commit (no tool text names an unpublished flag) failed on the old help text with ai_benchmark: --code.

@dan-petty
dan-petty marked this pull request as ready for review October 30, 2026 01:40
@dan-petty
dan-petty merged commit 5d5da15 into main Oct 30, 2026
18 checks passed
@dan-petty
dan-petty deleted the fix/2704-mcp-benchmark-no-path-options branch October 30, 2026 01:40
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.21.4](v0.21.3...v0.21.4)
(2026-10-30)


### Bug Fixes

* **ai:** name each prewarm server by host and port
([#2737](#2737))
([2e2e4fa](2e2e4fa)),
closes [#2676](#2676)
* **ai:** the mcp benchmark tool takes no file path
([#2738](#2738))
([5d5da15](5d5da15)),
closes [#2704](#2704)
* **config:** redact a removed credential in the config copies
([#2734](#2734))
([f663344](f663344)),
closes [#2645](#2645)
* **rag:** name the Qdrant server by host and port
([#2733](#2733))
([39aca9d](39aca9d)),
closes [#2709](#2709)
* **roadmap:** tick turn and kept diff for implement steps
([#2744](#2744))
([890d2a6](890d2a6)),
closes [#2721](#2721)
* **security:** refuse the gh and kubectl keys that run a program
([#2732](#2732))
([ad0bdf1](ad0bdf1)),
closes [#2672](#2672)
* **security:** refuse the keys that make a child write a file
([#2746](#2746))
([1cd187e](1cd187e)),
closes [#2674](#2674)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): the mcp tool ai_benchmark takes file paths from the model

1 participant