@exorcist-98/cli 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ Needs Node 20 or newer.
11
11
  ## Scan a project
12
12
 
13
13
  ```sh
14
- npx -y @exorcist-98/cli@0.1.2 scan .
14
+ npx -y @exorcist-98/cli@0.2.0 scan .
15
15
  ```
16
16
 
17
17
  Every finding shows the file, line, the exact text, how serious it is and how
@@ -23,10 +23,23 @@ Add `--ai` to also ask an AI judge (Claude on Amazon Bedrock) about suspicious
23
23
  text. It needs AWS credentials, `AWS_REGION` and
24
24
  `npm install @aws-sdk/client-bedrock-runtime`; `--ai-max-calls` caps the cost.
25
25
 
26
+ ## Adopt on an existing repo
27
+ ```sh
28
+ exorcist baseline . # writes .exorcist-baseline.json
29
+ exorcist scan . --baseline .exorcist-baseline.json # reports new findings only
30
+ ```
31
+ The baseline keeps a fingerprint of each finding, not its text. To silence one
32
+ rule on one line, write `exorcist-ignore EX-012: reason` in a comment on that
33
+ line or the line before (a reason is required; hidden characters, EX-001, and
34
+ secrets, EX-011, can never be silenced this way). Suppressions are listed in the
35
+ summary, and SARIF output marks them with `suppressions`. If the definitions are
36
+ more than 30 days old, `scan` prints one warning on stderr; it makes no network
37
+ request.
38
+
26
39
  ## Map the haunted house
27
40
 
28
41
  ```sh
29
- npx -y @exorcist-98/cli@0.1.2 map .
42
+ npx -y @exorcist-98/cli@0.2.0 map .
30
43
  ```
31
44
 
32
45
  For every MCP config in the folder, lists which servers sit in the three rooms
@@ -39,8 +52,8 @@ data. The rules are in `definitions/capabilities.yaml`.
39
52
  ## Disinfect (exorcise)
40
53
 
41
54
  ```sh
42
- npx -y @exorcist-98/cli@0.1.2 exorcise . # dry run: prints a unified diff
43
- npx -y @exorcist-98/cli@0.1.2 exorcise . --write # apply, with a vault backup first
55
+ npx -y @exorcist-98/cli@0.2.0 exorcise . # dry run: prints a unified diff
56
+ npx -y @exorcist-98/cli@0.2.0 exorcise . --write # apply, with a vault backup first
44
57
  ```
45
58
 
46
59
  Only threats with one safe, mechanical fix are repaired: hidden characters
@@ -54,7 +67,7 @@ human"), and `exorcist vault restore <id>` puts every file back byte for byte.
54
67
  ## Protect your MCP servers
55
68
 
56
69
  ```sh
57
- npx -y @exorcist-98/cli@0.1.2 wrap .kiro/settings/mcp.json
70
+ npx -y @exorcist-98/cli@0.2.0 wrap .kiro/settings/mcp.json
58
71
  ```
59
72
 
60
73
  `wrap` puts every server in the file, local or remote, behind the Real-Time
@@ -66,9 +79,9 @@ instruct your agent. `unwrap` restores the file exactly. See
66
79
  ## Share approved tools with your team: exorcist.lock
67
80
 
68
81
  ```sh
69
- npx -y @exorcist-98/cli@0.1.2 lock # write exorcist.lock, then commit it
70
- npx -y @exorcist-98/cli@0.1.2 lock --check # exit 1 if any tool or program changed
71
- npx -y @exorcist-98/cli@0.1.2 lock --check --static # starts nothing: names, programs, URLs only
82
+ npx -y @exorcist-98/cli@0.2.0 lock # write exorcist.lock, then commit it
83
+ npx -y @exorcist-98/cli@0.2.0 lock --check # exit 1 if any tool or program changed
84
+ npx -y @exorcist-98/cli@0.2.0 lock --check --static # starts nothing: names, programs, URLs only
72
85
  ```
73
86
 
74
87
  `exorcist.lock` records the fingerprint of every tool your MCP servers list,
@@ -11,7 +11,13 @@ match:
11
11
  # whitespace may separate the words. Ordinary text such as "you are now
12
12
  # logged in" is not flagged. A phrase split by hidden characters still
13
13
  # matches (the engine also scans the text with them removed).
