Repository navigation
AST-197171 - Enable severity threshold for Codex with Critical & High default - #1640
Open
cx-kedar-bhujade wants to merge 1 commit into
Open
cx-kedar-bhujade wants to merge 1 commit into
cx-kedar-bhujade wants to merge 1 commit into
Conversation
… default Add thresholdApplies: the agents switchesApply covers, plus Codex. Codex now honours cx_severity_threshold (default high: only Critical and High block) without also getting the scanner switches or the secrets engine, which switchesApply and secretsApply still control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 of 18 tasks
cx-kedar-bhujade
commented
Dec 4, 2026
| // thresholdApplies reports whether cx_severity_threshold is honoured for this agent: every agent | ||
| // switchesApply covers, plus Codex. It is separate from switchesApply so Codex gets the severity threshold | ||
| // without the scanner switches and the secrets engine. Add an agent here to give it the threshold only. | ||
| func thresholdApplies(agent agenthooks.AgentID) bool { |
Contributor
Author
There was a problem hiding this comment.
Why a separate check: switchesApply gates three things, and Codex should get only one of them.
switchesApply -> scannerOn (scanner on/off switches)
-> secretsApply (secret detection engine)
thresholdApplies -> belowThreshold, defaultThresholdRank
Removing Codex from switchesApply would also start secret detection for Codex. Its deny tells the agent to use cx-devassist-secrets, which the Codex plugin does not have. To give another agent the threshold only, add it here.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, you agree to the terms within the Checkmarx Code of Conduct. Please review the contributing guidelines for guidance on creating high-quality pull requests.
Description
Codex now honours
cx_severity_thresholdfrom~/.checkmarx/cx-onboarding.properties. When the setting is not set, only Critical and High findings block a Codex write.This PR is stacked on #1626 and targets its branch, so the diff shows only the Codex change.
The flow, in hooks.go:
belowThreshold(agent, severity)for each finding.belowThresholdnow asks the newthresholdApplies(agent)instead ofswitchesApply(agent).thresholdAppliesreturns true for every agentswitchesApplycovers, plus Codex.defaultThresholdRankuses the same check, so Codex falls back tohighwhen the setting is blank, missing or invalid.Important
Codex gets only the severity threshold.
switchesApplyandsecretsApplyare unchanged, so Codex still ignores the scanner on/off switches and does not run secret detection. The Codex plugin has no secrets skill, so enabling secret detection there would block writes with instructions the agent cannot follow.cx_severity_threshold(Codex)highcriticalmediumlowUnchanged: Claude, Copilot, Droid and Windsurf; Cursor and Gemini still ignore the threshold. Malicious packages and an empty severity still always block; None/Unknown still never block (from #1626).
Type of Change
Related Issues
Validation
go test -count=1 ./internal/commands/agenthooks/...— passed. New tests cover the Codex default, each threshold value, an invalid value and an empty severity; existing tests still check that Codex ignores the scanner switches and secret detection.golangci-lint run -c .golangci.yml ./internal/commands/agenthooks/cx/...— no findings on changed lines.Documentation updates
Checklist
Additional Notes
Merge #1626 first. The Codex plugin's minimum
cxversion has not been bumped yet, because the release number is not known.🤖 Generated with Claude Code