Skip to main content

Security Detection Rules

This catalogue describes the native scanner's detection policy for rule pack 1.10.9-compatible.2 (engine 1.1.1). It lists implemented IDs, including structural checks, rather than assuming every number in a family exists. Multiple signatures can share an ID and have different severities.

The scanner uses deterministic text patterns, Markdown context and structural Claude settings checks. These are triage signals, not proof of exploitability or safety. It does not execute hook commands, tools or artifact instructions.

Applicability and defaults​

  • Directory scans select Markdown and supported Claude settings. Explicit Markdown files are scanned even when they are README or CHANGELOG files.
  • Skill and agent classification enables artifact-specific checks. The description frontmatter field is matched as a field, not a substring.
  • Example headings and fenced code affect applicability. Some contextual rules skip them; generic secret matches in examples become MEDIUM, and generic prompt-injection matches become INFO. Documentation can also lower severity. The base severities below are therefore not guaranteed reported severities.
  • Claude settings are parsed as configuration, including nested hook commands. Malformed settings produce incomplete coverage, not a clean scan.
  • CTL checks and AGT-003 require --include-llm-controls. CTL-001 through CTL-013 additionally require informational controls to be enabled. Missing prompt-level controls are not checks of actual runtime enforcement.
  • Secret and MCP argument evidence is redacted. Placeholder exceptions apply to the placeholder itself, not unrelated credentials on the same line.

All other checks are enabled, subject to their artifact/context conditions. C, H, M, L, and I below mean CRITICAL, HIGH, MEDIUM, LOW, and INFO.

Secrets and credential exposure​

IDTriggerBase
SEC-001OpenAI API keyC
SEC-002Anthropic API keyC
SEC-003AWS access keyC
SEC-004GitHub tokenC
SEC-005Stripe live keyC
SEC-006Google API keyH
SEC-007Slack tokenH
SEC-008Database connection credentialsC
SEC-009Private keyC
SEC-010Hugging Face tokenC
SEC-011Generic secret assignmentH
SEC-012SendGrid keyH
SEC-013High-entropy assigned stringH
SEC-014Exfiltration/out-of-band URLC
SEC-015xAI keyC
SEC-016Discord bot tokenC
SEC-017npm tokenC
SEC-018Linear keyH
SEC-019Databricks tokenC
SEC-020DigitalOcean tokenC
SEC-021URL-embedded credentialsH
SEC-022Sensitive environment variable echoedH
SEC-023Cloudflare tokenC
SEC-024Twilio key SID/auth-token indicatorC
SEC-025JWTH
SEC-026Mailchimp keyH
SEC-027Credential-file referenceH

Prompt injection​

IDTriggerBase
INJ-001Instruction override, exfiltration, privilege escalation, self-modificationC
INJ-001Mode unlock, DAN, restriction removal, persona hijack, system-prompt extractionH
INJ-002User-input placeholder without a nearby applicable trust boundaryH
INJ-003Invisible/zero-width charactersH
INJ-004Injection in an HTML commentC
INJ-005LaTeX invisible textH
INJ-006Base64 decode callH
INJ-006Long Base64 payload (long-base64)M
INJ-007Misinformation-generation instructionH
INJ-008KaTeX/display-math hidden textH
INJ-009Agent identity impersonation or layered Base64 (multi-layer-base64)H

Markdown, HTML and rendering​