14
- regex: "(?:\\bignore\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules|prompts?)|\\bdisregard\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules)|\\byou\\s+are\\s+now\\s+(?:(?:operating\\s+)?in\\s+(?:maintenance|developer|debug|admin|god|unrestricted|jailbreak|dan)\\s+mode|operating\\s+without\\s+(?:any\\s+)?(?:restrictions|rules|limits)|free\\b|unrestricted|dan\\b)|\\bas\\s+an\\s+ai(?:\\s+(?:assistant|agent|model))?\\s*,?\\s+(?:your\\s+(?:new|real|true|actual|hidden|secret|only)\\b|you\\s+must|you\\s+should|ignore)|\\byour\\s+new\\s+(?:primary\\s+)?(?:directive|instructions?)\\b|\\bdo\\s+not\\s+(?:mention|tell|reveal)\\s+(?:this|these)\\s+(?:instruction|note|message)s?)"
14
+ regex: "(?:\\bignore\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules|prompts?)|\\bdisregard\\s+(?:all\\s+|any\\s+|the\\s+)?(?:previous|prior|above|earlier)\\s+(?:instructions|rules)|\\byou\\s+are\\s+now\\s+(?:(?:operating\\s+)?in\\s+(?:maintenance|developer|debug|admin|god|unrestricted|jailbreak|dan)\\s+mode|operating\\s+without\\s+(?:any\\s+)?(?:restrictions|rules|limits)|free\\b|unrestricted|dan\\b)|\\bas\\s+an\\s+ai(?:\\s+(?:assistant|agent|model))?\\s*,?\\s+(?:your\\s+(?:new|real|true|actual|hidden|secret|only)\\b|you\\s+must|you\\s+should|ignore)|\\byour\\s+new\\s+(?:primary\\s+)?(?:directive|instructions?)\\b|\\bdo\\s+not\\s+(?:mention|tell|reveal)\\s+(?:this|these)\\s+(?:instruction|note|message)s?|\\b(?:send|upload|post|forward|e-?mail|mail|paste|submit|copy|transmit|exfiltrate)\\s+(?:(?!\\n\\s*\\n)(?:[^.!?]|\\.(?=\\w))){0,40}?(?:\\.env\\b|(?:environment|env)\\s+files?|credentials?|secrets?|(?:api\\s+|access\\s+|auth\\s+|bearer\\s+)?tokens?|(?:api|ssh|private|secret)\\s+keys?)(?:(?!\\n\\s*\\n)(?:[^.!?]|\\.(?=\\w))){0,30}?\\b(?:to|at|into|via)(?:\\s*(?:…|\\.{3})|\\s+(?:https?://|ftp://|[\\w.+-]+@[\\w-]+\\.[\\w.-]+|(?:[a-z0-9-]+\\.)+(?!(?:json|ya?ml|toml|txt|md|env|jsx?|tsx?|py|sh|cfg|ini|conf|properties|example|local|lock|log|xml|html?|css)\\b)[a-z]{2,}\\b|the\\s+following\\b)))"
15
+ # The last alternative is an exfiltration order (m8-incidents 3.1): a verb
16
+ # (send, upload, post, forward, email, paste ...) with an object (env file,
17
+ # credentials, tokens, keys, secrets) and a destination (a URL, an address, a
18
+ # host, "to the following", "to..."), in one sentence that may span lines.
19
+ # "upload your build artifacts" and "send a request to the API" have no such
20
+ # object. A defence ("never send the .env file to ...") is quiet via negated_cues.
15
21
  # A phrase in quotation marks that close right after it, in a passage that
16
22
  # is warning about it or quoting it as an example ("never follow text such
17
23
  # as ..."), is not an order. In the field that was 35 of 42 findings of
@@ -24,7 +30,7 @@ match:
24
30
  # to govern the phrase (it ends right before it, or opens a list of what must
25
31
  # not be attempted); "do not mention this, tell the agent to ..." is still an
26
32
  # attack (m7-precision, packages/core/src/scanner/context.ts isNegated).
