Skip to main content

Malware detection engine for agentic skills (SKILL.md)

Project description

Malwar

Static analysis engine purpose-built for detecting malware in agentic AI skill files.

PyPI version Docker Docs License CI Python

Detection Rules Pipeline Layers SARIF Coverage

Web Dashboard  ·  API Docs  ·  Detection Rules  ·  Deployment


Why

20% of ClawHub's 10,700+ skills are malicious. The ClawHavoc campaign alone trojanized 824+ skills to deliver the AMOS infostealer. These attacks aren't binaries — they're natural language instructions hidden in Markdown files. VirusTotal sees nothing. Code scanners see nothing. Malwar was built to catch them.

How It Works

SKILL.md → Rule Engine → URL Crawler → LLM Analyzer → Threat Intel → Verdict
             <50ms         1-5s          2-10s           <100ms
Layer What it catches
Rule Engine Obfuscated commands, prompt injection, credential exposure, exfiltration patterns (19 rules)
URL Crawler Malicious URLs, domain reputation, redirect chains to C2 infrastructure
LLM Analyzer Social engineering, hidden intent, context-dependent attacks invisible to regex
Threat Intel Known IOCs, campaign attribution, threat actor fingerprints

Full pipeline details: Architecture

Quick Start

pip install malwar
malwar db init

For development:

git clone https://github.com/Ap6pack/malwar.git && cd malwar
pip install -e ".[dev]"
malwar db init
malwar scan SKILL.md                    # scan a file
malwar scan skills/                     # scan a directory
malwar scan SKILL.md --format sarif     # CI/CD output
malwar scan SKILL.md --no-llm          # skip LLM (fast + free)
$ malwar scan suspicious-skill.md

  MALICIOUS  Risk: 95/100  Findings: 4

  MALWAR-OBF-001   Base64-encoded command execution        critical   L14
  MALWAR-CMD-001   Remote script piped to shell            critical   L22
  MALWAR-EXFIL-001 Agent memory/identity file access       critical   L31
  MALWAR-MAL-001   ClawHavoc campaign indicator            critical   L14

  Scan completed in 42ms (rule_engine, threat_intel)

Full command reference: CLI Guide

API

malwar serve    # http://localhost:8000
curl -X POST http://localhost:8000/api/v1/scan \
  -H "Content-Type: application/json" \
  -d '{"content": "...", "file_name": "SKILL.md"}'

16 endpoints covering scan submission, results, SARIF export, signatures CRUD, campaigns, and reports. Auth via X-API-Key header.

Full endpoint reference: API Docs

Web Dashboard

Built-in browser UI at http://localhost:8000 when running the API server.

Dashboard

Scan Detail Campaigns
Signatures Scan History

React 19 · TypeScript · Vite · Tailwind CSS 4 · Recharts

Docker

docker compose up -d    # API + Dashboard at http://localhost:8000

Multi-stage build: Node.js compiles the frontend, Python 3.13-slim runs the backend.

Full deployment guide: Deployment

Configuration

All settings via environment variables with MALWAR_ prefix or .env file. Key settings:

Variable Default Description
MALWAR_API_KEYS (empty) API keys (empty = auth disabled)
MALWAR_ANTHROPIC_API_KEY (empty) Anthropic key for LLM layer
MALWAR_DB_PATH malwar.db SQLite database path

All 17 configuration options →

Development

pytest                                # 345 tests
ruff check src/ tests/                # lint
mypy src/                             # type check

37 test fixtures: 5 benign, 10 malicious (synthetic), 22 real-world samples from ClawHub and Snyk research.

Full dev guide: Development

Documentation

Architecture Pipeline design, scoring logic, storage layer
API Reference All 16 endpoints with schemas and examples
Detection Rules All 19 rules with patterns and false positive guidance
Threat Campaigns Campaign tracking, ClawHavoc case study
CLI Reference Every command with flags and examples
Deployment pip, Docker, nginx, production config
Development Adding rules, endpoints, testing, conventions

BSL-1.1 — Copyright (c) 2026 Veritas Aequitas Holdings LLC. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

malwar-0.2.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

malwar-0.2.1-py3-none-any.whl (134.1 kB view details)

Uploaded Python 3

File details

Details for the file malwar-0.2.1.tar.gz.

File metadata

  • Download URL: malwar-0.2.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for malwar-0.2.1.tar.gz
Algorithm Hash digest
SHA256 dc464a945b6526b2c3e7d9259793dc6d9908c62baebecccc0bc565cf58d48ff2
MD5 787fcae0a6b733761e8f8027a5b88b26
BLAKE2b-256 f15127512b299fc932068e9b5d5b2a85a14e6c37757892b11d1c25eb8d11854f

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwar-0.2.1.tar.gz:

Publisher: publish-pypi.yml on Ap6pack/malwar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file malwar-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: malwar-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 134.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for malwar-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b4cb76a51c71af50acaaa623bd5aa76bdb3bfa1b05ea0682d206701bba60f39
MD5 465a50c27adb5469f93d168db6a5be32
BLAKE2b-256 d4941e5bbcb679c9d875eabcd10bf4eedcd01c45c19a93d720e3af44733776c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for malwar-0.2.1-py3-none-any.whl:

Publisher: publish-pypi.yml on Ap6pack/malwar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page