agentinel 0.0.1
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 +21 -0
- package/README.md +104 -0
- package/data/malware-names.json.gz +0 -0
- package/dist/asen.js +1838 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aman Janwani
|
|
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,104 @@
|
|
|
1
|
+
# agentinel
|
|
2
|
+
|
|
3
|
+
Guards your AI coding agent when it installs npm packages.
|
|
4
|
+
|
|
5
|
+
Coding agents install dependencies on your behalf, often without you looking closely. Sometimes
|
|
6
|
+
they install a package that was registered last week with no history, sometimes one whose name they
|
|
7
|
+
invented, and sometimes a legitimate package that pulls in a compromised one three levels deep.
|
|
8
|
+
agentinel checks every package an install would bring in, at the moment the agent reaches for it,
|
|
9
|
+
and tells the agent why something looks wrong so it can back off.
|
|
10
|
+
|
|
11
|
+
Every other tool in this space guards your terminal. agentinel guards your agent.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install --save-dev agentinel && npx asen init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
That sets up a hook for whichever coding agents you use, plus a git pre-commit hook. No account, no
|
|
20
|
+
server, no configuration.
|
|
21
|
+
|
|
22
|
+
You can also try it with `npx agentinel init` and nothing installed, though the agent hook then
|
|
23
|
+
resolves through npx on every command, which is slower.
|
|
24
|
+
|
|
25
|
+
## What it checks
|
|
26
|
+
|
|
27
|
+
Every package an install would actually bring in, not just the one you named. `npm install express`
|
|
28
|
+
looks like one package and installs 67, and most real npm malware hides in the transitive ones.
|
|
29
|
+
|
|
30
|
+
- **Known malware.** A bundled list of 216,000 packages confirmed malicious (from the open OSV
|
|
31
|
+
database), matched on your machine. Nothing about what you install is ever sent anywhere.
|
|
32
|
+
- **npm takedowns.** Packages npm itself has pulled for security.
|
|
33
|
+
- **New and unused.** Registered in the last 30 days with under 1,000 monthly downloads, the classic
|
|
34
|
+
slopsquat shape.
|
|
35
|
+
- **No track record.** No repository, one version ever, barely downloaded.
|
|
36
|
+
- **Sudden bloat.** A patch release that triples the amount of code, paired with a change of
|
|
37
|
+
publisher: the fingerprint of a hijacked maintainer account.
|
|
38
|
+
|
|
39
|
+
Names that do not exist on npm at all are called out too, since a name an agent invented is exactly
|
|
40
|
+
what a slopsquatter waits to register.
|
|
41
|
+
|
|
42
|
+
Against the 100 most depended-on packages on npm it flags **zero** of them, while catching every
|
|
43
|
+
package in its known-bad test set. A security tool that cries wolf gets uninstalled the same day, so
|
|
44
|
+
that number is the one that matters.
|
|
45
|
+
|
|
46
|
+
## Which agents
|
|
47
|
+
|
|
48
|
+
CLI agents, all through their native pre-execution hook: **Claude Code, Codex CLI, Copilot CLI, and
|
|
49
|
+
Gemini CLI**. `asen init` wires up whichever of them it finds on your machine. When it blocks
|
|
50
|
+
something in strict mode, the agent is told why in a way it understands, so it looks for a safe
|
|
51
|
+
alternative instead of retrying.
|
|
52
|
+
|
|
53
|
+
For installs that never go through an agent, a person typing `npm i` by hand or a script shelling
|
|
54
|
+
out, there is an opt-in shim (`asen init --shim`) that checks those too. And the git pre-commit hook
|
|
55
|
+
scans the staged lockfile, so a poisoned dependency cannot slip in through a commit either.
|
|
56
|
+
|
|
57
|
+
## Warn or block
|
|
58
|
+
|
|
59
|
+
Warn is the default: it tells you and the agent, and gets out of the way. Set `"mode": "strict"` in
|
|
60
|
+
`.agentinel.json` to turn a finding into a block.
|
|
61
|
+
|
|
62
|
+
## Commands
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npx asen init # set up hooks in this repo
|
|
66
|
+
npx asen init --shim # also guard installs you type by hand
|
|
67
|
+
asen check # check the staged dependencies now
|
|
68
|
+
asen check some-package # check a specific package
|
|
69
|
+
asen allow <pkg> --reason "why" # allowlist a package, with a logged reason
|
|
70
|
+
asen unshim # remove the shim
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`asen check` exits non-zero when something is flagged, so it works as a CI step.
|
|
74
|
+
|
|
75
|
+
The allowlist lives in `.agentinel.json` and is committed, so the reason a package was trusted is
|
|
76
|
+
visible to everyone on the repo. It is a trail, not a silent bypass.
|
|
77
|
+
|
|
78
|
+
## How it stays out of your way
|
|
79
|
+
|
|
80
|
+
agentinel does no network interception. It runs no proxy, changes no TLS settings, and injects no
|
|
81
|
+
environment variables. So it cannot break `npm test`, a private registry, or a Rust or Go build, the
|
|
82
|
+
way a man-in-the-middle proxy can. The malware list is matched locally and works offline. If the npm
|
|
83
|
+
API is unreachable, a check is skipped with a note rather than blocking your work.
|
|
84
|
+
|
|
85
|
+
## Platforms
|
|
86
|
+
|
|
87
|
+
macOS and Linux are fully supported. Windows works too: the agent hooks and the git pre-commit hook
|
|
88
|
+
run, and the optional shim installs as a PowerShell-friendly wrapper. Windows is written and covered
|
|
89
|
+
by tests but has had less real-world use than macOS and Linux, so if something misbehaves there,
|
|
90
|
+
please open an issue.
|
|
91
|
+
|
|
92
|
+
## Scope
|
|
93
|
+
|
|
94
|
+
The npm registry only, which covers npm, pnpm, yarn, and bun, since they all install from it. Not a
|
|
95
|
+
CVE scanner, that is what `npm audit`, Snyk, and Dependabot are for. This finds malicious packages,
|
|
96
|
+
not vulnerable-but-legitimate ones.
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT. See [LICENSE](LICENSE).
|
|
Binary file
|