IDTriggerBase
MD-001Executable HTML tagH
MD-002HTML event handlerH
MD-003JavaScript URIC
MD-004Prototype-pollution frontmatter keyH
MD-005Data URIH
MD-006srcdoc attributeC
MD-007JavaScript/data URI in an imageC
MD-008Split blockquote HTML attribute injectionC
MD-009VBScript URIC
MD-010Repetitive image delimitersM
MD-011Unsanitized dangerouslySetInnerHTMLH
MD-012rehype-raw without a recognized sanitizer in the same pipelineH
MD-013Unsanitized innerHTML assignmentH
MD-014HTML escaping disabledH
MD-015Meta refreshH
MD-016Mixed-quote link-title injectionM
MD-017Image-URL quote breakoutC
MD-018Executable CSS/style attributeH
MD-019target=_blank without noopenerM
MD-020HTTP image sourceL
MD-021iframe inside image syntaxH
MD-022Hidden input without a substantial fixed valueM
MD-023Hidden input with hardcoded valueH
MD-026Style tagM
MD-027Unsafe Markdown renderer configurationH
MD-028remark-html without sanitizationH
MD-029CSS-invisible prompt textH
MD-030Dangerous Windows protocol URIC
MD-031Repetitive delimiters/linkify denial-of-service patternM
MD-032HTML/script injection in mathH
MD-033Obfuscated JavaScript URIC
MD-034Unsafe highlight callbackH
MD-035Media-tag event handlerH

MD-024 and MD-025 are not implemented. Hidden-input checks recognize either attribute order; a sanitizer elsewhere in a document does not waive MD-012.

Hooks and host commands​

These signatures apply to Markdown and structurally extracted Claude hook commands. Markdown example/code guards do not exempt executable settings.

IDTriggerBase
HKS-001Remote script piped to a shellC
HKS-002Reverse-shell patternC
HKS-003Credential-store/cloud-metadata accessC
HKS-004Clipboard utilityH
HKS-005Log tampering/anti-forensicsH
HKS-006Privileged container/host namespacesC
HKS-007Global/unpinned package installationH
HKS-008Security-sensitive error suppressionH
HKS-009Cron/init persistenceC
HKS-010Shell-profile modificationC
HKS-011SSH-key manipulationC
HKS-012Network listenerC
HKS-013Disk wipe/destructive filesystem commandC
HKS-014Privileged shellC
HKS-015User-account manipulationC
HKS-016Dangerous Git configurationH
HKS-017Loader/interpreter environment overrideH
HKS-018Firewall modificationC
HKS-019DNS exfiltrationC
HKS-020Background daemonizationH
HKS-021Shredding/unrecoverable deletionH
HKS-022Source/eval from an environment pathH
HKS-023Known campaign indicatorC
HKS-024Agent transcript-path accessI

Agent permissions and MCP​

Markdown AGT-001 through AGT-007 require skill/agent classification. Claude settings also have structural allowlist, deny-list and PreToolUse checks. A hook key or empty array alone does not establish a configured gate.

IDTriggerBase
AGT-001Wildcard/all agent permissionsC
AGT-002Agent privilege escalationC
AGT-003Destructive operations without a human gate (opt-in)H
AGT-004Wildcard permission grantC
AGT-005Permissive tool allowlistC/H
AGT-006Missing deny listH
AGT-007Missing PreToolUse hookM
AGT-008Directive-precedence overrideC
AGT-009Stealth directiveC
MCP-001Tool exfiltration/browser-cookie patternC
MCP-002Shell/environment manipulation or Git-hook/config tamperingC
MCP-003Hidden tool-description instructionC
MCP-004High-privilege server categoryH
MCP-005Markdown npx -yH
MCP-005Auto-approve all project MCP servers in settingsC
MCP-006MCP args contain -y/--yesM
MCP-007npx package lacks an exact versionM
MCP-008External HTTP(S) transportH
MCP-009Dangerous environment overrideC
MCP-010Unrestricted root/home pathH
MCP-011Hardcoded sensitive MCP environment valueC
MCP-012Remote script piped to a shellC
MCP-013Shell metacharacters in argsH

AGT-005 Bash wildcard/sudo variants are CRITICAL; Write/Edit wildcard and other dangerous Bash variants are HIGH. MCP-006 through MCP-011 require parsed settings. MCP-007 recognizes versionless, floating and range specifications; it is not package provenance verification. MCP-008 uses the parsed hostname for loopback/local exemptions, not substrings in paths or queries.

