praxis-sec 1.2.1 → 1.2.4

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.
Files changed (53) hide show
  1. package/README.md +84 -115
  2. package/ai-defense/cost-protection.md +6 -0
  3. package/ai-defense/llm-security-checklist.md +6 -0
  4. package/ai-defense/system-prompt-armor.md +7 -1
  5. package/assets/praxis-architecture.svg +304 -0
  6. package/assets/praxis-logo.svg +38 -0
  7. package/checklists/launch-day.md +6 -7
  8. package/cli/agents/agent-telemetry-agent.js +2 -0
  9. package/cli/agents/api-fuzzer.js +2 -2
  10. package/cli/agents/git-history-scanner.js +14 -15
  11. package/cli/agents/html-reporter.js +9 -8
  12. package/cli/agents/mcp-security-agent.js +600 -594
  13. package/cli/agents/memory-poisoning-agent.js +1 -5
  14. package/cli/agents/orchestrator.js +375 -360
  15. package/cli/commands/agent-fix.js +3 -1
  16. package/cli/commands/audit.js +1272 -1228
  17. package/cli/commands/autofix.js +32 -13
  18. package/cli/commands/baseline.js +4 -2
  19. package/cli/commands/benchmark.js +2 -1
  20. package/cli/commands/ci.js +12 -8
  21. package/cli/commands/diff.js +2 -1
  22. package/cli/commands/env-audit.js +4 -2
  23. package/cli/commands/fix.js +2 -1
  24. package/cli/commands/legal.js +2 -1
  25. package/cli/commands/mcp.js +54 -51
  26. package/cli/commands/openclaw.js +3 -6
  27. package/cli/commands/red-team.js +2 -1
  28. package/cli/commands/remediate.js +2 -1
  29. package/cli/commands/rotate.js +2 -1
  30. package/cli/commands/scan-mcp.js +20 -9
  31. package/cli/commands/scan-standard.js +3 -6
  32. package/cli/commands/scan.js +15 -7
  33. package/cli/commands/score.js +2 -1
  34. package/cli/commands/vibe-check.js +4 -2
  35. package/cli/commands/watch.js +8 -6
  36. package/cli/core/glob.js +7 -5
  37. package/cli/core/output/json.js +56 -48
  38. package/cli/core/paths.js +91 -0
  39. package/cli/core/web/jobs.js +2 -0
  40. package/cli/data/documented-secret-examples.json +14 -0
  41. package/cli/utils/cache-manager.js +2 -1
  42. package/cli/utils/entropy.js +19 -0
  43. package/cli/utils/hermes-tool-registry.js +11 -9
  44. package/configs/firebase/security-checklist.md +3 -3
  45. package/configs/supabase/security-checklist.md +19 -21
  46. package/docs/RELEASE-1.2.4.md +85 -0
  47. package/docs/RELEASING.md +51 -0
  48. package/docs/THIRD_PARTY_NOTICES.md +8 -0
  49. package/docs/THREAT_INTEL.md +4 -2
  50. package/docs/USAGE.md +97 -76
  51. package/package.json +6 -4
  52. package/snippets/README.md +6 -0
  53. package/snippets/auth/jwt-checklist.md +14 -13
@@ -24,11 +24,11 @@ allow read, write: if request.time < timestamp.date(2024, 12, 31);
24
24
  ### 2. [ ] Firestore rules require authentication
25
25
 
26
26
  ```javascript
27
- // GOOD: Requires authentication
27
+ // Authentication check alone: insufficient for private per-user data
28
28
  allow read, write: if request.auth != null;
29
29
 
30
30
  // BETTER: Requires authentication AND ownership
31
- allow read, write: if request.auth.uid == userId;
31
+ allow read, write: if request.auth != null && request.auth.uid == userId;
32
32
  ```
33
33
 
34
34
  ### 3. [ ] Storage rules have file type validation
@@ -49,7 +49,7 @@ allow write: if request.resource.size < 5 * 1024 * 1024;
49
49
  ### 5. [ ] Default deny rule at the end
50
50
 
51
51
  ```javascript
52
- // Catch-all: deny everything not explicitly allowed
52
+ // Explicit default deny. Matching allow rules are additive; this does not override another allow.
53
53
  match /{document=**} {
54
54
  allow read, write: if false;
55
55
  }
@@ -2,42 +2,40 @@
2
2
 
3
3
  **Complete this checklist before launching your Supabase-powered app.**
4
4
 
5
- Based on [CVE-2025-48757](https://byteiota.com/supabase-security-flaw-170-apps-exposed-by-missing-rls/) and common pentesting findings.
5
+ Follow [Supabase RLS guidance](https://supabase.com/docs/guides/database/postgres/row-level-security). Test allow and deny behavior for each operation and role; these examples are not proof of access isolation.
6
6
 
7
7
  ---
8
8
 
9
9
  ## Critical: Row Level Security (RLS)
10
10
 
11
- ### 1. [ ] RLS is ENABLED on ALL tables
11
+ ### 1. [ ] RLS is enabled on tables exposed to application users
12
12
 
13
13
  ```sql
