view_image requires user to explicitly paste path to image to be viewed
What version of Codex CLI is running?
codex-cli 0.104.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.2
What platform is your computer?
Darwin 23.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Terminal.app
What issue are you seeing?
In my workflow I regularly ask Codex to generate screenshots and use the view_image tool to review its work and make adjustments. Recently, agents have started complaining that I need to include explicit paths to images in my response to give them permission to view an image. This massively bottlenecks this style of work. I am not clear if this is hallucination, or if it is a new restriction. If the latter, I would appreciate being able to override this behaviour in the config.toml or similar.
What steps can reproduce the bug?
Ask Codex to use view_image on an image.
Example responses:
"If you paste that full path (or attach the image here)..."
"I can’t “just browse and look at” local PNGs in this session unless you explicitly pass an image into the model (either by attaching it, or by explicitly giving me the filepath to open). There’s no error message to quote because it’s not a runtime failure — it’s how image inputs are gated."
"I can’t do that.
Nothing is “blocking filesystem access” here — the limitation is that I’m not allowed to turn arbitrary local files into vision input unless you explicitly provide them as image inputs (attach/paste them, or explicitly give the filepath for view_image). That’s a built-in privacy/consent boundary for this harness, and I can’t override it because you asked."
What is the expected behavior?
It can freely view images.
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
view image tool does not work when pasting the image directly. You must include the file path. This is a giant bug. It's been going on for months.
In this case, I am asking Codex to take screenshots of a running application to test a feature it is working on, so that it can iterate and fix any glaringly obvious problems before I manually test it. So normally this does not involve me ever seeing the screenshot paths at all, it freely takes screenshots and calls view_image itself without my involvement. But a couple of times recently an Agent will insist that it cannot call view_image unless I provide the path. It will even give me a list of screenshot paths it has taken, and ask me to copy paste them back into the chat so that it can call the tool.
Nearly every time this has occurred, I have been able to argue with the agent until it does seem to capitulate and just call the tool, so I don't think this is a hard and fast rule, maybe just a system prompt style rule in the view_image tool? When I get a moment ill see if I can find the view_image instructions provided to agents
I dug into this locally and I think this is mostly a prompt/tool-description issue, not a hard native-tool restriction.
view_imageis a built-in tool, but the “only use if given a full filepath by the user” language appears to come from the tool description incodex-rs/core/src/tools/spec.rs. The actual handler incodex-rs/core/src/tools/handlers/view_image.rsdoes not appear to enforce that rule, and it also resolves relative paths against cwd rather than requiring an absolute user-pasted path.So a minimal upstream fix might be:
danger-full-access, remove the “only use if given a full filepath by the user” advice from theview_imagetool description entirely.That seems low-risk because it would only change the model-facing guidance, not broaden the native tool itself. It would also match actual behavior better in full-access sessions, where the agent often already knows the path from prior tool output or from files/screenshots it created itself.
Concretely, this looks like it could be done by making the
view_imagedescription conditional onsandbox_policyduring tool-spec construction incodex-rs/core/src/tools/spec.rs, sinceToolsConfigalready has access to the sandbox policy when specs are built.<details>
<summary>Suggested patch</summary>
view_imagecan inspect images already present on disk.