skill-sentry-cli 2.0.0__tar.gz
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.
- skill_sentry_cli-2.0.0/.gitignore +39 -0
- skill_sentry_cli-2.0.0/CONTRIBUTING.md +74 -0
- skill_sentry_cli-2.0.0/LICENSE +21 -0
- skill_sentry_cli-2.0.0/PKG-INFO +76 -0
- skill_sentry_cli-2.0.0/README.md +174 -0
- skill_sentry_cli-2.0.0/SECURITY.md +59 -0
- skill_sentry_cli-2.0.0/docs/01-project-overview.md +132 -0
- skill_sentry_cli-2.0.0/docs/02-architecture.md +406 -0
- skill_sentry_cli-2.0.0/docs/03-database.md +376 -0
- skill_sentry_cli-2.0.0/docs/04-security.md +186 -0
- skill_sentry_cli-2.0.0/docs/05-api-reference.md +245 -0
- skill_sentry_cli-2.0.0/docs/06-ui-ux.md +169 -0
- skill_sentry_cli-2.0.0/docs/07-cli-reference.md +196 -0
- skill_sentry_cli-2.0.0/docs/08-testing-and-evaluation.md +203 -0
- skill_sentry_cli-2.0.0/docs/09-deployment-and-production.md +157 -0
- skill_sentry_cli-2.0.0/docs/10-developer-guide.md +159 -0
- skill_sentry_cli-2.0.0/docs/11-team-and-workload.md +258 -0
- skill_sentry_cli-2.0.0/docs/12-contract-additions.md +266 -0
- skill_sentry_cli-2.0.0/docs/13-laya-integration-plan.md +1047 -0
- skill_sentry_cli-2.0.0/docs/14-developer2-handoff.md +118 -0
- skill_sentry_cli-2.0.0/docs/15-v1-test-results.md +95 -0
- skill_sentry_cli-2.0.0/docs/16-user-guide.md +450 -0
- skill_sentry_cli-2.0.0/docs/17-release-process.md +76 -0
- skill_sentry_cli-2.0.0/docs/18-registry-accounts.md +88 -0
- skill_sentry_cli-2.0.0/docs/CHANGELOG.md +142 -0
- skill_sentry_cli-2.0.0/docs/README.md +72 -0
- skill_sentry_cli-2.0.0/docs/checklists/README.md +43 -0
- skill_sentry_cli-2.0.0/docs/checklists/dev1-backend-ai.md +169 -0
- skill_sentry_cli-2.0.0/docs/checklists/dev2-skill-analysis.md +157 -0
- skill_sentry_cli-2.0.0/docs/checklists/dev3-frontend.md +162 -0
- skill_sentry_cli-2.0.0/fixtures/README.md +46 -0
- skill_sentry_cli-2.0.0/packaging/PYPI_README.md +31 -0
- skill_sentry_cli-2.0.0/pyproject.toml +121 -0
- skill_sentry_cli-2.0.0/schemas/README.md +32 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/__init__.py +5 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/__main__.py +4 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/cli.py +918 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/__init__.py +1 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/anchors/__init__.py +5 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/anchors/credential_flow.py +440 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/anchors/declared_hosts.py +78 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/cache/__init__.py +35 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/cache/hash_utils.py +206 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/cache/sqlite_store.py +925 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/config.py +299 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/contracts.py +551 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/__init__.py +44 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/base.py +174 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/calibration.py +325 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/laya.py +439 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/mapping.py +218 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/mock.py +118 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/questions.py +118 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/report.py +65 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/decisions/selector.py +151 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/engine.py +1412 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/evasion/__init__.py +27 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/evasion/detector.py +210 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/exit_codes.py +13 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/__init__.py +20 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/_json.py +147 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/base.py +50 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/gemma_cloud.py +240 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/gemma_local.py +273 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/image_utils.py +112 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/mock.py +152 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/models/selector.py +123 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/parser/__init__.py +29 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/parser/skill_parser.py +520 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/parser/typosquat.py +167 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/poisoned_well/__init__.py +52 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/poisoned_well/attacker_profile.py +230 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/poisoned_well/canary_gen.py +413 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/poisoned_well/exfil_tracker.py +470 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/reports.py +114 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/__init__.py +74 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/assets/Dockerfile.sandbox +39 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/assets/masquerade.c +484 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/assets/run_skill.sh +41 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/assets/sinkhole_sidecar.py +171 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/canary_fs.py +108 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/context_honeypot.py +97 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/dns_sinkhole.py +218 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/fake_http.py +194 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/instructions.py +170 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/masquerade.py +265 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/monitor.py +278 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/runner.py +776 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/sandbox/sidecar.py +327 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/__init__.py +9 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/analyzer.py +443 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/ast_anchor.py +371 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/ast_python.py +156 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/candidates.py +78 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/laya_analyzer.py +241 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/semantic/prompts.py +61 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/verdict/__init__.py +24 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/verdict/fusion.py +392 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/verdict/markdown_report.py +211 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/verdict/sarif_report.py +139 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/verdict/status.py +35 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/verdict/stix_report.py +132 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/version.py +38 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/vision/__init__.py +8 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/vision/image_extractor.py +91 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/core/vision/vision_scanner.py +274 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/data/__init__.py +1 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/data/known_skills_v1.json +276 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/data/sandbox_image.json +4 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/rules/credential_rules.toml +94 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/__init__.py +5 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/app.py +129 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/backend.py +63 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/demo_assets.py +62 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/demo_backend.py +475 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/demo_data.py +814 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/demo_mode.py +40 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/errors.py +48 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/live_backend.py +576 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/server/routes.py +191 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/skill/SKILL.md +67 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/skill/scripts/audit.sh +48 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/ui/dist/assets/index-Bf0h24IX.css +1 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/ui/dist/assets/index-CrYBKSSB.js +8 -0
- skill_sentry_cli-2.0.0/skill_sentry_cli/ui/dist/index.html +14 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
.venv-laya/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
.coverage
|
|
15
|
+
coverage.xml
|
|
16
|
+
htmlcov/
|
|
17
|
+
|
|
18
|
+
# SkillSentry runtime state
|
|
19
|
+
skillsentry.toml
|
|
20
|
+
*.db
|
|
21
|
+
*.db-wal
|
|
22
|
+
*.db-shm
|
|
23
|
+
reports/
|
|
24
|
+
|
|
25
|
+
# Reports produced during local runs
|
|
26
|
+
*.sarif
|
|
27
|
+
stix-bundle.json
|
|
28
|
+
|
|
29
|
+
# Frontend
|
|
30
|
+
ui/node_modules/
|
|
31
|
+
ui/dist/
|
|
32
|
+
skill_sentry_cli/ui/dist/
|
|
33
|
+
ui/.vite/
|
|
34
|
+
|
|
35
|
+
# OS / editors
|
|
36
|
+
.DS_Store
|
|
37
|
+
Thumbs.db
|
|
38
|
+
.idea/
|
|
39
|
+
.vscode/
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributing to SkillSentry
|
|
2
|
+
|
|
3
|
+
Thanks for helping defend the agent skill supply chain! 🛡️ SkillSentry is MIT-licensed; by contributing you agree your contributions are licensed under the same terms.
|
|
4
|
+
|
|
5
|
+
**Start here:** [Developer Guide](docs/10-developer-guide.md) — environment setup, module ownership, coding standards, and extension guides.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Ground Rules
|
|
10
|
+
|
|
11
|
+
1. **The Verdict JSON Contract v1 is frozen.** Backward-compatible additions (new optional fields) only; breaking changes require a `v2` + migration path and sign-off from all maintainers. See [docs/05-api-reference.md](docs/05-api-reference.md) §5.5.
|
|
12
|
+
2. **Shared identifiers stay shared.** Stage names, WS event names, and severity enums live in one constants module — no stringly-typed duplicates in UI or backend.
|
|
13
|
+
3. **No error path may produce `SAFE`.** Any degraded scan must carry explicit `*-unavailable` findings (fail-safe rule).
|
|
14
|
+
4. **Fixtures are hazardous material.** Malicious fixtures run *only* through `skill-sentry-cli scan` (sandboxed), use fictional C2 domains (`evil-collector.net`, `evil-c2.com`), and never reference real credentials. See fixture safety rules in [docs/08-testing-and-evaluation.md](docs/08-testing-and-evaluation.md) §8.2.
|
|
15
|
+
5. **Fusion-weight / prompt / anchor / masquerade changes must re-run the full fixture corpus** and update `tests/expected_verdicts.json` in the same PR.
|
|
16
|
+
6. **Docs ship with behavior.** Public-facing changes update the relevant `docs/` file in the same PR.
|
|
17
|
+
|
|
18
|
+
## Development Workflow
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://github.com/<org>/skillsentry && cd skillsentry
|
|
22
|
+
python -m venv .venv && source .venv/bin/activate
|
|
23
|
+
pip install -e ".[dev]"
|
|
24
|
+
skill-sentry-cli init
|
|
25
|
+
# frontend:
|
|
26
|
+
cd ui && npm install && npm run dev
|
|
27
|
+
# no backend yet? build against the mock server:
|
|
28
|
+
python -m skill_sentry_cli.server.demo_mode --port 8000
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- **Branches:** `feat/<topic>`, `fix/<topic>`, `docs/<topic>` off `main`.
|
|
32
|
+
- **Commits:** [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `docs:`, `test:`, `chore:`).
|
|
33
|
+
- **Style:** Python — `ruff check` + `ruff format`, type hints, 3.11+ · TypeScript — `strict: true`, ESLint + Prettier.
|
|
34
|
+
- **PR checklist:**
|
|
35
|
+
- [ ] Unit tests for new logic; contract tests pass against **both** real API and mock server
|
|
36
|
+
- [ ] Fixture regression green (`pytest tests/` + `tests/check_expected_verdicts.py`)
|
|
37
|
+
- [ ] No new dependencies without rationale (minimal-dep principle; pinned lockfile)
|
|
38
|
+
- [ ] Docs updated (or `docs:` follow-up issue linked)
|
|
39
|
+
- [ ] No secrets, no real credential formats in tests/fixtures
|
|
40
|
+
|
|
41
|
+
## Good First Contributions
|
|
42
|
+
|
|
43
|
+
| Area | Ideas |
|
|
44
|
+
|:---|:---|
|
|
45
|
+
| **Detection** | New AST anchor patterns (PowerShell, Node skills); new evasion-probe indicators; typosquat dictionary expansion |
|
|
46
|
+
| **Fixtures** | Add benign/malicious fixtures toward the 20-skill Phase-1 corpus (with hand-annotated ground-truth lines) |
|
|
47
|
+
| **Canary intents** | New context-aware canary sets (e.g., npm, PyPI, OpenAI keys) — guide: [docs/10-developer-guide.md](docs/10-developer-guide.md) §10.7 |
|
|
48
|
+
| **UI** | Empty/loading/error state polish; accessibility passes (WCAG rules in [docs/06-ui-ux.md](docs/06-ui-ux.md) §6.6) |
|
|
49
|
+
| **Docs** | Tutorials, troubleshooting recipes, translations |
|
|
50
|
+
| **Reports** | SARIF rule-metadata enrichment; Markdown report theming |
|
|
51
|
+
|
|
52
|
+
## Ownership Map (core team)
|
|
53
|
+
|
|
54
|
+
Authoritative assignment: **[docs/11-team-and-workload.md](docs/11-team-and-workload.md)**.
|
|
55
|
+
|
|
56
|
+
| Area | Owner | Modules |
|
|
57
|
+
|:---|:---|:---|
|
|
58
|
+
| Sandbox, deception, models, verdict/reports, server | Dev 1 · Backend + AI Integration | `core/sandbox/`, `core/poisoned_well/`, `core/evasion/`, `core/models/`, `core/verdict/`, `server/`, `cli.py` |
|
|
59
|
+
| Malicious-instruction analysis | Dev 2 · Backend (Skill Analysis) | `core/parser/`, `core/semantic/`, `core/vision/`, `core/cache/`, analysis + benign fixtures |
|
|
60
|
+
| UI + demo assets | Dev 3 · Frontend | `ui/`, README GIF, backup demo video |
|
|
61
|
+
|
|
62
|
+
Cross-cutting changes (schemas, weights, stage list) need sign-off from all three owners.
|
|
63
|
+
|
|
64
|
+
## Security Issues
|
|
65
|
+
|
|
66
|
+
**Do not open public issues for vulnerabilities.** Follow [SECURITY.md](SECURITY.md) (private GitHub Security Advisory, 90-day embargo, safe harbor for good-faith research).
|
|
67
|
+
|
|
68
|
+
## Community IOC Feed (Phase 2)
|
|
69
|
+
|
|
70
|
+
Contributing indicators to the community blocklist is **opt-in**, strips all skill content/user identifiers, and is governed by a signed-feed + dispute process ([docs/04-security.md](docs/04-security.md) §4.10).
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
*Powered by Gemma 4 · open weights.*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Team SkillSentry
|
|
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.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: skill-sentry-cli
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A context-aware firewall for the agent skill supply chain with Poisoned Well active defense.
|
|
5
|
+
Project-URL: Homepage, https://github.com/EmberPhantom/SkillSentry
|
|
6
|
+
Project-URL: Source, https://github.com/EmberPhantom/SkillSentry
|
|
7
|
+
Project-URL: Issues, https://github.com/EmberPhantom/SkillSentry/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/EmberPhantom/SkillSentry/blob/main/docs/CHANGELOG.md
|
|
9
|
+
Author: Team SkillSentry
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agent-skills,local-llm,sandbox,security,supply-chain
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: docker<8.0,>=7.0
|
|
23
|
+
Requires-Dist: fastapi<1.0,>=0.115
|
|
24
|
+
Requires-Dist: httpx<1.0,>=0.27
|
|
25
|
+
Requires-Dist: jinja2<4.0,>=3.1
|
|
26
|
+
Requires-Dist: pillow<13.0,>=10.0
|
|
27
|
+
Requires-Dist: pydantic<3.0,>=2.9
|
|
28
|
+
Requires-Dist: python-frontmatter<2.0,>=1.1
|
|
29
|
+
Requires-Dist: pyyaml<7.0,>=6.0.1
|
|
30
|
+
Requires-Dist: rich<15.0,>=13.7
|
|
31
|
+
Requires-Dist: typer<1.0,>=0.16
|
|
32
|
+
Requires-Dist: uvicorn[standard]<1.0,>=0.30
|
|
33
|
+
Requires-Dist: watchdog<7.0,>=4.0
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: hypothesis<7.0,>=6.100; extra == 'dev'
|
|
36
|
+
Requires-Dist: jsonschema<5.0,>=4.22; extra == 'dev'
|
|
37
|
+
Requires-Dist: pytest-asyncio<2.0,>=0.23; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-cov<8.0,>=5.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest<9.0,>=8.2; extra == 'dev'
|
|
40
|
+
Requires-Dist: respx<1.0,>=0.21; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff<1.0,>=0.6; extra == 'dev'
|
|
42
|
+
Provides-Extra: laya
|
|
43
|
+
Requires-Dist: laya<0.5,>=0.4.17; extra == 'laya'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# SkillSentry
|
|
47
|
+
|
|
48
|
+
**Audit agent skills before you install them.** SkillSentry checks a skill's text and scripts, runs its entrypoint inside a locked-down Docker sandbox, and returns one verdict: `SAFE`, `SUSPICIOUS`, `MALICIOUS`, or `UNSCANNED` when the scan could not finish. Analysis runs on your machine through a local model, and nothing is uploaded.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pipx install skill-sentry-cli # or: python -m pip install skill-sentry-cli
|
|
54
|
+
skill-sentry-cli setup # checks Docker and the local model, builds the sandbox
|
|
55
|
+
skill-sentry-cli doctor # confirms the setup is ready
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Requirements: Python 3.11 to 3.13, Docker (for the sandbox), and [Ollama](https://ollama.com) for the local model. `skill-sentry-cli doctor` tells you the exact command for anything missing.
|
|
59
|
+
|
|
60
|
+
## First scan
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
skill-sentry-cli scan path/to/my-skill
|
|
64
|
+
skill-sentry-cli scan path/to/skills-folder --format sarif --sarif-out results.sarif
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Exit codes: `0` below the gate, `1` at or above it, `2` a usage error, `3` an operational error. The default gate is `--fail-on suspicious`.
|
|
68
|
+
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
- [User guide](https://github.com/EmberPhantom/SkillSentry/blob/main/docs/16-user-guide.md): install, first scans, reports, dashboard, CI, troubleshooting.
|
|
72
|
+
- [CLI reference](https://github.com/EmberPhantom/SkillSentry/blob/main/docs/07-cli-reference.md)
|
|
73
|
+
- [Security model](https://github.com/EmberPhantom/SkillSentry/blob/main/docs/04-security.md)
|
|
74
|
+
- [Source and issues](https://github.com/EmberPhantom/SkillSentry)
|
|
75
|
+
|
|
76
|
+
MIT licensed.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🛡️ SkillSentry
|
|
4
|
+
|
|
5
|
+
**A Context-Aware Firewall for the Agent Skill Supply Chain with "Poisoned Well" Active Defense**
|
|
6
|
+
|
|
7
|
+
*Your proprietary skills never leave your machine for auditing. We don't just block attackers; we follow them home.*
|
|
8
|
+
|
|
9
|
+
  
|
|
10
|
+
|
|
11
|
+
**⚡ Runs fully on your machine · open weights ⚡**
|
|
12
|
+
|
|
13
|
+
<!-- Record the 30-sec demo GIF during M4 (docs/08-testing-and-evaluation.md §8.7) -->
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🔎 30-Second Pitch
|
|
20
|
+
|
|
21
|
+
Agent Skills execute code **and** inject instructions into AI agents — the newest supply-chain attack surface. Snyk's Feb 2026 *ToxicSkills* audit found **~1,467 malicious skills** (prompt injection in **36%** of ClawHub skills examined); the *ClawHavoc* campaign pushed **1,184+ malicious skills** in six weeks. OWASP now lists **AST01 — Malicious Skills** as a formal risk category.
|
|
22
|
+
|
|
23
|
+
**SkillSentry** audits any skill **before it installs — 100% locally**: local multimodal language-model reasoning (text + vision) fused with deterministic AST anchors and a hardened Docker sandbox featuring **context-aware honeypots**, **sandbox-evasion detection**, and the **☠️ Poisoned Well** — fake, intent-matched credentials that let us catch the thief, decode our canary marker out of their exfil traffic, and map their C2 infrastructure. Clean skills install with zero friction (⚡ < 2 s cached re-scans). Malicious skills are blocked with hard, line-cited evidence and a STIX IOC export.
|
|
24
|
+
|
|
25
|
+
## 🏴☠️ Threat Model
|
|
26
|
+
|
|
27
|
+
```mermaid
|
|
28
|
+
flowchart LR
|
|
29
|
+
subgraph Threat_Actors["🏴☠️ Threat Actors"]
|
|
30
|
+
A1["Compromised Dev Account"]
|
|
31
|
+
A2["Typosquatter"]
|
|
32
|
+
A3["Supply Chain Poisoner<br/>(benign → malicious update)"]
|
|
33
|
+
end
|
|
34
|
+
subgraph Registry["📦 Public Registry (ClawHub)"]
|
|
35
|
+
R1["Malicious Skill Package"]
|
|
36
|
+
end
|
|
37
|
+
subgraph Local_Env["💻 Developer Local Environment"]
|
|
38
|
+
L1["Agent IDE / CLI"] --> L2["SkillSentry<br/>Pre-Install Gate"]
|
|
39
|
+
L2 -->|"✅ CLEAN"| L3["Agent Runtime"]
|
|
40
|
+
L2 -->|"🚫 MALICIOUS"| L4["Block & Map C2"]
|
|
41
|
+
end
|
|
42
|
+
A1 --> R1
|
|
43
|
+
A2 --> R1
|
|
44
|
+
A3 --> R1
|
|
45
|
+
R1 -->|"1. Download"| L1
|
|
46
|
+
L1 -->|"2. Audit"| L2
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Attack vectors covered: credential theft · image-hidden prompt injection (white-on-white payloads) · typosquatting · tool poisoning · obfuscation (`eval`, base64 bombs) · sandbox evasion · post-install supply-chain poisoning. Full model: [docs/04-security.md](docs/04-security.md).
|
|
50
|
+
|
|
51
|
+
## 🏗️ Architecture — the 8-Stage Pipeline
|
|
52
|
+
|
|
53
|
+
```mermaid
|
|
54
|
+
flowchart TD
|
|
55
|
+
A["📦 Skill Package (SKILL.md + scripts/ + assets/)"] --> S0
|
|
56
|
+
S0["0 · Incremental Cache — SHA-256 → SQLite, hit = ⚡ <2s"] --> S1
|
|
57
|
+
S1["1 · Spec Validation + Typosquat (Levenshtein ≤ 2)"] --> S2
|
|
58
|
+
S2["2 · Deterministic AST Anchors → local model semantic analysis"] --> S3
|
|
59
|
+
S3["3 · Multimodal Vision Scan — OCR hidden image payloads"] --> S4
|
|
60
|
+
S4["4 · Context-Aware Sandbox — masquerade, canary FS, DNS sinkhole, fake HTTP (60s/512MB/1CPU)"] --> S45
|
|
61
|
+
S45["4.5 · ☠️ Poisoned Well — fake intent-matched creds → track exfil → profile C2"] --> S5
|
|
62
|
+
S5["5 · Sandbox Evasion Detection — probe ⇒ auto-MALICIOUS"] --> S6
|
|
63
|
+
S6["6 · Verdict Engine — weighted fusion → 0–100 → SARIF 2.1.0"] --> OUT["✅ Install / 🚫 Block / 🖥️ Triage Dashboard"]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Why it's different | |
|
|
67
|
+
|:---|:---|
|
|
68
|
+
| **Pre-install + runtime (MCP, Phase 2)** | not just post-install network watching |
|
|
69
|
+
| **LLM + Vision + Sandbox + Active Defense** | not just regex/text scanning |
|
|
70
|
+
| **Deterministic anchoring** | the LLM cannot contradict hard AST facts — credible, not vibes |
|
|
71
|
+
| **Hard-evidence overrides** | canary-marker correlation or evasion probe ⇒ `MALICIOUS`, confidence 1.0 |
|
|
72
|
+
| **100% local** | A quantized local model via Ollama; opt-in cloud fallback; no telemetry |
|
|
73
|
+
| **Fights back** | Poisoned Well deception + C2 tracking + STIX IOC export |
|
|
74
|
+
|
|
75
|
+
Deep-dives: [Architecture](docs/02-architecture.md) · [Database](docs/03-database.md) · [Security](docs/04-security.md) · [API](docs/05-api-reference.md) · [UI/UX](docs/06-ui-ux.md).
|
|
76
|
+
|
|
77
|
+
> **Original code:** the sandbox runner, canary filesystem, DNS sinkhole, context-aware honeypot system, sandbox evasion detector, and Poisoned Well correlation engine are original code.
|
|
78
|
+
|
|
79
|
+
## 🚀 How to Run
|
|
80
|
+
|
|
81
|
+
Install with `pipx install skill-sentry-cli`, or with the install script in the latest release. Then run `skill-sentry-cli setup`. The step-by-step guide covers first scans, reports, the dashboard, CI, and troubleshooting: **[docs/16-user-guide.md](docs/16-user-guide.md)**.
|
|
82
|
+
|
|
83
|
+
**Prereqs:** Python 3.11 to 3.13 · Docker (for the sandbox) · [Ollama](https://ollama.com) with a local model. `skill-sentry-cli setup` checks all of these and asks before anything is downloaded.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# From a checkout (a PyPI release is planned, not yet published)
|
|
87
|
+
pip install -e .
|
|
88
|
+
cd ui && npm ci && npm run build && cd .. # builds the dashboard into the package
|
|
89
|
+
skill-sentry-cli init # writes skillsentry.toml
|
|
90
|
+
skill-sentry-cli sandbox build # builds the sandbox image (needs Docker)
|
|
91
|
+
|
|
92
|
+
skill-sentry-cli doctor # tells you the exact `ollama pull` command for the local model
|
|
93
|
+
|
|
94
|
+
skill-sentry-cli scan ./fixtures/benign/pdf-summarizer # ✅ SAFE
|
|
95
|
+
skill-sentry-cli scan ./fixtures/malicious/cloud-sync-pro # 🚫 MALICIOUS + ☠️ C2 mapped
|
|
96
|
+
skill-sentry-cli scan ./fixtures/benign/pdf-summarizer # ⚡ cached
|
|
97
|
+
|
|
98
|
+
skill-sentry-cli serve # Dashboard → http://127.0.0.1:8000
|
|
99
|
+
skill-sentry-cli scan cloud-sync-pro --demo-mode # offline canned demo (skill names), no Docker or model needed
|
|
100
|
+
skill-sentry-cli export <scan_id> --format sarif # re-render a stored report
|
|
101
|
+
skill-sentry-cli cache stats # inspect the verdict cache
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Server image:** `docker build -t skillsentry/server:2.0.0 .` then
|
|
105
|
+
`docker run -p 127.0.0.1:8000:8000 skillsentry/server:2.0.0`. The container does not
|
|
106
|
+
mount the Docker socket, so the sandbox is unavailable inside it by default. Mounting
|
|
107
|
+
`/var/run/docker.sock` gives the container root-equivalent control of the host, so only do
|
|
108
|
+
that deliberately.
|
|
109
|
+
|
|
110
|
+
**Release build and local checks** (CI is blocked while the GitHub account has a billing issue):
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
scripts/check.sh # lint, format, tests, schema drift, demo smoke
|
|
114
|
+
scripts/build_release.sh # dashboard, wheel, and a fresh-venv install check
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**CI / PR gate (planned):** a `skillsentry/scan` GitHub Action is planned and is not yet published. The intended interface is:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
- uses: skillsentry/scan@v1 # planned
|
|
121
|
+
with:
|
|
122
|
+
path: ./skills/
|
|
123
|
+
fail-on: suspicious # the CLI default is suspicious
|
|
124
|
+
upload-sarif: true # GitHub Security tab
|
|
125
|
+
cache: true # incremental re-scans
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Full CLI reference: [docs/07-cli-reference.md](docs/07-cli-reference.md) · Deployment: [docs/09-deployment-and-production.md](docs/09-deployment-and-production.md) (the whole team server fits a **$12 DigitalOcean droplet**).
|
|
129
|
+
|
|
130
|
+
## 📊 Evaluation (7+1 fixture corpus)
|
|
131
|
+
|
|
132
|
+
| Skill | Behavior | Expected | Caught by |
|
|
133
|
+
|:---|:---|:---|:---|
|
|
134
|
+
| `pdf-summarizer` | pure text processing | ✅ SAFE < 30 | — |
|
|
135
|
+
| `git-helper` | local git ops | ✅ SAFE < 30 | — |
|
|
136
|
+
| `image-resizer` | file ops only | ✅ SAFE < 30 | — |
|
|
137
|
+
| `weather-fetch` | **declared** network call | ✅ SAFE < 30 | — (no false positives) |
|
|
138
|
+
| `cloud-sync-pro` | steals `~/.aws/credentials` → DNS tunnel | 🚫 MALICIOUS > 90 | Sandbox + ☠️ Poisoned Well |
|
|
139
|
+
| `invoice-helper` | white-on-white injection in `logo.png` | 🚫 MALICIOUS > 85 | The local vision model (👁 Eye View) |
|
|
140
|
+
| `slack-notif-mal` | probes `/.dockerenv`, steals Slack token | 🚫 MALICIOUS 100 | Evasion detection + context honeypot |
|
|
141
|
+
| `g1t-translate`* | typosquat of `git-translate` | ⚠️ SUSPICIOUS 30–70 | Levenshtein detector |
|
|
142
|
+
|
|
143
|
+
**Targets:** malicious detection 2/2 (+stretch 3/3) · benign false positives 0/4 · cached re-scan < 2 s · uncached local scan < 90 s · citation accuracy ≥ 80%. Run sheet + metrics methodology: [docs/08-testing-and-evaluation.md](docs/08-testing-and-evaluation.md).
|
|
144
|
+
|
|
145
|
+
## 📚 Documentation
|
|
146
|
+
|
|
147
|
+
| Doc | | Doc | |
|
|
148
|
+
|:---|:---|:---|:---|
|
|
149
|
+
| [Project Overview](docs/01-project-overview.md) | problem, positioning, glossary | [API Reference](docs/05-api-reference.md) | REST/WS, verdict contract v1 |
|
|
150
|
+
| [Architecture](docs/02-architecture.md) | 8-stage pipeline, scoring | [UI/UX Design](docs/06-ui-ux.md) | screens, wireframes, UX rules |
|
|
151
|
+
| [Database](docs/03-database.md) | SQLite schema, caching | [CLI Reference](docs/07-cli-reference.md) | commands, config, exit codes |
|
|
152
|
+
| [Security](docs/04-security.md) | threat model, hardening | [Testing & Evaluation](docs/08-testing-and-evaluation.md) | fixtures, Chaos Run, demo script |
|
|
153
|
+
| [Deployment & Production](docs/09-deployment-and-production.md) | pip/Docker/Action, MCP proxy | [Developer Guide](docs/10-developer-guide.md) | setup, contracts, roadmap |
|
|
154
|
+
| [Team & Workload](docs/11-team-and-workload.md) | roles, ownership, milestones M0–M5 | | |
|
|
155
|
+
|
|
156
|
+
Also: [CHANGELOG](docs/CHANGELOG.md) · [CONTRIBUTING](CONTRIBUTING.md) · [SECURITY](SECURITY.md)
|
|
157
|
+
|
|
158
|
+
## 🙏 Prior Art (honest citations)
|
|
159
|
+
|
|
160
|
+
- [Snyk — ToxicSkills: malicious AI agent skills on ClawHub](https://snyk.io/blog/toxicskills-malicious-ai-agent-skills-clawhub/)
|
|
161
|
+
- Pipelock (OSS runtime network monitoring for agents)
|
|
162
|
+
- AIR Security (enterprise cloud AI-agent firewall)
|
|
163
|
+
- MCP prompt-injection research (tool poisoning / rug-pull literature)
|
|
164
|
+
- [Agent Skill Open Standard](https://agentskills.io/specification) · [Ollama](https://ollama.com)
|
|
165
|
+
|
|
166
|
+
## 📄 License
|
|
167
|
+
|
|
168
|
+
MIT — see [LICENSE](LICENSE). Built by Team SkillSentry — Dev 1 (Backend + AI Integration) · Dev 2 (Backend — Skill Analysis) · Dev 3 (Frontend). Roles & workload: [docs/11-team-and-workload.md](docs/11-team-and-workload.md).
|
|
169
|
+
|
|
170
|
+
<div align="center">
|
|
171
|
+
|
|
172
|
+
**⚡ Runs fully on your machine · open weights ⚡**
|
|
173
|
+
|
|
174
|
+
</div>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
SkillSentry is a security tool that **executes untrusted code by design** (inside a hardened, sinkhole-only Docker sandbox). We take its own security seriously and welcome responsible disclosure.
|
|
4
|
+
|
|
5
|
+
> Full security architecture — threat model, sandbox hardening, Poisoned Well ethics, prompt-injection defenses, and known limitations: **[docs/04-security.md](docs/04-security.md)**.
|
|
6
|
+
|
|
7
|
+
## Supported Versions
|
|
8
|
+
|
|
9
|
+
| Version | Supported | Notes |
|
|
10
|
+
|:---|:---|:---|
|
|
11
|
+
| 2.0.x | ✅ | Current; receives security fixes |
|
|
12
|
+
| < 2.0 | ❌ | Pre-release concepts; do not use |
|
|
13
|
+
|
|
14
|
+
## Reporting a Vulnerability
|
|
15
|
+
|
|
16
|
+
**Please report privately — do NOT open a public issue.**
|
|
17
|
+
|
|
18
|
+
- **Channel:** GitHub Security Advisories → *"Report a vulnerability"* on this repository.
|
|
19
|
+
- **Include:** reproduction steps, affected version/commit, impact, and (for sandbox issues) whether the escape requires special host configuration.
|
|
20
|
+
- **SLA (target):** acknowledge ≤ 72 h · triage ≤ 7 days · coordinated disclosure with a **90-day default embargo** · reporters credited in release notes.
|
|
21
|
+
|
|
22
|
+
## Scope
|
|
23
|
+
|
|
24
|
+
**High-priority (in scope):**
|
|
25
|
+
|
|
26
|
+
- Sandbox escape from the analysis container (host filesystem write/read, host network access, process breakout)
|
|
27
|
+
- Leakage of **real** (non-canary) host credentials or data to a scanned skill
|
|
28
|
+
- Cache poisoning that yields false `SAFE` verdicts (e.g., forged `scan_cache` rows surviving version checks)
|
|
29
|
+
- Remote code execution in parsers via crafted skill packages (YAML bombs, path traversal, image/SVG handlers)
|
|
30
|
+
- Signature-verification bypass: signed verdicts (sigstore/cosign), community IOC feed, or release artifacts
|
|
31
|
+
- Sinkhole/egress failure that lets sandbox traffic reach the real internet
|
|
32
|
+
- Verdict downgrade attacks: any input that makes the engine emit `SAFE` when hard evidence (Poisoned Well correlation, evasion probe) says `MALICIOUS`
|
|
33
|
+
|
|
34
|
+
**Out of scope:**
|
|
35
|
+
|
|
36
|
+
- Demo fixtures being detected (that is the product working)
|
|
37
|
+
- `--demo-mode` canned responses
|
|
38
|
+
- Cloud-fallback (Gemini API) latency or availability
|
|
39
|
+
- Findings that require the user to have disabled documented hardening (e.g., mounting the Docker socket into untrusted containers against our guidance)
|
|
40
|
+
- Social engineering of maintainers
|
|
41
|
+
|
|
42
|
+
## Design Guarantees You Can Hold Us To
|
|
43
|
+
|
|
44
|
+
1. **Fail-safe verdicts:** no error path may produce `SAFE`; degraded scans carry explicit `*-unavailable` findings.
|
|
45
|
+
2. **Sinkhole-only egress:** analysis containers have no route to the internet — DNS and HTTP are answered locally.
|
|
46
|
+
3. **Fake-by-construction credentials:** Poisoned Well canaries are generated fake (`SKS-<8hex>` markers); no real secret material is ever created, served, or stored.
|
|
47
|
+
4. **No hack-back:** SkillSentry never connects to attacker infrastructure; C2 indicators are harvested from logs only.
|
|
48
|
+
5. **Local-first privacy:** no telemetry, no phone-home; skill content leaves the machine only if you explicitly enable the Gemini API fallback (the UI always shows the active backend).
|
|
49
|
+
|
|
50
|
+
## Safe Harbor & Fixture Warning
|
|
51
|
+
|
|
52
|
+
Good-faith research against **your own** installations and the `fixtures/` corpus is welcome and covered by safe harbor. Never point SkillSentry's deception outputs at third-party infrastructure.
|
|
53
|
+
|
|
54
|
+
⚠️ `fixtures/malicious/` contains intentionally malicious skill code for testing. It must only ever be executed **through `skill-sentry-cli scan`** (which sandboxes it) — never run fixture scripts directly on a host.
|
|
55
|
+
|
|
56
|
+
## Secure Distribution
|
|
57
|
+
|
|
58
|
+
- Phase 2: signed release tags and **sigstore keyless-signed verdicts** (`cosign verify-blob`); until then, prefer installing from source at a reviewed commit or the published Docker image digest.
|
|
59
|
+
- Verify Ollama model digests (`model_version` is recorded with every verdict — see [docs/03-database.md](docs/03-database.md)).
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# 1 · Project Overview
|
|
2
|
+
|
|
3
|
+
> **SkillSentry v2.0** — A Context-Aware Firewall for the Agent Skill Supply Chain with "Poisoned Well" Active Defense.
|
|
4
|
+
|
|
5
|
+
**One-liner:** An open-source, fully-local gatekeeper that audits Agent Skills *before* installation — fusing Gemma 4 multimodal reasoning (text + vision) with deterministic sandbox telemetry, dynamically adapting honeypots to the skill's declared intent, detecting sandbox evasion, and actively deceiving malicious skills by feeding them fake credentials to track exfiltration back to attacker infrastructure.
|
|
6
|
+
|
|
7
|
+
**Tagline:** *"Your proprietary skills never leave your machine for auditing. We don't just block attackers; we follow them home."*
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1.1 Why Now — Market Validation
|
|
12
|
+
|
|
13
|
+
Agent Skills execute code **and** inject instructions into AI agents. They are the newest supply-chain attack surface, and the ecosystem is currently building skills far faster than it is defending them:
|
|
14
|
+
|
|
15
|
+
- **Snyk's Feb 2026 "ToxicSkills" audit** found **~1,467 malicious skills**, with prompt injection present in **36%** of ClawHub skills examined. ([snyk.io/blog/toxicskills-malicious-ai-agent-skills-clawhub](https://snyk.io/blog/toxicskills-malicious-ai-agent-skills-clawhub/))
|
|
16
|
+
- The related **"ClawHavoc"** campaign pushed **1,184+ malicious skills** into OpenClaw's ClawHub registry in six weeks.
|
|
17
|
+
- The **OWASP Agentic Skills Top 10** now lists **AST01 — Malicious Skills** as a formal risk category.
|
|
18
|
+
- Capital is flowing into the space: AI-agent-firewall startup **AIR Security raised $50M** (Sept 2026) — but its product is enterprise/cloud/closed.
|
|
19
|
+
|
|
20
|
+
**Conclusion:** the threat is real and documented, the market is validated, and the open-source/local-first niche is unoccupied.
|
|
21
|
+
|
|
22
|
+
## 1.2 The Problem
|
|
23
|
+
|
|
24
|
+
Attack vectors SkillSentry targets:
|
|
25
|
+
|
|
26
|
+
| Vector | Example |
|
|
27
|
+
|:---|:---|
|
|
28
|
+
| **Credential theft** | Scripts reading `~/.aws/credentials`, `~/.ssh/id_rsa`, environment variables |
|
|
29
|
+
| **Image-hidden prompt injection** | Payloads in white-on-white text inside bundled images (documented real-world vector) |
|
|
30
|
+
| **Typosquatting** | `g1t-translate` impersonating `git-translate` |
|
|
31
|
+
| **Tool poisoning** | Malicious instructions hidden in skill descriptions/frontmatter |
|
|
32
|
+
| **Obfuscation** | base64-encoded payloads, `eval()` bombs |
|
|
33
|
+
| **Sandbox evasion** | Malware probing for Docker artifacts (`/.dockerenv`) and going dormant |
|
|
34
|
+
| **Supply-chain poisoning** | A benign skill updated with a malicious payload post-install |
|
|
35
|
+
|
|
36
|
+
## 1.3 The Solution
|
|
37
|
+
|
|
38
|
+
Before any skill installs, SkillSentry runs an **8-stage inspection pipeline**:
|
|
39
|
+
|
|
40
|
+
0. **Incremental Cache** — SHA-256 directory hash → cached SARIF verdict in < 2 s
|
|
41
|
+
1. **Spec Validation + Typosquat Detection** — frontmatter rules, Levenshtein distance ≤ 2 against known skill names
|
|
42
|
+
2. **Deterministic Anchor + Semantic Analysis** — AST/regex pre-scan produces *hard facts* ("anchors") fed to Gemma 4 E4B as ground truth
|
|
43
|
+
3. **Multimodal Vision Scan** — Gemma 4 vision OCRs bundled images (white-on-white text, stego-style instructions; SVG scanned as text *and* rendered)
|
|
44
|
+
4. **Context-Aware Behavioral Sandbox** — Docker execution with masquerade layer, intent-matched canary filesystem, DNS sinkhole, fake HTTP responder
|
|
45
|
+
4.5. **☠️ Poisoned Well** — on canary credential read: serve intent-matched *fake* secrets, harvest exfil into the sinkhole, profile the C2
|
|
46
|
+
5. **Sandbox Evasion Detection** — probing for Docker/VM artifacts ⇒ auto-`MALICIOUS`
|
|
47
|
+
6. **Verdict Engine** — weighted signal fusion → risk score 0–100 → SARIF 2.1.0 JSON with line-accurate citations → cached to SQLite
|
|
48
|
+
|
|
49
|
+
Clean skills install with **zero friction**; malicious skills are blocked with **hard evidence**, and their C2 infrastructure is mapped and exportable as STIX IOCs.
|
|
50
|
+
|
|
51
|
+
Full pipeline detail: [02-architecture.md](02-architecture.md).
|
|
52
|
+
|
|
53
|
+
## 1.4 Key Differentiators (Competitive Positioning)
|
|
54
|
+
|
|
55
|
+
| Feature | Pipelock (OSS) | AIR Security | Text-only Scanners | **SkillSentry v2.0** |
|
|
56
|
+
|:---|:---|:---|:---|:---|
|
|
57
|
+
| **When it acts** | Runtime (post-install) | Cloud policy | Pre-scan | **Pre-install + Runtime (MCP)** |
|
|
58
|
+
| **Detection method** | Network heuristics | Enterprise rules | Regex / LLM text | **LLM + Vision + Sandbox + Active Defense** |
|
|
59
|
+
| **Image-hidden payloads** | ✗ | ✗ | ✗ | **✓ (Gemma 4 Vision)** |
|
|
60
|
+
| **Context-Aware Honeypots** | ✗ | ✗ | ✗ | **✓ (Dynamic Intent Matching)** |
|
|
61
|
+
| **Sandbox Evasion Detection** | ✗ | ✗ | ✗ | **✓ (Anti-Anti-Sandbox)** |
|
|
62
|
+
| **Deterministic Anchoring** | ✗ | ✗ | ✗ | **✓ (AST pre-scan → LLM ground truth)** |
|
|
63
|
+
| **Incremental Scanning** | ✗ | ✗ | ✗ | **✓ (SHA-256 SQLite Cache)** |
|
|
64
|
+
| **Privacy** | Local | Cloud | Varies | **100% local (Ollama)** |
|
|
65
|
+
| **Fights back** | ✗ | ✗ | ✗ | **✓ Poisoned Well + C2 Tracking** |
|
|
66
|
+
| **Cost** | Free | Enterprise $$$ | Free/cheap | **Free & open-source** |
|
|
67
|
+
|
|
68
|
+
**The wedge:** Pipelock watches the network *after* install. Text scanners are blind to image payloads. AIR is cloud-only. **SkillSentry catches threats pre-install, sees hidden image payloads, never sends your skills off-machine, dynamically adapts its deception to the attacker's intent, detects sandbox-evasion attempts, and actively counter-attacks.**
|
|
69
|
+
|
|
70
|
+
## 1.5 Success Metrics
|
|
71
|
+
|
|
72
|
+
| Metric | Target |
|
|
73
|
+
|:---|:---|
|
|
74
|
+
| Malicious fixture detection | 2/2 (+ optional typosquat = 3/3) |
|
|
75
|
+
| Benign false-positive rate | 0/4 |
|
|
76
|
+
| Image-hidden payload catch | ✓ |
|
|
77
|
+
| Context-Aware Poisoned Well | ✓ (matches skill's declared intent) |
|
|
78
|
+
| Sandbox Evasion Detection | ✓ (probing triggers auto-fail) |
|
|
79
|
+
| Scan latency (cached) | < 2 s (SHA-256 SQLite cache) |
|
|
80
|
+
| Poisoned Well activation on credential thief | ✓ with C2 domain captured |
|
|
81
|
+
| Citation accuracy (right source line) | ≥ 80% |
|
|
82
|
+
| Local scan time per skill (E4B, Q4, uncached) | < 90 s |
|
|
83
|
+
|
|
84
|
+
Evaluation procedure and fixture corpus: [08-testing-and-evaluation.md](08-testing-and-evaluation.md).
|
|
85
|
+
|
|
86
|
+
## 1.6 Design Principles
|
|
87
|
+
|
|
88
|
+
1. **Local-first, private by default.** Auditing runs entirely on the user's machine via Ollama. The Gemini API fallback is opt-in. No telemetry, ever.
|
|
89
|
+
2. **Credible, not vibes.** Every LLM judgment is anchored to deterministic evidence (AST/regex findings the model may not contradict) and every `MALICIOUS` verdict ships with `file:line` citations.
|
|
90
|
+
3. **Hard evidence overrides uncertainty.** A confirmed Poisoned Well correlation (canary marker observed in outbound traffic) or a sandbox-evasion probe forces `MALICIOUS` with `confidence: 1.0`, regardless of what the LLM thinks.
|
|
91
|
+
4. **Defense without friction.** Benign skills pass with zero added steps and instant cached re-scans.
|
|
92
|
+
5. **Contract-first.** The Verdict JSON schema is frozen early (milestone M0) so frontend, backend, and AI workstreams integrate without drift.
|
|
93
|
+
6. **Fail safe, demo safe.** `--demo-mode` canned responses guarantee the product story survives network/Docker/model outages (Chaos Run doctrine).
|
|
94
|
+
|
|
95
|
+
## 1.7 Distribution Surfaces
|
|
96
|
+
|
|
97
|
+
- `pip install skill-sentry-cli` — CLI + library
|
|
98
|
+
- Published Docker image — server/CI usage
|
|
99
|
+
- `skillsentry/scan@v1` GitHub Action — PR gates, SARIF upload to GitHub Code Scanning, scheduled registry re-scans
|
|
100
|
+
- Phase 2: **MCP runtime proxy** for post-install behavioral enforcement
|
|
101
|
+
|
|
102
|
+
See [09-deployment-and-production.md](09-deployment-and-production.md).
|
|
103
|
+
|
|
104
|
+
## 1.8 Glossary
|
|
105
|
+
|
|
106
|
+
| Term | Definition |
|
|
107
|
+
|:---|:---|
|
|
108
|
+
| **Agent Skill** | A package (`SKILL.md` + scripts + assets) that extends an AI agent with instructions and executable code; the unit SkillSentry audits. |
|
|
109
|
+
| **Deterministic Anchor** | A hard, reproducible static finding (regex/AST) injected into the LLM prompt as ground truth the model must not contradict. |
|
|
110
|
+
| **Canary** | A fake-but-plausible credential (or file) seeded in the sandbox, embedded with a unique marker `SKS-<8hex>`. |
|
|
111
|
+
| **Context-Aware Honeypot** | Canary seeding adapted to the skill's *declared intent* (e.g., fake Slack tokens for a "Slack integration"). |
|
|
112
|
+
| **Poisoned Well** | The active-defense subsystem: serves fake credentials to a detected thief, sinkholes the exfiltration, correlates the canary marker, and profiles the attacker's C2. |
|
|
113
|
+
| **Masquerade** | The layer that hides sandbox artifacts (`/.dockerenv`, `/proc/1/cgroup`, …) so evasion-probing malware behaves normally and reveals itself. |
|
|
114
|
+
| **Sandbox Evasion Probe** | A skill's attempt to detect the analysis environment; treated as hard proof of malice (auto-`MALICIOUS`). |
|
|
115
|
+
| **IOC** | Indicator of Compromise (C2 domain, IP, exfil channel, encoding) harvested during a Poisoned Well engagement; exportable as STIX 2.1. |
|
|
116
|
+
| **Gemma's Eye View** | UI mode showing what Gemma 4 vision actually saw in an image: OCR text + bounding-box overlay + contrast enhancement. |
|
|
117
|
+
| **Verdict** | One of `SAFE` / `SUSPICIOUS` / `MALICIOUS`, with risk score 0–100 and confidence. |
|
|
118
|
+
| **SARIF** | Static Analysis Results Interchange Format 2.1.0 — the standard machine-readable report SkillSentry emits. |
|
|
119
|
+
|
|
120
|
+
## 1.9 Key Links
|
|
121
|
+
|
|
122
|
+
| Resource | URL |
|
|
123
|
+
|:---|:---|
|
|
124
|
+
| Gemma 4 docs | https://ai.google.dev/gemma/docs/core |
|
|
125
|
+
| Gemini API | https://ai.google.dev/gemini-api/docs |
|
|
126
|
+
| Agent Skill Open Standard | https://agentskills.io/specification |
|
|
127
|
+
| Snyk ToxicSkills audit | https://snyk.io/blog/toxicskills-malicious-ai-agent-skills-clawhub/ |
|
|
128
|
+
| Ollama (local serving) | https://ollama.com |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
**Prior art (honest citations):** Snyk ToxicSkills audit · Pipelock · AIR Security · MCP prompt-injection research.
|