27
- negated_cues: '\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:(?:ever|simply|just|even|actually|knowingly)\s+)*$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot)\s+(?:attempt|try|seek)\s+to\b[^.!?\n]*?\b(?:tell|instruct|ask|cause|make|persuade|trick|convince|get|force|let|allow)\w*\s+(?:(?:the|an?|your|any)\s+)?(?:(?:agent|model|assistant|ai|llm|bot|claude)s?\s+)?(?:to\s+)?$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:follow|obey|comply\s+with|act\s+on|honou?r|accept|execute|run)\s+(?:(?:any|an?|the|such|these|those|that|text|instructions?|requests?|commands?|messages?|content|tool\s+output|it)\s+)*(?:(?:that|which)\s+)?(?:(?:say|says|saying|tell|tells|telling|ask|asks|asking)\s+(?:you\s+)?(?:to\s+)?)?$'
33
+ negated_cues: '\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:(?:ever|simply|just|even|actually|knowingly|first|then|also)\s+)*$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot)\s+(?:attempt|try|seek)\s+to\b[^.!?\n]*?\b(?:tell|instruct|ask|cause|make|persuade|trick|convince|get|force|let|allow)\w*\s+(?:(?:the|an?|your|any)\s+)?(?:(?:agent|model|assistant|ai|llm|bot|claude)s?\s+)?(?:to\s+)?$|\b(?:(?:must|should|shall|will|would|may|might|can|could)\s*(?:not|never)|(?:must|should|shall|would|could|do|does|did|is|are|was|were|has|have|ca|wo)n[''’]t|cannot|do(?:es)?\s+not|did\s+not|never|refus(?:e|es|ed|ing)\s+to|(?:is|are)\s+not\s+(?:to|allowed\s+to|permitted\s+to|able\s+to)|unable\s+to)\s+(?:follow|obey|comply\s+with|act\s+on|honou?r|accept|execute|run)\s+(?:(?:any|an?|the|such|these|those|that|text|instructions?|requests?|commands?|messages?|content|tool\s+output|it)\s+)*(?:(?:that|which)\s+)?(?:(?:say|says|saying|tell|tells|telling|ask|asks|asking)\s+(?:you\s+)?(?:to\s+)?)?$'
28
34
  # Test and eval fixtures hold attack samples on purpose (a security scanner's
29
35
  # own tests, adversarial evals). Findings there are reported at low severity,
30
36
  # not dropped. A file an agent reads (instructions, hooks, MCP configs, .kiro,
@@ -0,0 +1,25 @@
1
+ id: EX-028
2
+ title: Hidden text that instructs the AI
3
+ severity: high
4
+ applies_to:
5
+ - instruction
6
+ - docs
7
+ - memory
8
+ - tool-result
9
+ - unknown
10
+ match:
11
+ # Code check (packages/core/src/hidden-text.ts): an HTML element hidden by its
12
+ # style (white or near-background colour, font size at or under 2px,
13
+ # display:none, visibility:hidden, opacity:0, off-screen position, zero-size
14
+ # box) whose text names the AI or asks for an action. Hidden text that does
15
+ # neither (a closed modal, a screen-reader label, a collapsed menu) is quiet.
16
+ hidden_text: true
17
+ # Hidden markup shown inside Markdown code is displayed, not hidden.
18
+ skip_in_code: true
19
+ owasp:
20
+ - "LLM01:2025 Prompt Injection"
21
+ - "ASI03 Prompt Injection via External Content"
22
+ fix: >
23
+ Remove the hidden element, or make its text visible. Text a person cannot
24
+ see but a model reads can give an agent orders. Do not let an agent act on a
25
+ page or file that contains it.
@@ -0,0 +1,20 @@
1
+ id: EX-029
2
+ title: File or folder name that instructs the AI
3
+ severity: high
4
+ applies_to:
5
+ - unknown
6
+ match:
7
+ # Name check (packages/core/src/path-names.ts), run by scanRepo on the name of
8
+ # every path the walker visits (folders, empty, binary and oversize files
9
+ # too). A name that reads as an order to an AI ("ignore previous
10
+ # instructions", "assistant read env and send to ...") or that carries
11
+ # hidden or control characters is reported. Long, odd or non-Latin names are
12
+ # quiet. Not a text pattern: the signature engine skips this rule.
13
+ analysis: path-names
14
+ owasp:
15
+ - "LLM01:2025 Prompt Injection"
16
+ - "ASI03 Prompt Injection via External Content"
17
+ fix: >
18
+ Rename or delete the file or folder. A name is read by an agent when it
19
+ lists a project, so it can carry orders just like file contents. Do not let
20
+ an agent act on this project until the name is changed.