SkillFortify provides the first formal analysis framework for agent skill supply chains: Dolev–Yao attacker model adapted to the 5-phase skill lifecycle, sound static analysis via abstract interpretation over a 4-element capability lattice, SAT-based dependency resolution with capability bounds, and a trust score algebra — achieving 96.95% F1 with 0% FPR on 540 skills.
Agent skill ecosystems (OpenClaw 228K stars, Anthropic Agent Skills 75.6K stars) face a supply-chain crisis: ClawHavoc infiltrated 1,200+ malicious skills, MalTool catalogued 6,487 malicious tools, 26.1% of 42,447 scanned skills have vulnerabilities. All 12 existing defense tools (Snyk, Cisco, ToolShield) are heuristic — they detect known patterns but cannot prove absence of malicious behavior. Cisco explicitly warns "no findings does not mean no risk."
Six formal contributions forming a layered defense:
核心技术壁垒: The soundness guarantee via abstract interpretation (Theorem 4.9) — if SkillFortify reports no violations, there are no violations in any concrete execution. This is qualitatively different from heuristic scanning and provides the same class of guarantee as Astrée for A380 flight software.
| Metric | Value |
|---|---|
| Detection F1 | 96.95% (95% CI: [95.1%, 98.4%]) |
| Precision | 100% (0 FP across 270 benign) |
| Recall | 94.07% (254/270 malicious) |
| FP rate | 0.00% (95% CI: [0.0%, 1.4%]) |
| 1K-skill SAT resolution | 92.4 ms |
| 540-skill end-to-end scan | 1.378 s |
| Trust monotonicity | 100% (200/200 data points) |
| Lockfile determinism | 100% (10/10 configs) |
| FN concentration | A11 typosquatting (50%), A12 dependency confusion (0%) |
Three engines share a Threat Knowledge Base. The Static Analyzer performs three-phase analysis: (1) capability inference via abstract interpretation, (2) dangerous pattern detection, (3) capability violation check $\mathit{Cap}_I(s) \sqsubseteq \mathit{Cap}_D(s)$.
| Check | Status | Location |
|---|---|---|
| DY-Skill maximality (Theorem 3.6) | Proven via simulation construction | §3.4, Appendix A.1 |
| Analysis soundness (Theorem 4.9) | Proven via Galois connection + structural induction | §4.4, Appendix A.2 |
| Capability confinement (Theorem 5.6) | Proven via structural induction on code syntax | §5.4, Appendix A.3 |
| Resolution soundness (Theorem 6.10) | Proven via bidirectional equisatisfiability | §6.8, Appendix A.4 |
| Trust monotonicity (Theorem 7.12) | Proven by direct computation | §7.5, Appendix A.5 |
| Runtime confinement (Theorem 5.7) | Design theorem — no implementation | §5.4 |
All five main theorems have complete formal proofs in the appendix. Trust decay half-life inconsistency: §7.3 states $\lambda = 0.01$ (half-life 69 days), but §9.6 uses $\lambda = 0.005$ (half-life 139 days).
E1 Detection Accuracy (Table 4–6): 100% detection on 9 of 13 attack types. Weaknesses: A11 typosquatting (50% — requires external corpus), A12 dependency confusion (0% — fundamentally relational). MCP format recall lower (82.22%) vs Claude/OpenClaw (100%) due to compact configs.
E3 Combined Analysis (Table 7): Pattern matching detects 246/270; information flow adds 8 more (steganographic multi-step exfiltration A7). No skill caught by info flow alone.
E4 Scalability (Table 8): Sub-linear per-skill cost. 1,000 skills in 92.4 ms; enterprise deployments (200–500 skills) under 30 ms.
E5 Trust Properties: Monotonicity verified on 200 data points without exception. Weight sensitivity CV = 0.18. Active skills maintain $T > 0.70$ over 180 days; abandoned skills decay to 0.31 at 180 days.
E7 End-to-End (Table 9): Full scan of 540 skills in 1.378 seconds. Suitable for pre-commit hooks (<100 ms), CI/CD, and IDE integration.
| Step | Claim | Evidence | Depends on |
|---|---|---|---|
| 1 | Agent skill supply chain has a structural security gap with no formal defenses | ClawHavoc (1,200+ skills), CVE-2026-25253, MalTool (6,487 tools) | — |
| 2 | DY-Skill is maximally powerful among symbolic attackers | Theorem 3.6 (simulation proof following Cervesato 2001) | Step 1 |
| 3 | Sound static analysis proves absence of capability violations | Theorem 4.9 (Galois connection + fixpoint) | Step 2 |
| 4 | Capability confinement prevents escalation along delegation chains | Theorem 5.6 (structural induction) | Step 3 |
| 5 | SAT-based resolution produces provably secure installations | Theorem 6.10 (equisatisfiability) | Steps 3, 4 |
| 6 | Trust algebra incentivizes improvement (monotonicity) | Theorem 7.12 (direct computation) | Step 5 |
| 7 | Combined system achieves 96.95% F1 with 0% FPR | E1–E7 on SkillFortifyBench (540 skills) | Steps 2–6 |
2,567 lines of Python, 44 source files, 473 automated tests (including Hypothesis property-based tests). MIT license. pip install skillfortify. GitHub: https://github.com/varun369/skillfortify.
关键实现细节: