cognium-ai 1.1.0 → 1.1.2
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 +139 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# cognium-ai
|
|
2
|
+
|
|
3
|
+
AI-powered static analysis CLI with LLM-enhanced vulnerability detection. Built on [circle-ir](https://github.com/cogniumhq/circle-ir) and [circle-ir-ai](https://www.npmjs.com/package/circle-ir-ai).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g cognium-ai
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cognium-ai scan <path> # Scan for security vulnerabilities (LLM-enhanced)
|
|
15
|
+
cognium-ai dead-code <path> # Detect dead/unreachable code
|
|
16
|
+
cognium-ai secrets <path> # Scan for secrets and credentials
|
|
17
|
+
cognium-ai health <path> # Calculate codebase health score
|
|
18
|
+
cognium-ai skill <path> # Analyze AI skill bundle security
|
|
19
|
+
cognium-ai init # Create configuration file
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Scan Options
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cognium-ai scan src/ # LLM-enhanced scan (default)
|
|
26
|
+
cognium-ai scan src/ --no-llm # Static-only (no LLM)
|
|
27
|
+
cognium-ai scan src/ --llm-discovery # LLM discovery mode (deeper)
|
|
28
|
+
cognium-ai scan src/ -f json -o results.json # JSON output to file
|
|
29
|
+
cognium-ai scan src/ -f sarif -o results.sarif # SARIF output
|
|
30
|
+
cognium-ai scan src/ --severity high # High+ severity only
|
|
31
|
+
cognium-ai scan src/ --exclude-tests # Skip test files
|
|
32
|
+
cognium-ai scan src/ --threads 20 # Custom parallelism
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## LLM Configuration
|
|
36
|
+
|
|
37
|
+
Configure via CLI flags or environment variables (flags take precedence):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# CLI flags (override env vars)
|
|
41
|
+
cognium-ai scan src/ \
|
|
42
|
+
--llm-base-url https://api.openai.com/v1 \
|
|
43
|
+
--llm-api-key sk-... \
|
|
44
|
+
--llm-model gpt-4o
|
|
45
|
+
|
|
46
|
+
# Environment variables (used as defaults)
|
|
47
|
+
export LLM_API_KEY=your-api-key
|
|
48
|
+
export LLM_BASE_URL=http://localhost:4000/v1
|
|
49
|
+
export LLM_ENRICHMENT_MODEL=cognium/gpt-oss-120b
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Flag | Description | Default |
|
|
53
|
+
|------|-------------|---------|
|
|
54
|
+
| `--llm-base-url <url>` | LLM API base URL (OpenAI-compatible) | `http://localhost:4000/v1` |
|
|
55
|
+
| `--llm-api-key <key>` | LLM API key | `LLM_API_KEY` env var |
|
|
56
|
+
| `--llm-model <model>` | LLM model name | `cognium/gpt-oss-120b` |
|
|
57
|
+
| `--no-llm` | Disable LLM, static analysis only | off |
|
|
58
|
+
| `--llm-discovery` | Enable deeper LLM discovery mode | off |
|
|
59
|
+
|
|
60
|
+
### Provider Examples
|
|
61
|
+
|
|
62
|
+
| Provider | `--llm-base-url` | `--llm-model` |
|
|
63
|
+
|----------|-------------------|---------------|
|
|
64
|
+
| Cognium (free) | `http://localhost:4000/v1` | `cognium/gpt-oss-120b` |
|
|
65
|
+
| OpenAI | `https://api.openai.com/v1` | `gpt-4o` |
|
|
66
|
+
| GitHub Models (free) | `https://models.github.ai/inference` | `openai/gpt-5` |
|
|
67
|
+
| Azure OpenAI | `https://YOUR.openai.azure.com/...` | `gpt-4o` |
|
|
68
|
+
| Ollama (local) | `http://localhost:11434/v1` | `llama3` |
|
|
69
|
+
| Together AI | `https://api.together.xyz/v1` | `meta-llama/Llama-3-70b` |
|
|
70
|
+
|
|
71
|
+
## CI/CD with GitHub Actions
|
|
72
|
+
|
|
73
|
+
Run LLM-enhanced SAST in CI using [GitHub Models](https://github.com/marketplace?type=models) free tier -- no API keys to configure:
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
name: Security Scan
|
|
77
|
+
on: [pull_request]
|
|
78
|
+
|
|
79
|
+
permissions:
|
|
80
|
+
contents: read
|
|
81
|
+
models: read
|
|
82
|
+
|
|
83
|
+
jobs:
|
|
84
|
+
scan:
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v4
|
|
88
|
+
- uses: actions/setup-node@v4
|
|
89
|
+
with:
|
|
90
|
+
node-version: "22"
|
|
91
|
+
|
|
92
|
+
- run: npm install -g cognium-ai
|
|
93
|
+
|
|
94
|
+
- name: LLM-enhanced SAST scan
|
|
95
|
+
env:
|
|
96
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
run: |
|
|
98
|
+
cognium-ai scan ./src \
|
|
99
|
+
--llm-base-url https://models.github.ai/inference \
|
|
100
|
+
--llm-api-key "$GITHUB_TOKEN" \
|
|
101
|
+
--llm-model openai/gpt-5 \
|
|
102
|
+
-f sarif -o results.sarif
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Free tier limits**: `openai/gpt-5` = 50 req/day, `openai/gpt-4o-mini` = 150 req/day. Uses the built-in `GITHUB_TOKEN` with `models: read` permission.
|
|
106
|
+
|
|
107
|
+
## Supported Languages
|
|
108
|
+
|
|
109
|
+
| Language | Extensions | Frameworks |
|
|
110
|
+
|----------|------------|------------|
|
|
111
|
+
| Java | `.java` | Spring, JAX-RS, Servlet API |
|
|
112
|
+
| JavaScript | `.js`, `.mjs` | Express, Fastify, Node.js |
|
|
113
|
+
| TypeScript | `.ts`, `.tsx` | Express, Fastify, Node.js |
|
|
114
|
+
| Python | `.py` | Flask, Django, FastAPI |
|
|
115
|
+
| Rust | `.rs` | Actix-web, Rocket, Axum |
|
|
116
|
+
| Bash | `.sh`, `.bash` | Shell scripts |
|
|
117
|
+
|
|
118
|
+
## Benchmark Results
|
|
119
|
+
|
|
120
|
+
| Benchmark | Score |
|
|
121
|
+
|-----------|-------|
|
|
122
|
+
| OWASP Benchmark (Java, 1415 tests) | +100% |
|
|
123
|
+
| Juliet Test Suite (156 tests) | +100% |
|
|
124
|
+
| SecuriBench Micro | 97.7% TPR, 6.7% FPR |
|
|
125
|
+
| CWE-Bench-Java (120 CVEs) | 42.5% static, 81.7% +LLM Discovery |
|
|
126
|
+
| NodeJS Synthetic (25 tests) | 100% TPR |
|
|
127
|
+
| CWE-Bench-Rust (30 tests) | 77.8% TPR, 0% FPR |
|
|
128
|
+
| Bash Synthetic (31 tests) | 68.2% TPR, 0% FPR |
|
|
129
|
+
|
|
130
|
+
CWE-Bench-Java reference: CodeQL 22.5%, IRIS+GPT-4 45.8%.
|
|
131
|
+
|
|
132
|
+
## Related Packages
|
|
133
|
+
|
|
134
|
+
- **[circle-ir](https://github.com/cogniumhq/circle-ir)** -- Core SAST library (open source, MIT)
|
|
135
|
+
- **[circle-ir-ai](https://www.npmjs.com/package/circle-ir-ai)** -- LLM enrichment layer and programmatic API
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.1.
|
|
1
|
+
export declare const version = "1.1.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.1.
|
|
1
|
+
export const version = '1.1.2';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cognium-ai",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "AI-powered static analysis CLI with LLM-enhanced vulnerability detection",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"LICENSE"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"circle-ir-ai": "
|
|
44
|
+
"circle-ir-ai": "^1.4.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.0.0",
|