14
14
  -- Check which tables DON'T have RLS
15
- SELECT schemaname, tablename
16
- FROM pg_tables
17
- WHERE schemaname = 'public'
18
- AND tablename NOT IN (
19
- SELECT tablename::text FROM pg_class
20
- WHERE relrowsecurity = true
21
- );
15
+ SELECT n.nspname AS schemaname, c.relname AS tablename
16
+ FROM pg_class AS c
17
+ JOIN pg_namespace AS n ON n.oid = c.relnamespace
18
+ WHERE n.nspname = 'public'
19
+ AND c.relkind IN ('r', 'p')
20
+ AND NOT c.relrowsecurity;
22
21
  ```
23
22
 
24
- **If any tables appear, enable RLS immediately:**
23
+ **Review exposed tables and enable RLS with tested policies and grants:**
25
24
  ```sql
26
25
  ALTER TABLE table_name ENABLE ROW LEVEL SECURITY;
27
26
  ```
28
27
 
29
- ### 2. [ ] Every table has at least one policy
28
+ ### 2. [ ] Exposed tables have the policies needed for intended operations
30
29
 
31
30
  ```sql
32
- -- Tables with RLS enabled but NO policies (locked to everyone!)
33
- SELECT tablename FROM pg_tables
34
- WHERE schemaname = 'public'
35
- AND tablename IN (
36
- SELECT tablename::text FROM pg_class WHERE relrowsecurity = true
37
- )
38
- AND tablename NOT IN (
39
- SELECT tablename FROM pg_policies
40
- );
31
+ -- RLS tables with no policies: ordinary roles are denied, but bypass roles differ.
32
+ SELECT n.nspname AS schemaname, c.relname AS tablename
33
+ FROM pg_class AS c
34
+ JOIN pg_namespace AS n ON n.oid = c.relnamespace
35
+ WHERE n.nspname = 'public'
36
+ AND c.relkind IN ('r', 'p')
37
+ AND c.relrowsecurity
38
+ AND NOT EXISTS (SELECT 1 FROM pg_policy AS p WHERE p.polrelid = c.oid);
41
39
  ```
42
40
 
43
41
  ### 3. [ ] Policies use `auth.uid()` not hardcoded values
@@ -97,7 +95,7 @@ grep -r "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" ./src
97
95
  The `anon` key is designed to be public, but only if RLS is properly configured.
98
96
 
99
97
  ```typescript
100
- // Frontend: Use anon key (safe if RLS is set up)
98
+ // Frontend: use the appropriate public key with tested RLS policies and grants
101
99
  const supabase = createClient(url, anonKey);
102
100
 
103
101
  // Server: Use service_role key (for admin operations)
