Skip to main content

SLOPGUARD

AI Dependency Control Plane / Supply-Chain Firewall

PyPI Version Python Version License Tests

Core Principle: EXISTENCE != TRUST != FUTURE SAFETY

SLOPGUARD (slopguard-ai) is an enterprise-grade, pre-install security control plane and supply-chain firewall designed to sit between AI coding agents (Claude, Devin, Copilot, Cursor) / AI-generated source code and package registries (PyPI, npm). It validates dependency identity, collects structured evidence, evaluates multi-dimensional trust signals, tracks temporal package transitions (phantoms), suggests contextual repairs, enforces deterministic Policy-as-Code, and blocks malicious or hallucinated dependency installations before package code can ever execute.


Quickstart (First 30 Seconds)

1. Install from PyPI

pip install slopguard-ai

Note: The distribution name is slopguard-ai, the CLI command is slopguard, and the Python import package is import slopguard.

2. Verify Your First Package

slopguard verify requests

Output:

+------ Registry Verification Evidence -------+
| Package: requests (pypi)                    |
| Status: FOUND                               |
| Latency: 344.2ms | Releases: 163            |
| Latest Version: 2.34.2                      |
| Repository: https://github.com/psf/requests |
+---------------------------------------------+

3. Scan a File or Repository

# Scan a single source file
slopguard scan app.py

# Scan an entire directory with the strict CI policy profile
slopguard scan . --profile strict_ci

The Threat: Why AI-Generated Dependencies Are Different

Autonomous AI coding agents frequently hallucinate dependencies or confuse internal module imports with public distribution names. Attackers exploit this via phantom pre-registration attacks:

  1. AI model hallucinates a nonexistent package name (e.g. langchain-hyper-fast-auth).
  2. Attacker monitors public repositories/datasets, registers that exact package name on PyPI/npm.
  3. Attacker injects malicious execution hooks in setup.py or install.js.
  4. AI agent executes pip install langchain-hyper-fast-auth, granting immediate Remote Code Execution (RCE) on the developer machine or CI runner.

Traditional SCA tools run after installation in CI/CD, which is too late. SLOPGUARD acts as an active, pre-install firewall that intercepts dependencies before they are resolved or executed.


Architecture Pipeline

SLOPGUARD executes an immutable nine-stage pipeline:

[SOURCE CODE / MANIFEST / AGENT INSTALL COMMAND]
                     ↓
        1. EXTRACT (AST-first Python & JS/TS parser; manifest parsing)
                     ↓
        2. IDENTITY (PEP 503 canonical normalization; cv2 -> opencv-python)
                     ↓
        3. VERIFY (Resilient PyPI & npm adapters; network failure != 404)
                     ↓
        4. EVIDENCE (OSV vulnerabilities, repository linkage, provenance)
                     ↓
        5. TRUST (Unicode confusables, release velocity, typosquat distance)
                     ↓
        6. MEMORY (Temporal phantom tracking: NOT_FOUND -> WATCH -> APPEARED)
                     ↓
        7. REPAIR (Contextual candidate ranking & AST diff patch generator)
                     ↓
        8. RESCAN (Mandatory PATCH -> RESCAN -> VERIFY validation loop)
                     ↓
        9. POLICY & GATE (Deterministic Policy-as-Code: ALLOW / HOLD / BLOCK / ALERT)

Example Policy Gate Outcomes

SLOPGUARD enforces deterministic policy outcomes based on empirical evidence:

1. ALLOW — Verified, Established Dependency

  • Scenario: Source contains import cv2 and import requests.
  • Reasoning: cv2 resolves to canonical opencv-python with 0.99 confidence. requests has 163 releases, 10+ years history, verified GitHub repository, and 0 active OSV vulnerabilities.
  • Verdict: ALLOW (Risk: LOW / NONE).

2. BLOCK — Hallucinated Phantom or Dangerous Typosquat

  • Scenario: Source contains import langchain_hyper_fast_auth or import requets.
  • Reasoning: langchain_hyper_fast_auth returns HTTP 404 on PyPI. requets is detected as a Damerau-Levenshtein typosquat targeting requests.
  • Verdict: BLOCK (Risk: HIGH / CRITICAL). Quarantine enforced; installation denied.

3. HOLD / REVIEW — Registry Outage Fail-Safe

  • Scenario: PyPI returns HTTP 429 Too Many Requests or 503 Service Unavailable.
  • Reasoning: Registry failure is never converted into NOT_FOUND. Rather than allowing unverified code or falsely reporting missing packages, SLOPGUARD fails safe.
  • Verdict: HOLD / REVIEW (Requires human confirmation or retry).