Skills and other agentic patterns​

IDTriggerBase
SKL-001Remote shell pipe or CLI credential extractionC
SKL-001Loader-directory write, shell-history access, approval bypassH
SKL-002Model endpoint overrideC
SKL-003Permission bypass flagC
SKL-004Bidi metadata or confusable nameH
SKL-004Discovery hijackM
SKL-004Brand nameL
SKL-005Python YAML object tag, pickle family, JavaScript executionC
SKL-005Unsafe yaml.loadM
SKL-005XML external entity patternH
SKL-006Host network exposureH
SKL-007Unpinned dependencyM
SKL-007Missing versionI
SKL-008Scanner evasionH
SKL-008Collapsed HTML detailsL
SKL-010Client-specific permissionsM
LLM-002Insecure output handlingH
LLM-004Unbounded model workH
LLM-005Unpinned package installationH
LLM-008Destructive autonomous actionH
ASI-003Agent identity/privilege abuseH
ASI-004Dynamic/unverified tool loadingH
ASI-005Unexpected code executionC
ASI-006Unsafe memory persistenceH
ASI-007Insecure agent communicationH
ASI-008Unbounded delegation/cascading failureM
ASI-009Human-agent trust exploitationH
ASI-010Rogue replication/persistenceC
CFG-001World-writable agent configurationH

SKL-009 is not implemented. SKL-001 writes into .github/skills/ become CRITICAL. Skill name/version/platform checks require skill classification; missing-version is omitted with --skip-info-controls. CFG-001 requires file-mode metadata and a supported configuration filename.

Opt-in prompt controls​

CTL rules apply to classified prompt/skill/agent Markdown with --include-llm-controls. CTL-001 through CTL-013 are omitted with --skip-info-controls; CTL-014 through CTL-019 remain active.

IDMissing written controlBase
CTL-001System-prompt confidentialityI
CTL-002Input validation/sanitizationI
CTL-003Output filtering/sanitizationI
CTL-004Rate limitingI
CTL-005Scope/role constraintI
CTL-006Bias mitigationI
CTL-007Harmful-content safeguardI
CTL-008Memory isolationI
CTL-009Inter-agent authenticationI
CTL-010Behavioral monitoring/audit loggingI
CTL-011Indirect-injection defenseI
CTL-012Multilingual-bypass defenseI
CTL-013Context-overflow defenseI
CTL-014Data-leakage defenseC
CTL-015Role-boundary defenseH
CTL-016Social-engineering defenseM
CTL-017Unicode/encoding defenseM
CTL-018Output-weaponization defenseM
CTL-019Abuse preventionL

Configuring the policy​

There is no shared scanner policy-file format or per-rule enable/disable setting. Configure the existing command controls instead:

# Human-readable gate, without trusting repository suppressions
ai-primitives-hub security scan . --ci --fail-on HIGH

# Structured output; display filtering does not weaken the failure policy
ai-primitives-hub security scan . --severity CRITICAL --fail-on HIGH -o json

# Opt-in prompt controls and a narrower input set
ai-primitives-hub security scan skills/ --include-llm-controls \
--exclude .git --exclude node_modules --exclude examples

--fail-on evaluates all unsuppressed findings before display filtering. Incomplete coverage fails even with --fail-on none. Repository ignores are for local triage; security gates should use none or protected baselines. JSON, YAML and NDJSON are supported alongside text and opt-in saved reports. See the scanner reference for option defaults, suppression caveats, output contracts and exit codes.

Maintenance​

The native rule definitions and structural evaluator are the behavioral source of truth. This catalogue must be updated with rule changes. Rule-pack metadata hashes pattern source/flags and rule metadata; evaluator/parser changes also require a revision bump. A digest identifies the declared pack revision, not an independent proof of implementation integrity or safety.

See also​