Repository navigation
Conversation
|
I think this fix is needed. In the current version the permission.skill just doesn't work. I can see the denied skills as well as they can be triggered. I am working on building this project https://github.com/kapilratnani/aienv to create isolated and task specific AI environments. With claude-code i am able to restrict the skills and mcp to the one selected while with OpenCode only mcp works. If permissions is not the way what should we do ? |
|
@kapilratnani Saw your other comment on the other issue. I think the /skills command doesnt let the Agent load the skills on its own, it adds thw whole skill to the context, im thining that is more of a manual/deliberate action from the user forcing the skill text in the context. But in the case of the agent "loading" the skill that seems to still work, if it doesnt for you lease share your config and maybe an example of the skill you are trying to deny and I can check it out and try to repod on my end |
|
i am using this config I tried to trigger a grill-me skill which is installed globally. Then i modified the config to allow the grill-me skill: Prompt : "start a grill me session" - skill loaded. |
|
@kapilratnani This is what i get from you
Second Case
Hope you understand now. So there isnt any issue with the permissions. |
Issue for this PR
Closes #29727
Closes #21793
Type of change
What does this PR do?
Filter
/skillslist by permissions: Theapp.skillsHTTP endpoint now callsskill.available(defaultAgent)instead ofskill.all(), so the/skillsslash command only shows skills the current agent is allowed to use.Hide the
skilltool when globally disabled:ToolRegistry.tools()now checksPermission.disabled(["skill"], ...)and excludes theskilltool entirely whenskill: "deny"orskill: { "*": "deny" }is configured, preventing the model from seeing or calling it.Check permission before loading skill content: In the
skilltool executor,ctx.ask()now runs beforeskill.require(). This ensures the permission gate is evaluated before reading the skill from the in-memory store.How did you verify your code works?
Now the skill doesnt show up in the registry, the model doesnt have knowledge of the skill from initial prompt, even when forced to use that skill, it gets denyed use of the skill.
Screenshots / recordings
Checklist
One caveat: The /skills HTTP endpoint uses the default agent, not the currently active session agent, because the endpoint is instance-level and doesn't receive agent/session context. So if you switch to a subagent with stricter skill permissions, the /skills dialog might still show skills allowed for the default agent. But when that subagent actually runs, its own permissions will filter the tool description and block execution.