You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FEATURE: Plugin API - per-agent tool visibility filtering #24953
When a plugin registers tools via Hooks.tool in the plugin API, all tools are globally visible to every agent in the LLM context. There is no mechanism to scope tool visibility to specific agents.
This creates issues for plugins that want to register domain-specific tools (e.g., security assessment tools, admin tools, privileged operations) that should only be accessible by a designated agent - not by every agent the user switches to.
Example Use Case
A security plugin registers security scanning tools. These should only be visible to a cybersec agent. When the user switches to sisysphus (general coding), those tools should not appear in the LLM's tool context at all - they should not even be suggested.
Current Limitations
AgentConfig.tools only controls execution permission, not LLM context visibility
tool.execute.before can block execution but the tools are still visible and suggested by the LLM
System prompt injection discourages use but does not hide the tools
oh-my-openagent's disabled_tools only filters its own internal tool list, not OpenCode core's plugin tool registry
Proposed Solution
Option A - New hook: Add a tool.definition hook that receives agent/session context:
This would allow plugins to dynamically hide tools per-agent by setting hidden: true.
Option B - Expand AgentConfig.tools to have a visibility-only mode where tools set to false are stripped from context entirely, not just blocked at execution time.
Option C - Allow the config hook to specify per-agent tool context filtering beyond just execution permission.
Workaround
Currently using a 3-layer defense:
tool.execute.before throws error blocking execution for non-allowed agents
experimental.chat.system.transform injects a restriction notice
AgentConfig.tools whitelist set to false for non-allowed agents
But the tools still appear in the LLM's function-calling context, wasting tokens and occasionally causing the LLM to attempt usage even with system prompt discouragement. True per-agent tool hiding requires OpenCode core changes.
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: Granular per-agent tool permissions (allow/deny individual tools) #17607: [FEATURE]: Granular per-agent tool permissions (allow/deny individual tools) — this issue also requests per-agent tool filtering/visibility control, overlapping significantly with this request. The distinction (execution permission vs. LLM context visibility) may be worth discussing there rather than in a separate issue.
This would be a fantastic feature.. FYI; we tried gutting "tool.definition" description and parameters, but parameters cannot be altered, only the description.
Activity
github-actions commentedon Apr 29, 2026
This issue might be a duplicate of existing issues. Please check:
practicusai commentedon Jun 23, 2026
This would be a fantastic feature.. FYI; we tried gutting "tool.definition" description and parameters, but parameters cannot be altered, only the description.
github-actions commentedon Aug 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.