@@ -0,0 +1,85 @@
1
+ # Praxis 1.2.4
2
+
3
+ This patch corrects cases where a scan could report success without examining the
4
+ requested target, and fixes project targeting in the older annotation loop.
5
+
6
+ - Full, secret, and CI scans require a directory. A file supplied as a scan root
7
+ now produces an error instead of a false empty result. The VS Code current-file
8
+ action scans its workspace and selects diagnostics for the requested file.
9
+ - Full-scan JSON includes `scanComplete`, `scanErrors`, and `dependencyAudit`.
10
+ Failed discovery, failed agents, unavailable dependency audits, or failed
11
+ requested legal scans mark the result incomplete and exit unsuccessfully.
12
+ Findings alone still do not fail a normal scan; use `scan ci` for severity gates.
13
+ - Incomplete scans do not update scan cache, score history, or the playbook, and
14
+ cannot start the annotation loop or satisfy fix verification. HTML reports show
15
+ an incomplete warning; the web runner refuses failed-agent results.
16
+ A failed annotation-loop verification also overrides `--fail-below`; JSON
17
+ reports the failure once without inner-scan progress text. Reports are generated
18
+ after verification so HTML and machine-readable status agree.
19
+ - `scan full --timeout` now reaches the orchestrator.
20
+ - Annotation targets resolve inside the requested project, including symlink
21
+ destinations. Protected scanner/Git paths and unsupported comment formats such
22
+ as JSON are rejected. Writes are atomic, and unchanged annotations are not
23
+ counted as applied. Multiple annotations in one file are inserted from the
24
+ bottom to preserve finding line numbers; replaying the same report is safe.
25
+ - In-root directories beginning with two dots retain their full relative path.
26
+ Foreign Windows backslash and UNC paths fall back to a safe basename.
27
+ - Memory-poisoning document discovery respects ignore rules and dependency
28
+ directories instead of reading ignored nested artifacts as project context.
29
+ - File discovery uses `tinyglobby` in place of the vulnerable
30
+ `fast-glob → micromatch → braces` chain. Directory expansion stays disabled,
31
+ brace limits and symlink boundaries remain enforced, and discovery has tests
32
+ for hidden files, exclusions, extglobs, literal directories, and async/sync parity.
33
+ - Exact provider-documented non-working credentials are recognized from an
34
+ attributed data catalog. Unknown credentials on the same line still produce
35
+ findings. History scans process all matches, distinguish credentials that share
36
+ the same masked display, and report operational failures as incomplete.
37
+ - Upload rules require request/upload filename evidence instead of treating
38
+ local package metadata or any variable named `filename` as a vulnerable upload.
39
+ - The independently versioned VS Code extension is prepared as 1.0.1. CLI calls
40
+ use executable/argument arrays instead of shell text, and default npx execution
41
+ forbids automatic package installation. Report fields are escaped, severity
42
+ classes are sanitized, and a Content-Security-Policy blocks remote content.
43
+ Windows npm launchers resolve to the CLI's JavaScript entry point, preserving
44
+ literal arguments without invoking a command shell.
45
+
46
+ - MCP suppression now writes on the matched line, preserves line endings, rejects
47
+ unsupported formats and non-integer lines, and writes atomically. MCP repository
48
+ scans use the current scoring API, expose agent failures as incomplete, and
49
+ reject file roots.
50
+ - Hermes handlers return structured audit/manifest results, read the explicit saved
51
+ report path, apply severity filtering, and register against corrected integrity
52
+ hashes. Default Hermes audits disclose skipped dependency checks.
53
+ - Documentation uses canonical commands, preserves errors, corrects CI examples,
54
+ describes data egress and score limitations, and provides a release procedure.
55
+ The Claude Code plugin instructions are independently versioned as 3.0.1.
56
+
57
+ ## Validation and limitations
58
+
59
+ Release validation covers the CLI test suite on Node 18, 20, 22 and 24, lint,
60
+ extension compilation and runtime tests, scan determinism, a complete zero-critical
61
+ self-scan, local PR Action base/head comparison, and installed-package smoke tests.
62
+ The production dependency chain was removed rather than overridden; the reviewed
63
+ full dependency audit, including development dependencies, reports zero advisories.
64
+ Audit results reflect the advisory database at the time of verification.
65
+
66
+ AWS explicitly identifies the formerly reported fixture credential as
67
+ [non-working example data](https://docs.aws.amazon.com/AmazonS3/latest/developerguide/RESTAuthentication.html).
68
+ Only that exact identifier in AWS credential rules is exempted; tests retain
69
+ unknown credentials on the same line. History and test files are not excluded.
70
+
71
+ Noncritical heuristic findings and existing lint warnings remain. A self-scan
72
+ score is not a measurement of scanner accuracy. Live LLM provider behavior and
73
+ interactive VS Code UI behavior were not validated by these release checks.
74
+
75
+ ## Distribution
76
+
77
+ The GitHub release, immutable `v1.2.4` tag, and floating Marketplace Action `v1`
78
+ are prepared from the same commit after its hosted CI succeeds. The release
79
+ includes the npm package tarball and a SHA-256 checksum. **npm publication is a
80
+ separate maintainer step**; a GitHub release does not change npm latest.
81
+
82
+ Use `Ganron007/Praxis@v1.2.4` to pin the Action. For CLI use before npm publication,
83
+ install the attached tarball or run from a checkout of this tag. After publication,
84
+ install `praxis-sec@1.2.4` from npm. See [the release procedure](RELEASING.md) for
85
+ the checks and publishing handoff.
@@ -0,0 +1,51 @@
1
+ # Releasing Praxis
2
+
3
+ The CLI/npm package, GitHub Action, Claude Code plugin, and VS Code extension
4
+ have separate distribution surfaces. A GitHub release does not publish npm or
5
+ the VS Code extension.
6
+
7
+ ## Prepare
8
+
9
+ 1. Choose the CLI patch version and update `package.json`, both root lockfile
10
+ version fields, and `docs/RELEASE-<version>.md`.
11
+ 2. Update public examples to the intended Action tag. Keep independently
12
+ versioned integrations consistent with their own manifests and lockfiles.
13
+ 3. Run `npm ci` and `npm run release:check`. This checks CLI tests, lint,
14
+ production dependency advisories, scan determinism, a complete zero-critical
15
+ self-scan, editor compilation/runtime tests, package exclusions, and an
16
+ installed-package scan with redaction and cache parity.
17
+ 4. Review `git diff --check` and the package contents. Keep `docs/internal/`,
18
+ runtime state, credentials, test fixtures, and local binaries out of Git and
19
+ the npm package.
20
+
21
+ ## GitHub and Marketplace
22
+
23
+ 1. Commit the complete release and push it. Wait for CI to pass on that exact
24
+ commit, including all four Node versions, determinism, package/editor checks,
25
+ and the local Action smoke test.
26
+ 2. Create an annotated immutable version tag, such as `v1.2.4`, on that commit.
27
+ Never replace a previously published version tag with different source.
28
+ 3. Pack the committed source with `npm pack`. Attach the tarball and its SHA-256
29
+ checksum to the GitHub release, using the reviewed release notes.
30
+ 4. Advance the floating `v1` Action tag deliberately to the same commit. Check
31
+ the prior remote value first and protect the update against concurrent changes.
32
+ 5. Verify the release, version tag, floating tag, assets, and successful CI all
33
+ refer to the reviewed source. Consumers can use the exact version tag or
34
+ commit instead of the floating tag.
35
+
36
+ ## npm publication
37
+
38
+ The maintainer publishes npm separately from the same clean, committed checkout:
39
+
40
+ ```bash
41
+ git checkout v1.2.4
42
+ npm ci
43
+ npm publish
44
+ ```
45
+
46
+ `prepublishOnly` reruns the release gates and rejects an uncommitted working
47
+ tree or a version different from the committed package metadata. Authentication
48
+ and npm account requirements must be satisfied by the publishing maintainer.
49
+ After publication, confirm `npm view praxis-sec version dist-tags` and install
50
+ that exact registry version in a clean project. GitHub and npm may legitimately
51
+ show different versions until this step completes.
@@ -17,6 +17,14 @@ and attribution as required.
17
17
  - **Source:** https://github.com/0x4D31/endpoint-ai-agent-abuse (v0.1.0)
18
18
  - **License:** CC0-1.0 (public domain dedication) — https://creativecommons.org/publicdomain/zero/1.0/
19
19
 
20
+ ## Documented non-working credential examples
21
+
22
+ - **File:** `cli/data/documented-secret-examples.json`
23
+ - **Source:** [AWS S3 authentication examples](https://docs.aws.amazon.com/AmazonS3/latest/developerguide/RESTAuthentication.html)
24
+ - Contains one exact identifier AWS labels non-working, with our own annotations.
25
+ No documentation prose is reproduced. This is factual example provenance, not
26
+ permission to suppress arbitrary credentials, test files, or repository history.
27
+
20
28
  ## Standards referenced (not vendored)
21
29
 
22
30
  Findings are mapped to the following frameworks; their text is not reproduced:
@@ -12,7 +12,9 @@ For everything else (general CLI usage, scanning, hooks, etc.), see the main
12
12
 
13
13
  ## 1. Commands
14
14
 
15
- Run these from any directory — they only touch `~/.praxis/` (your home dir).
15
+ Feed-update commands store caches under `~/.praxis/`. Scan commands also read
16
+ the selected project and can update its local Praxis state. Updates contact
17
+ configured remote sources; cached data is not a guarantee of current coverage.
16
18
 
17
19
  | Command | What it does |
18
20
  | --- | --- |
@@ -35,7 +37,7 @@ over no data.
35
37
  praxis intel update
36
38
  ```
37
39
 
38
- Expected output:
40
+ Illustrative output (versions and counts depend on the fetched feeds):
39
41
 
40
42
  ```
41
43
  Fetching sources...
package/docs/USAGE.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # Praxis — Complete Usage Guide
2
2
 
3
- AI-native security CLI for AI-augmented codebases. Single binary, find→fix→verify
4
- loop on autopilot. 28 parallel security agents (24 built-in + ModelFileScanner +
5
- PromptInjectionProber + AgentTelemetryAgent + EndpointAgentAbuseAgent), multi-source threat intel, modular alignment with 8 AI-security
6
- standards, LLM-powered remediation with diff review and undo log. Works fully
7
- offline; LLM features are optional.
3
+ Security CLI for AI applications and codebases. Praxis runs 28 built-in scanners
4
+ in parallel batches, maps findings to security standards, and supports reviewed
5
+ LLM remediations with verification and an undo log. Requires Node.js 18 or newer.
6
+
7
+ For a local static audit, use `praxis scan . --no-ai --no-deps`. Default dependency
8
+ audits contact package services, and configured LLM providers may classify findings.
9
+ `--deep`, swarm analysis, LLM fixes, credential verification, feed updates, Git
10
+ clones, and live probes can also contact external services. `--no-ai` disables
11
+ classification; it does not disable those separately requested features.
8
12
 
9
13
  ---
10
14
 
@@ -42,7 +46,7 @@ offline; LLM features are optional.
42
46
 
43
47
  ```bash
44
48
  # From source (this repo)
45
- npm install
49
+ npm ci
46
50
  npm link # exposes `praxis` globally
47
51
 
48
52
  # Or run directly without linking
@@ -93,6 +97,22 @@ Plus three top-level shortcuts: `praxis vibe`, `praxis score`, and `praxis` alon
93
97
 
94
98
  Full audit: secrets + 28 agents + deps + score + remediation plan.
95
99
 
100
+ Local scan roots must be existing directories. Passing a file produces an error.
101
+ Use `scan changed` for a change-based scan; the editor's current-file command
102
+ scans its workspace and selects findings for that file.
103
+
104
+ Full-scan JSON contains:
105
+
106
+ - `scanComplete`: true only when required scan stages completed.
107
+ - `scanErrors`: errors from discovery, agents, dependency auditing, or requested legal analysis.
108
+ - `dependencyAudit`: `complete`, `skipped`, `not-applicable`, or `failed`.
109
+
110
+ Incomplete scans exit 1, do not refresh scan cache/history/playbook state, and
111
+ cannot verify a fix. Findings alone do not fail a normal full scan; use `scan ci`
112
+ for severity or score gates. Keep stderr and inspect completion before treating
113
+ JSON output or a high score as a successful assessment. Skipped checks provide
114
+ no assurance for that part of the project.
115
+
96
116
  | Flag | Description |
97
117
  | --- | --- |
98
118
  | `--json` | Output results as JSON |
@@ -116,7 +136,7 @@ Full audit: secrets + 28 agents + deps + score + remediation plan.
116
136
  | `--budget <cents>` | Max spend in cents for deep analysis (default 50) |
117
137
  | `--verify` | Check if leaked secrets are still active |
118
138
  | `--include-legal` | Also run the legal risk scan |
119
- | `--agentic [iterations]` | Agentic scan→fix→verify loop |
139
+ | `--agentic [iterations]` | Legacy annotation loop: adds review comments, then re-scans; does not apply the proposed remediation |
120
140
  | `--agentic-target <score>` | Target security score for agentic loop |
121
141
  | `--hermes-only` | Run only Hermes-relevant agents |
122
142
  | `--fail-below <threshold>` | Exit 1 if score < threshold |
@@ -182,13 +202,13 @@ Credential health check: `.env` coverage, source cross-ref, git history.
182
202
 
183
203
  ### `scan redteam [path]` / `praxis redteam [target]`
184
204
 
185
- Dynamic AI Red Teaming & DAST Prober: executes 80+ attack classes statically and probes live LLM endpoints / agent runtimes with jailbreak, prompt injection, and goal-hijacking payloads.
205
+ `scan redteam <directory>` runs the static adversarial agent pack.
206
+ `praxis redteam <endpoint>` runs dynamic probes against an authorized live LLM
207
+ endpoint. These commands have different options; consult each command's `--help`.
208
+ The table below describes the static command.
186
209
 
187
210
  | Flag | Description |
188
211
  | --- | --- |
189
- | `--endpoint <url>` | Target live LLM API endpoint for dynamic DAST probing |
190
- | `--model <model>` | Target model identifier |
191
- | `--probes <tags>` | Comma-separated probe categories (`jailbreak`, `injection`, `override`, `exfil`) |
192
212
  | `--agents <list>` | Comma-separated list of static agents to run |
193
213
  | `--json` | JSON output |
194
214
  | `--sarif` | SARIF output |
@@ -197,13 +217,13 @@ Dynamic AI Red Teaming & DAST Prober: executes 80+ attack classes statically and
197
217
  | `--no-deps` | Skip dependency audit |
198
218
  | `--no-ai` | Skip AI classification |
199
219
  | `--deep` | LLM-powered taint analysis with AST scope evaluation |
200
- | `--swarm` | AI swarm mode — 23 parallel agents via DeepSeek/Kimi |
220
+ | `--swarm` | Send selected source context and role instructions to a configured swarm provider; provider execution is separate from the 28 local scanners |
201
221
  | `--think`, `--local`, `--model`, `--provider`, `--base-url`, `--budget` | LLM controls (same as `scan full`) |
202
222
  | `-v, --verbose` | Verbose output |
203
223
 
204
224
  ### `scan standard [name] [path]`
205
225
 
206
- Filter findings by AI-security standard. **New in this release.**
226
+ Filter findings by AI-security standard.
207
227
 
208
228
  | Flag | Description |
209
229
  | --- | --- |
@@ -583,7 +603,7 @@ than silently passed off as checked.
583
603
  Rule **ids are identifiers** (`AWS_ACCESS_KEY_ID`, not `AWS Access Key ID`), because
584
604
  Semgrep suppressions (`# nosemgrep:`) and baselining key on them.
585
605
 
586
- **Scope — what the export does not cover.** 411 of the rules are static patterns. Three
606
+ **Scope — what the export does not cover.** The inventory identifies the rules that are static patterns. Three
587
607
  layers have no Semgrep representation and are declared in the manifest rather than
588
608
  approximated:
589
609
 
@@ -803,7 +823,7 @@ Praxis incorporates a pure ESM, zero-native-dependency AST & CST analysis engine
803
823
  | --- | --- |
804
824
  | `ANTHROPIC_API_KEY` | Claude (Opus / Sonnet / Haiku) |
805
825
  | `OPENAI_API_KEY` | OpenAI (GPT-4 / GPT-4o / o1) |
806
- | `GOOGLE_AI_API_KEY` | Gemini |
826
+ | `GOOGLE_API_KEY` / `GEMINI_API_KEY` | Gemini |
807
827
  | `MOONSHOT_API_KEY` | Kimi |
808
828
  | `OPENAI_BASE_URL` | Custom OpenAI-compatible endpoint (OpenRouter, Groq, DeepSeek, LM Studio, vLLM, ...) |
809
829
  | `PRAXIS_LLM_MODEL` | Default model when no `--model` flag is given |
@@ -961,7 +981,7 @@ only ever emits a known class name.
961
981
  prints a provenance line in its footer:
962
982
 
963
983
  ```
964
- praxis 1.2.1 · node v24.14.1 · probes v1.1(23) · threatpack v1.1(3) · eaa v0.1.0 · files 214
984
+ praxis <version> · node <runtime> · probes <version/count> · threatpack <version/count> · eaa <version> · files <count>
965
985
  ```
966
986
 
967
987
  It records the tool version, the runtime, and the version of every vendored data asset
@@ -999,66 +1019,66 @@ between releases.
999
1019
 
1000
1020
  ## CI/CD integration
1001
1021
 
1002
- ### GitHub Action (composite)
1022
+ ### GitHub Action
1003
1023
 
1004
- The repo ships an `action.yml` (composite action) that runs `praxis ci` and
1005
- uploads SARIF.
1024
+ The [Marketplace Action](https://github.com/marketplace/actions/praxis-security-scan)
1025
+ installs dependencies from its own lockfile and scans with the code selected by
1026
+ the Action ref. It does not depend on npm latest being synchronized with GitHub.
1006
1027
 
1007
1028
  ```yaml
1008
- - uses: ./
1009
- with:
1010
- path: .
1011
- threshold: '80'
1012
- deep: 'false'
1013
- deps: 'true'
1014
- sarif: 'true'
1015
- comment: 'true'
1016
- # PR regression gating — scan the base ref and fail only on NEW findings
1017
- net-new: 'true'
1018
- fail-on-new: 'high'
1019
- # severity floor a baseline can't suppress
1020
- always-fail-on: 'critical'
1021
- env:
1022
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
1029
+ name: Security
1030
+ on: [push, pull_request]
1031
+ permissions:
1032
+ contents: read
1033
+ security-events: write
1034
+ pull-requests: write
1035
+ jobs:
1036
+ praxis:
1037
+ runs-on: ubuntu-latest
1038
+ steps:
1039
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1040
+ - uses: Ganron007/Praxis@v1.2.4
1041
+ with:
1042
+ path: '.'
1043
+ threshold: '80'
1044
+ deps: 'true'
1045
+ deep: 'false'
1046
+ sarif: 'true'
1047
+ comment: 'true'
1048
+ net-new: 'true'
1049
+ fail-on-new: 'high'
1050
+ always-fail-on: 'critical'
1023
1051
  ```
1024
1052
 
1025
- Outputs: `score`, `grade`, `findings`, `secrets`, `vulns`, `cves`, `sarif-file`.
1053
+ Use a release tag or commit for reproducibility; `v1` is a floating release-line
1054
+ tag. Inside this repository, `uses: ./` runs the checked-out source.
1026
1055
 
1027
- **Net-new PR gating** (`net-new: true`, pull-request events only): the action
1028
- checks out the PR base into a worktree, scans it, and diffs finding identities
1029
- (`file:rule`) against the head scan. Only findings *introduced by the PR* can
1030
- fail the build, at or above `fail-on-new`. Pre-existing debt never blocks.
1056
+ Outputs: `score`, `grade`, `findings`, `secrets`, `vulns`, `cves`,
1057
+ `sarif-file`, and `report-url`. See [action.yml](../action.yml) for all inputs.
1031
1058
 
1032
- ### Plain GitHub Actions
1059
+ On pull requests, `net-new: true` scans the base in a worktree and compares
1060
+ finding identities against the head scan. Introduced findings at or above
1061
+ `fail-on-new` fail the gate. `always-fail-on` also checks existing findings;
1062
+ scan and comparison failures fail the job. Other events use the normal gate.
1033
1063
 
1034
- ```yaml
1035
- permissions:
1036
- security-events: write # required for SARIF upload
1037
- steps:
1038
- - run: npm install -g praxis-sec@latest
1039
- - run: praxis ci . --threshold 80 --sarif results.sarif --strict-intel
1040
- - uses: github/codeql-action/upload-sarif@v4
1041
- with: { sarif_file: results.sarif }
1042
- ```
1064
+ SARIF upload needs `security-events: write`; PR comments need
1065
+ `pull-requests: write`. Fork PR tokens and repository Code Scanning settings can
1066
+ restrict these integrations. Set `sarif: 'false'` or `comment: 'false'` when
1067
+ unavailable. The security gate operates independently of those integrations.
1043
1068
 
1044
- `security-events: write` is required — without it the upload fails with a 403 even though
1045
- the scan itself succeeded.
1069
+ ### Plain CLI in CI
1046
1070
 
1047
- ### Using the action from another repository
1071
+ After 1.2.4 is published to npm, install that exact version in your CI setup:
1048
1072
 
1049
- Once the action is listed on the GitHub Marketplace and a `v1` release tag exists:
1050
-
1051
- ```yaml
1052
- permissions:
1053
- security-events: write
1054
- steps:
1055
- - uses: Ganron007/Praxis@v1
1056
- with:
1057
- net-new: 'true'
1058
- fail-on-new: 'high'
1073
+ ```bash
1074
+ npm install -g praxis-sec@1.2.4
1075
+ praxis scan ci . --fail-on high --sarif results.sarif
1059
1076
  ```
1060
1077
 
1061
- Inside this repository `- uses: ./` works immediately and needs no publishing step.
1078
+ Keep the command's exit status. Store JSON as a regular artifact; Praxis JSON
1079
+ is not the GitLab SAST report schema. Upload SARIF to a compatible service with
1080
+ the necessary permissions. If using `--strict-intel`, refresh the feed first
1081
+ and ensure its configured sources completed successfully.
1062
1082
 
1063
1083
  ### Determinism gate
1064
1084
 
@@ -1070,10 +1090,10 @@ detection change cannot land unnoticed:
1070
1090
  node scripts/check-determinism.mjs .
1071
1091
  ```
1072
1092
 
1073
- CI runs this as its own job. A failure means the rule set, the probe corpus or the
1074
- threatpack changed behaviour — which is sometimes intended (a version bump should change
1075
- results), so the gate exists to make the change *deliberate* and visible in the diff
1076
- rather than silent.
1093
+ CI runs this as its own job. A failure means identical inputs produced different
1094
+ finding identities across runs. Investigate unstable discovery, ordering, caches,
1095
+ or external state. An intentional detection change between releases does not
1096
+ justify drift between two scans of the same checkout.
1077
1097
 
1078
1098
  ---
1079
1099
 
@@ -1168,7 +1188,7 @@ plugin-side wiring required.
1168
1188
  | `rules import` says "YAML is an export format" | Import the sibling `praxis-rules.json`. Praxis has no YAML runtime dependency, so YAML is export-only. |
1169
1189
  | `praxis web` refuses to start on a non-loopback host | Remote bind requires **both** `--allow-remote` and `--token` of at least 16 characters. This is deliberate. |
1170
1190
  | `praxis web` won't load a project path | Projects are registered by the operator and addressed by **id**. The API intentionally does not accept client-supplied paths. |
1171
- | Determinism gate fails in CI | Two scans of identical inputs disagreed on `file::rule`. Usually a probe-corpus or threatpack change — check `git diff` on `cli/data/`. Expected when you intentionally change detection. |
1191
+ | Determinism gate fails in CI | Two scans of identical inputs disagreed on `file::rule`. Investigate unstable discovery, caches, ordering, or external state; a detection change between commits does not justify drift in one checkout. |
1172
1192
 
1173
1193
  ---
1174
1194
 
@@ -1187,14 +1207,14 @@ npx praxis-sec mcp
1187
1207
 
1188
1208
  ### IDE integration
1189
1209
 
1190
- Cursor / Continue config (`.continue/config.yaml` or Cursor MCP settings):
1210
+ Illustrative stdio configuration (adapt the wrapper schema to your IDE; the package must be preinstalled):
1191
1211
 
1192
1212
  ```yaml
1193
1213
  mcpServers:
1194
1214
  - name: praxis
1195
1215
  transport: stdio
1196
1216
  command: npx
1197
- args: ["praxis", "mcp"]
1217
+ args: ["--no-install", "praxis-sec", "mcp"]
1198
1218
  ```
1199
1219
 
1200
1220
  In Docker (a container running praxis):
@@ -1204,7 +1224,7 @@ mcpServers:
1204
1224
  - name: praxis
1205
1225
  transport: stdio
1206
1226
  command: docker
1207
- args: ["exec", "-i", "darkai-ops", "praxis", "mcp"]
1227
+ args: ["exec", "-i", "your-container", "praxis", "mcp"]
1208
1228
  ```
1209
1229
 
1210
1230
  ### Available MCP tools
@@ -1212,17 +1232,18 @@ mcpServers:
1212
1232
  | Tool | Input | Returns | Description |
1213
1233
  |------|-------|---------|-------------|
1214
1234
  | `scan_secrets` | `{ path }` | findings[] | Scan a file/directory for hardcoded secrets |
1215
- | `scan_repo` | `{ path, deep? }` | findings[] + score | Full orchestrator scan (all 28 agents + intel) |
1216
- | `analyze_file` | `{ path }` | findings[] | Deep LLM analysis of a single file |
1217
- | `get_findings` | `{ severity? }` | findings[] | Retrieve cached findings (optionally filtered) |
1235
+ | `scan_repo` | `{ path, agents?, llm?, outputFile? }` | findings + score + completion | Built-in orchestrator scan; dependency audit skipped; optional LLM analysis |
1236
+ | `analyze_file` | `{ path }` | findings | Static secret analysis of a file |
1237
+ | `get_findings` | `{ reportPath, severity? }` | report + findings | Read an explicitly saved JSON report |
1218
1238
  | `get_checklist` | — | checklist[] | Launch-day security checklist items |
1219
- | `suppress_finding` | `{ id, reason }` | `{ ok }` | Suppress a finding (writes to `.praxis/ignores.json`) |
1239
+ | `suppress_finding` | `{ file, line, reason }` | suppression status | Append a trailing comment to a reviewed source line; supported comment formats only |
1240
+ | `explain_and_fix` | `{ file, line, rule }` | explanation + preview | AST-aware explanation and proposed fix preview |
1220
1241
 
1221
1242
  ### Example MCP interaction
1222
1243
 
1223
1244
  When connected, an IDE user can ask: *"Scan this file for AI vulnerabilities"*
1224
1245
  and the LLM calls `scan_repo` — Praxis findings appear inline in the chat with
1225
- file:line references. The `deep` flag triggers LLM-powered taint analysis.
1246
+ file:line references. The `llm` option requests provider-backed analysis. Require `scanComplete === true`, inspect errors, and disclose skipped checks. Suppression writes source and is not remediation.
1226
1247
 
1227
1248
  ---
1228
1249
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "praxis-sec",
3
- "version": "1.2.1",
4
- "description": "Praxis — From finding to fix, on autopilot. AI-native security CLI with 28 parallel agents covering AI / MCP / skill threats, OWASP LLM Top 10, multi-source supply-chain intel (OSV / GHSA / KEV / EPSS / NVD / Gitleaks + optional paid feeds), secret scanning, and an LLM-powered agentic remediation loop.",
3
+ "version": "1.2.4",
4
+ "description": "Praxis security CLI: 28 built-in scanners for AI apps, agents, MCP and code; local static analysis, optional LLM-assisted fixes, verification, threat intelligence and CI gates.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
7
7
  "praxis": "cli/bin/praxis.js"
@@ -11,8 +11,9 @@
11
11
  "test": "node --test cli/__tests__/intel.test.js cli/__tests__/agents.test.js cli/__tests__/core.test.js cli/__tests__/standards.test.js cli/__tests__/model-file-scanner.test.js cli/__tests__/prompt-injection-prober.test.js cli/__tests__/ast-engine.test.js cli/__tests__/benchmark.test.js cli/__tests__/redteam.test.js cli/__tests__/html-reporter.test.js cli/__tests__/scan-fingerprint.test.js cli/__tests__/fix-ledger.test.js cli/__tests__/threatpack-probes.test.js cli/__tests__/score-history.test.js cli/__tests__/web-ui.test.js cli/__tests__/rule-portability.test.js cli/__tests__/git-remote.test.js cli/__tests__/release-reliability.test.js",
12
12
  "test:determinism": "node scripts/check-determinism.mjs .",
13
13
  "lint": "eslint cli/",
14
+ "release:check": "node scripts/release-check.mjs",
14
15
  "praxis": "node cli/bin/praxis.js",
15
- "prepublishOnly": "npm test && npm run lint && npm run test:determinism"
16
+ "prepublishOnly": "node scripts/release-check.mjs --publishing"
16
17
  },
17
18
  "keywords": [
18
19
  "security",
@@ -55,6 +56,7 @@
55
56
  "ai-defense/",
56
57
  "docs/",
57
58
  "!docs/internal/",
59
+ "assets/",
58
60
  "scripts/check-determinism.mjs",
59
61
  "README.md",
60
62
  "LICENSE"
@@ -62,8 +64,8 @@
62
64
  "dependencies": {
63
65
  "chalk": "^5.3.0",
64
66
  "commander": "^12.1.0",
65
- "fast-glob": "^3.3.3",
66
67
  "ora": "^8.0.1",
68
+ "tinyglobby": "^0.2.17",
67
69
  "write-file-atomic": "^5.0.1"
68
70
  },
69
71
  "devDependencies": {
@@ -1,5 +1,11 @@
1
1
  # Security Snippets
2
2
 
3
+ > These examples are illustrative and require adaptation and tests. Prompt text,
4
+ > keyword filters, and in-memory limits do not enforce authorization or tenant
5
+ > isolation. Apply access controls, tool restrictions, and resource limits in code;
6
+ > test the deployed system against its actual threat model.
7
+
8
+
3
9
  **Copy-paste code blocks for common security patterns.**
4
10
 
5
11
  This folder contains drop-in code snippets for securing your application. Each snippet is heavily commented to explain *why* it works.