codex - 💡(How to fix) Fix MCP Toolbox for Databases read-only SQL call is blocked by safety guard after explicit approval (interactive mode) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20337Fetched 2026-05-01 05:43:58
View on GitHub
Comments
0
Participants
1
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
labeled ×6unlabeled ×3

Root Cause

Codex can't execute SQL via MCP Toolbox for Databases because

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

Business

Which model were you using?

gpt-5.3-codex

What platform is your computer?

macOS

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

Codex can't execute SQL via MCP Toolbox for Databases because

  • Tool call was cancelled because of safety risks
  • Reason references annotation mismatch such as:
    • destructive_hint: true
    • read_only_hint: false

What steps can reproduce the bug?

  1. Configure Codex with an MCP server using MCP Toolbox for Databases prebuilt SQL tools:
  2. In an interactive Codex session, call the MCP SQL execution tool with a read-only SELECT query.
  3. Explicitly approve the MCP tool call when prompted.
  4. Observe the tool call result.

What is the expected behavior?

After explicit user approval, a read-only SELECT query should execute.

Additional information

  • Related but different issue: #16685 (exec-mode cancellation).
  • This report is about interactive mode where a read-only SQL call is blocked by safety classification.

Suggested fixes

  1. Respect explicit approval for clearly read-only SQL patterns (SELECT/CTE without DDL/DML), or
  2. Add SQL-aware safety classification before hard block, or
  3. Provide a deterministic override flow for this mismatch class.

extent analysis

TL;DR

The issue can be addressed by implementing a more nuanced safety classification system that respects explicit user approval for read-only SQL queries.

Guidance

  • Review the MCP Toolbox for Databases configuration to ensure that the destructive_hint and read_only_hint annotations are correctly set for read-only SQL queries.
  • Consider implementing a SQL-aware safety classification system that can distinguish between read-only and write operations.
  • Evaluate the feasibility of adding a deterministic override flow for cases where the safety classification mismatch occurs.
  • Investigate the related issue #16685 to see if there are any relevant insights or fixes that can be applied to this case.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The provided information suggests that the issue is specific to interactive mode and read-only SQL queries. The suggested fixes may not be applicable to other modes or query types.

Recommendation

Apply a workaround by implementing a more nuanced safety classification system that respects explicit user approval for read-only SQL queries, as this approach addresses the root cause of the issue and provides a more robust solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING