flagrix 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Flagrix
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # flagrix
2
+
3
+ Scan GitHub repositories and profiles for malware **before you clone** — from the
4
+ terminal, CI, or an AI agent. The same commit-pinned verdict as the
5
+ [Flagrix browser extension](https://flagrix.io), made callable.
6
+
7
+ ```bash
8
+ npx flagrix scan https://github.com/some-org/coding-assignment
9
+ ```
10
+
11
+ ```
12
+ some-org/coding-assignment @ 3f9c2a1
13
+ HIGH RISK — Do not clone security score 12/100
14
+ 3 files scanned · 10 dependencies · 2 issues
15
+
16
+ CRITICAL Data exfiltration patterns detected: Keylogger Pattern
17
+ assignment.js:14
18
+ 14 document.addEventListener("keydown", (e) => send(e.key))
19
+ ```
20
+
21
+ Built after real fake-recruiter campaigns ("coding assignment" repos that steal
22
+ wallets, SSH keys, and browser sessions) started targeting developers.
23
+
24
+ ## Commands
25
+
26
+ ```bash
27
+ flagrix scan <url | owner/repo> # scan a repository (--ref <branch|sha>)
28
+ flagrix scan-user <username> # score a GitHub profile for scam signals
29
+ flagrix mcp # MCP server (stdio) for AI agents
30
+ ```
31
+
32
+ ## Exit codes
33
+
34
+ | code | meaning |
35
+ |---|---|
36
+ | 0 | low risk |
37
+ | 1 | scan failed |
38
+ | 2 | medium risk — review before proceeding |
39
+ | 3 | high risk — do not clone |
40
+
41
+ `--json` (automatic when stdout is piped) emits the full result. The verdict is
42
+ **pinned to the scanned commit** (`commitSha` in the JSON): every file is read at
43
+ that SHA, so a push mid-scan or after the verdict can't silently invalidate it.
44
+
45
+ ## AI agents
46
+
47
+ ```bash
48
+ claude mcp add flagrix -- npx -y flagrix mcp
49
+ ```
50
+
51
+ Tools: `scan_github_repo`, `scan_github_user`. A Claude Code hook that gates every
52
+ `git clone` on a scan ships in [hooks/](hooks/) — see
53
+ [docs/agent-gating.md](docs/agent-gating.md).
54
+
55
+ ## Tokens & rate limits
56
+
57
+ Unauthenticated scans use GitHub's 60 req/h budget (a scan issues one request per
58
+ scanned file, up to ~50). Set `GITHUB_TOKEN` (or `FLAGRIX_GITHUB_TOKEN`, or
59
+ `--token`) to raise it to 5,000/h and to scan private repositories.
60
+
61
+ ## Privacy
62
+
63
+ Fully local. No telemetry, no accounts, no Flagrix backend — the only network
64
+ calls go to the GitHub/npm APIs and the public
65
+ [detection-rules](https://github.com/flagrix-io/flagrix-detection-rules)
66
+ repository (signature refresh, cached 6 h, with a bundled offline snapshot).
67
+
68
+ ## How it works
69
+
70
+ Scanning logic lives in [@flagrix/scanner-core](https://github.com/flagrix-io/flagrix-scanner-core)
71
+ (MIT), signatures in [flagrix-detection-rules](https://github.com/flagrix-io/flagrix-detection-rules)
72
+ (MIT) — the same engine and rules the browser extension uses. Verdicts are risk
73
+ assessments, not definitive fraud determinations; always verify through official
74
+ channels.
75
+
76
+ ## AI Disclosure
77
+
78
+ This project leverages Claude AI for boilerplate generation, test-suite expansion,
79
+ and optimization. All AI-generated code is strictly reviewed, refactored, and
80
+ verified by human maintainers before merging.
81
+
82
+ ## License
83
+
84
+ MIT — see [LICENSE](LICENSE).