Skip to content

Permission deny-all leaves built-in skill tool advertised to the model (re-injected with tool_choice=none on later turns); per-agent tools disable does not remove it #65738

Closed as not planned

Description

@MakSeeSky

Summary

With a fully deny-all permission configuration (root + agent, MCP disabled), OpenCode 2.2.5 strips most tools from the model request, but the built-in skill tool is re-injected into subsequent model requests with tool_choice: "none". Additionally, disabling it via per-agent config (tools: { skill: false }) does not remove it from the toolset either — the same tool_choice: "none" response is returned instead.

Repro

  1. Sandbox profile with:
    • root permission rule { action: "*", resource: "*", effect: "deny" }
    • agent permission rule { action: "*", resource: "*", effect: "deny" }
    • mcp: {} (disabled)
    • (variant) per-agent tools: { "skill": false }
  2. Point the child session's model endpoint at a loopback OpenAI-compatible fixture that records each model request's tools field.
  3. Send a plain prompt (plus one follow-up turn).

Observed

  • Model request feat: compact and other improvements #1: tools_count: 0 — correctly stripped.
  • Model request Roadmap & Existing Issues #2: tools_count: 1, tool_names: ["skill"], tool_choice: "none".
  • With tools: { "skill": false }: same result — skill advertised with tool_choice: "none", not removed.
  • A forced skill(...) tool-call (delivered deterministically via the fixture) is denied by the permission engine before any side effect; no session/request_permission callback is emitted (hard-deny semantics — confirmed).
  • Canary files unchanged; no side effects.

Expected

  • Tools excluded by PermissionNext.whollyDisabled should be filtered from every model request, not only the first.
  • Config-level tool disable (tools: { skill: false }) should remove the tool from the toolset entirely, not merely set tool_choice: "none".

Impact

For hard-sandboxed agent profiles (e.g., a read-only "arbiter" agent that must never invoke tools), the model still sees a tool it must never call. Runtime safety holds (denial-before-side-effect verified, tool_choice: "none" prevents calls at the API level), but the advertised-tool gap weakens defense-in-depth and pollutes model context.

Evidence

Model-request captures from a loopback fixture: tools_count, tool_names, tool_choice, request counts; forced-tool-call denial receipts (terminal failed, canary sha256 unchanged, zero side effects). Full probe implementation and receipts: content/tools/hermes_sandbox/ in MakSeeSky/sdlc-harness (probe tools-boundary-probe/v2, contours A/B).


Activity

  1. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    Thanks for the detailed probe. From the code I read in the repository, V2 is meant to leave out any tool whose last matching permission rule denies it on every resource, and an agent's tools: { skill: false } becomes a deny rule like that. So skill showing up on a later request doesn't look intended.

    One detail stands out, though. In the session runner, the only place I found that sets tool_choice: "none" is the step where the agent's steps limit is reached. Your second request may therefore depend on setup that the report doesn't show. To reproduce this without your harness, could you tell us in your own words, briefly:

    1. Your exact config: the opencode.json(c) and the agent definition, including the permissions rules as written. Also, does the agent set steps?
    2. How the session is started: the TUI, opencode run, an ACP client, or as a subagent of another session (you mention a "child session").
    3. How the fixture provider is configured (the provider entry, without keys), and the prompts for both turns.
    4. Whether this still happens on the latest release, 2.2.7.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

    I didn't find an existing report of this exact problem. These are related, ordered by likelihood:

  2. added
    area/core
    type/bug
    version/v2
    on Nov 23, 2026
  3. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    We're closing this for now because we haven't heard back. To reproduce the skill tool appearing in later requests with tool_choice: "none", we need your exact config (the permissions rules and the agent definition, including whether it sets steps), how the session is started (TUI, opencode run, ACP or as a subagent), and whether it still happens on 2.2.7. Without these we can't confirm what triggers it.

    If you can share those details, just reply here and the issue will reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coretriagingtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions