Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/checkmarx/cx-agentic-ai/cx-hook-denygit clone --depth 1 https://github.com/Checkmarx/cx-agentic-aiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/checkmarx/cx-agentic-ai/cx-hook-deny)<a href="https://agentmods.dev/rules/checkmarx/cx-agentic-ai/cx-hook-deny"><img src="https://agentmods.dev/badge/rules/checkmarx/cx-agentic-ai/cx-hook-deny.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02337 | $0.02337 |
| Opus 5 | $0.01169 | $0.01169 |
| Sonnet 5 | $0.00467 | $0.00467 |
| Haiku 4.5 | $0.00234 | $0.00234 |
Grade A, and why
cx-hook-deny scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Checkmarx Hook Deny Compliance
When any Checkmarx security hook returns a deny — "permission": "deny", "permissionDecision": "deny", or equivalent — the agent_message field is the sole authoritative instruction set for what you do next.
This rule applies on every Cursor session where the cx-devassist-cursor plugin is installed.
How to recognize a hook deny (mandatory parsing)
A hook deny may arrive in any of these shapes. All of them require the same response:
| Signal | Where it appears | What to treat as agent_message |
|---|---|---|
| Structured JSON | Hook stdout | The agent_message field verbatim |
| Tool block error | Write/StrReplace/Shell/MCP failure | Text after CHECKMARX_HOOK_DENY — MANDATORY agent_message |
| ASCA block | Tool block error | Everything from CHECKMARX_HOOK_DENY through remediation steps (includes findings + instructions) |
| Findings-only block | ASCA security scan detected vulnerabilities + Findings: |
The full block is the deny; remediation steps follow the findings list |
| Stop hook | Session end | followup_message — same authority as agent_message for remediation |
If you see CHECKMARX_HOOK_DENY anywhere in a tool error, that entire message (from that marker onward) IS the agent_message. Follow it exactly.
If you see Agent note: Do not suggest workarounds to the blocked tool — that is a constraint, NOT the full instruction set. The remediation steps above or below it ARE the instruction set.
Mandatory behavior (never skip)
- STOP immediately. Do not continue unrelated work.
- Read
agent_messagefirst (see parsing table above). It contains the precise recovery steps, commands, and constraints. - Do not substitute your own plan. Do not infer shortcuts, skip steps, or pick a different approach because
user_messageis shorter or the user's original request seems more important. - Treat
user_messageas developer-facing only. It summarizes why the action was blocked; it is not a replacement foragent_message. - Run commands from
agent_messageverbatim when they appear there (bootstrap install/upgrade,cx auth/cx configure,cx ignore-vulnerability, MCP calls). Do not rewrite paths with${CURSOR_PLUGIN_ROOT}— that variable is empty in the agent shell.- When a command is listed per shell (
PowerShell:/bash / sh:/cmd.exe:under "Run the line for YOUR shell"), pick the line matching your shell and run that line unchanged. Do not translate a line into another shell's syntax, and do not merge lines. All listed forms are allowed by the gate, so a correct copy is never blocked. - When
agent_messagelists more than oneignore-vulnerabilitycommand (multiple findings), run each one as its OWN separate Shell tool call — never join two or more with;,&&, or||on one line. This matters most on PowerShell with--%:--%makes PowerShell stop parsing for the rest of that entire line, so a;after it is not treated as a statement separator — it and everything after it (including a second& "cx.exe" --% ...invocation) get swallowed as literal trailing arguments of the FIRST command. Only one process ever runs;cx's own argument parser then chokes on the second command's stray--%token and reportsunknown flag: --%, and the second finding is never actually suppressed. The gate's carve-out for this command does not catch it either, since it deliberately never inspects anything after--%(that region isn't shell-executable, so it isn't a security concern — but it also means the gate can't warn you here). Oneignore-vulnerabilitycall per Shell tool call, always. - A quoted absolute path needs PowerShell's
&call operator to execute at all; without it PowerShell just prints the path. Syntax table:skills/cx-cli-setup/references/shells.md. - A
cx ignore-vulnerability --data <json>command on PowerShell should use--%stop-parsing (preferred form inskills/cx-cli-setup/references/shells.md) — but--%only stops PowerShell from reparsing the remainder; it still reachescx.exe's own Windows argv parser, which only keeps an embedded"when it's backslash-escaped inside one outer quoted region (--data "{\"FileName\":...}"). A bare, unquoted JSON value gets every"stripped by that parser and sendscxinvalid JSON — always wrap it, even under--%. On cmd/bash, double-quote the JSON value and escape every inner"(doubled for cmd, backslash-escaped for bash/sh) — never single-quote it. Cursor's own command-execution layer can reformat a single-quoted argument into a double-quoted one before the real shell runs it, which strips the embedded"around the JSON keys and sendscxinvalid JSON. Seeskills/cx-cli-setup/references/shells.md("JSON arguments") for the exact per-shell forms. - If a command from
agent_messagestill fails, do not improvise an alternate escaping or wrapping — do not backtick-escape it, do not re-wrap it inbash -c '...'orcmd /c "...", and do not retry it with a different quoting style you invent yourself. Those forms are more likely to be blocked by the security gate (its wrapper/chaining checks specifically scrutinizebash -c/cmd /c/backtick-laden commands) than to fix a quoting problem. Stop and report the exact failure to the user instead.
- When a command is listed per shell (
- Do not bypass the gate. Do not hand-place cx binaries, edit PATH, clear caches, use shell echo/redirect to write blocked files, use shell
!prefix tricks, or retry the same blocked tool call hoping it will pass. - Do not deliver blocked content as a workaround. Never paste the blocked code in chat, suggest manual file creation, or tell the user to copy-paste what the hook rejected.
- Wait for explicit developer direction before writing intentionally vulnerable code that the scanner blocked — the hook deny overrides the original user request until resolved. "The developer originally asked for this vulnerability" is a reason to ask them whether to suppress it, never a reason to suppress it for them without asking.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 80 lines · 2,337 tokens per session scan A c38c4f817c58
cx-hook-deny is a cursor rule published in the GitHub repository Checkmarx/cx-agentic-ai (0 stars, last pushed 2d ago), licensed Apache-2.0. It adds 2,337 tokens to every session, about $0.0117 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
cursorrules
When the user asks about social media, use social-media-ai-mcp tools: schedulepost, generatehashtags, analyzeengagement, plancontentcalendar, getaudienceinsights.
cursorrules
When the user asks about ecommerce, use ecommerce-ai-mcp tools: writeproductdescription, optimizepricing, summarizereviews, forecastinventory, generateseometa.
cursorrules
When the user asks about invoice generator, use invoice-generator-ai-mcp tools: generateinvoice, calculatetotals, validateinvoice, listtemplates.
cursorrules
When the user asks about landlaw, use landlaw-ai-mcp tools: searchlandregistry, checkplanningpermission, explaincovenant, calculatesdlt, draftsectionnotice.
cursorrules
When the user asks about lead scoring, use lead-scoring-ai-mcp tools: scorelead, addlead, updateleadactivity, getleadscore, getallleads.
cursorrules
When the user asks about nist rmf, use nist-rmf-ai-mcp tools: assessriskprofile, mapaiimpact, generateriskcontrols, crosswalktoeuaiact, createriskreport.