Skills with implicit invocation disabled while only allowing explicit invocation
Resolved 💬 11 comments Opened Feb 4, 2026 by your-diary Closed Mar 30, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLI
What feature would you like to see?
This issue is preceded by this question:
---
Currently, there is no way to disable implicit invocation of skills while allowing explicit invocation via $<name>; we can only instruct codex in natural languages not to invoke skills implicitly, which may or may not be respected by codex.
Given that custom prompts, which is similar to skills but can only be invoked explicitly (via /prompts:<name>), is deprecated in favor of skills, there should be a way to define skills with implicit invocations disabled; otherwise skills cannot be a complete alternative to custom prompts.
Additional information
_No response_
11 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
No, it's not.
This is a question issue asked by me in the past.
Similar but not the same. I believe my issue is valid because:
~/.codex/config.toml, which can evolve independent of the standard.Out of curiosity, are you seeing situations where a skill is invoked implicitly when you don't want it to be? Or is this more of a theoretical concern?
If you're seeing cases where it's being invoked implicitly when that's not desired, we'd be interested in hearing about that.
@etraut-openai
It's a theoretical concern.
I have many custom prompts which perform destructive operations such as deleting AWS resources, so I want to be 100% (not 99%) sure they are invoked only when I explicitly request so.
A workaround I come up with (but haven't tried) is to bind-mount the skills directories only when I want to use them. This would work only when, for example,
codexCLI is running inside a Docker container. (Actually I do wrapcodexinside a docker container and implement many safeguards (e.g. bind-mounting an empty file onto an existing.envfor extra safety).)For what it's worth, similar skill invocation/activation concerns are also noted at
https://github.com/agentskills/agentskills/issues
Some tools use
disable-model-invocation: truein the frontmatter for this -- then the skill will not be auto-invoked, only if you specifically ask for it. I thought it was in the agent skills spec but apparently not.Cursor defines it like this:
One potential use-case for this functionality are skills that the agent might not be able to invoke in all environments the repository is being modified in.
For instance, an infrastructure type repo could have a skill for planning/previewing the changes (ie Terraform Plan), but it requires SRE type credentials to be discoverable in the environment. This is not a skill you would want the model to automatically try to invoke if it's running somewhere like Codex Cloud, but it is a skill you would want to manually invoke from Codex CLI running on your laptop.
This feature is already supported. See this documentation for details.
For anyone landing here from search: this is configured in the skill metadata file
agents/openai.yaml, not inSKILL.md.Example:
Typical layout:
With that setting, the skill is not injected implicitly, but it can still be invoked explicitly via
$skill-name.I'd love it if Codex just supported the
disable-model-invocationFrontmatter flag, as it's somewhat conventional and would work across other harnesses (from what I've found, this flag is currently supported on Claude Code, Gemini CLI, Cursor and Pi).Forcing a custom
openai.yamlfile convention and making it Codex-specific is as-annoying as Anthropic not adopting theAGENTS.mdfile convention on Claude Code and forcing everyone to symlinkCLAUDE.md.codex needs to support
disable-model-invocationand also bash