4. ALERT — Pre-Registration Attack Detected

  • Scenario: Package target-phantom-corp was previously missing (NOT_FOUND), but a newly registered version suddenly appears on PyPI.
  • Reasoning: Temporal state change NOT_FOUND -> APPEARED signals high-probability dependency confusion or phantom hijacking.
  • Verdict: ALERT (High-severity quarantine enforced).

Production CLI Commands

Command Usage Description
slopguard scan <target> slopguard scan app.py Scans source file, manifest, or directory and enforces policy gate.
slopguard verify <pkg> slopguard verify fastapi Authoritatively checks existence, release count, and version on registry.
slopguard evidence <pkg> slopguard evidence requests Retrieves full dossier: registry telemetry, live OSV advisories, and provenance.
slopguard trust <pkg> slopguard trust pydantic Evaluates multi-dimensional trust signals (age, velocity, typosquats).
slopguard graph <pkg> slopguard graph requests Queries directed Evidence Graph relations (HOSTED_AT, HAS_RELEASE, AFFECTED_BY).
slopguard phantom list slopguard phantom list Inspects the persistent Temporal Phantom Watchlist and state transitions.
slopguard history <pkg> slopguard history <pkg> Reconstructs historical observations and forensic audit logs.
slopguard repair <dep> slopguard repair cv2 Proposes contextual candidate replacements and unified diff AST patches.
slopguard rescan <file> slopguard rescan app.py Rescans a patched file to enforce mandatory PATCH -> RESCAN -> VERIFY loop.
slopguard policy check slopguard policy check --profile enterprise Inspects and simulates active Policy-as-Code rules.

Policy Profiles

Configure SLOPGUARD via --profile <name>:

  • DEVELOPMENT: Designed for local prototyping. Permits provisional trust and packages < 30 days old without known advisories.
  • STRICT_CI (Default): Zero-tolerance build gate for CI/CD pipelines. Blocks unresolved identities, packages with CVEs (CVSS $\ge 7.0$), and unreviewed phantoms.
  • ENTERPRISE: Maximum hardening. Enforces verified provenance/attestation, blocks packages younger than 30 days, blocks all CVEs, and requires verified repository linkages.

Running the Web Dashboard & API

SLOPGUARD includes an interactive dark-mode Single-Page Application (SPA) dashboard:

uvicorn slopguard.api.app:app --host 0.0.0.0 --port 8000

Open http://localhost:8000 in your browser to inspect:

  • Live Scan interactive terminal
  • Evidence Graph relationship explorer
  • Temporal Phantom Timeline
  • Contextual Repair Center
  • Audit Log reconstruction

Local Development & Contributing

1. Clone & Setup

git clone https://github.com/Vishaldubey2210/win_if_you_can.git
cd win_if_you_can

python -m venv .venv
# Windows:
.\.venv\Scripts\Activate.ps1
# Linux/macOS:
source .venv/bin/activate

pip install -e ".[dev]"

2. Run Tests & Self-Scan

# Run full test suite (62 tests)
pytest -v tests/

# Run supply-chain self-scan on SLOPGUARD's own dependencies
python scripts/ci_check.py pyproject.toml --profile strict_ci

3. Build & Package

python -m build
twine check dist/*

For complete instructions on TestPyPI and PyPI publishing, see the PyPI & TestPyPI Distribution Guide.


Documentation Index


License

SLOPGUARD is licensed under the Apache License, Version 2.0.

Release files for slopguard-ai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slopguard-ai 0.1.0
File Size Uploaded
slopguard_ai-0.1.0.tar.gz 74.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slopguard-ai 0.1.0
File Interpreter ABI Platform
slopguard_ai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 159.4 kB

Release files / slopguard_ai-0.1.0.tar.gz

Download URL slopguard_ai-0.1.0.tar.gz
Size 74.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fb4c850faeadb74d50318c49eb7ee18db8aa1463bb1a89c001f311c6fd32982e
BLAKE2b-256 checksum
How to use checksums
94f04ad0d87e88342762ea79d371363525bc8358b624dbc461ea7637f87f4b95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / slopguard_ai-0.1.0-py3-none-any.whl

Download URL slopguard_ai-0.1.0-py3-none-any.whl
Size 85.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
233f0c26049e15abff172a6f2a9b21e914bbd1eae6dfaeef47c5d7263b62afd1
BLAKE2b-256 checksum
How to use checksums
d9be545e4a67b1866bfe3a7d2664bf3aabd284444d9b023990b4af1e7a328e95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page