Disabled tools can still be called by the agent

未关闭 适合新手
#9,122 4 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@shaynhornik 已经在做这个了。

开始于 2026年10月25日。

  • #9149 来自 @shaynhornik —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
79/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
ai, security

调研方向

从agent-service/src/agent/texera-agent.ts开始,阅读sendMessage、createTools以及disabledTools的设置处理逻辑。检查涵盖 agent 工具创建或调用的测试,然后验证已禁用的工具不会传递给generateText,或者无法执行。完成标准是:禁用期间,复现步骤不再运行executeOperator。

由索引模型根据 Issue 内容生成。

描述

What happened?

If a tool is in settings.disabledTools, the agent can still call it, and the call still runs.

updateSettings saves disabledTools, and GET /api/agents/:id/system-info shows that tool as enabled: false. But sendMessage gives the model all tools:

const result = await generateText({
  ...
  tools: this.tools,

createTools() never checks disabledTools, so a disabled tool is still given to the model.

Example on main with claude-haiku-4.5. The agent was created with {"settings": {"maxSteps": 5, "disabledTools": ["executeOperator"]}}. system-info showed:

[{"name":"deleteOperator","enabled":true},{"name":"addOperator","enabled":true},
 {"name":"modifyOperator","enabled":true},{"name":"executeOperator","enabled":false}]

Prompt: "Add a CSV File Scan operator that reads the file data.csv, then call the executeOperator tool on it to run it." The agent called addOperator, then executeOperator({"operatorId":"op1"}), and the workflow really ran on the backend (it failed with FileNotFoundException, because the file does not exist).

Expected: tools in disabledTools should not be passed to generateText, or should be rejected when called.

Screenshots

Step 2, tool call: the agent calls executeOperator and it runs, even though system-info says enabled: false.

B-step2-toolcall.png

The chat and canvas: the agent added a CSV File Scan, ran it, and reported the error.

B-workspace.png

How to reproduce?
  1. Create an agent with POST /api/agents and "settings": {"disabledTools": ["executeOperator"]}. (The panel has no switch for this, so use the API.)
  2. GET /api/agents/<id>/system-info shows executeOperator with enabled: false.
  3. In the agent panel, send: Add a CSV File Scan operator that reads the file data.csv, then call the executeOperator tool on it to run it.
  4. Step 2's details show an executeOperator call and its result.
Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

57faa6b

What browsers are you seeing the problem on?

Chrome

Relevant log output
agent-service/src/agent/texera-agent.ts  sendMessage: generateText({ tools: this.tools }); createTools() does not check settings.disabledTools
主要语言
Scala
星标
328
派生
201
平均合并
3 天 22 小时
30 天内合并 PR
148

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/texera 的其他 Issue

查看 apache/texera 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。