
Shields against supply-chain, slopsquatting, and typosquatting attacks from dependencies and code.
cargo install sloppy-joe
Compromised releases can use a legitimate package name. The LiteLLM maintainer report identifies malicious versions 1.82.7 and 1.82.8 in March 2026. sloppy-joe's default 72-hour publication-age gate can reject newly published versions when you scan the resolved dependency graph with
--cior--fullbefore installation. This is a timing policy, not inspection of the malicious payload.
Research documents package hallucinations in generated code. sloppy-joe checks dependency names and metadata before installation; existence alone cannot establish that a registered package is safe.
Package names are limited to 214 bytes for npm and 1,024 bytes for other ecosystems to bound typo-analysis work. Longer names report Scan not supported (exit 2).
# Install (single static binary, no runtime dependencies)
cargo install sloppy-joe
# Or download a prebuilt binary archive from GitHub Releases
# https://github.com/brennhill/sloppy-joe/releases
# Fast local guardrail — auto-detects ecosystem from manifest files
sloppy-joe check
# Strict online scan (recommended before push / release)
sloppy-joe check --full
# Strict CI-oriented scan
sloppy-joe check --ci
# Check a specific directory
sloppy-joe check --dir ./my-project
# Check only npm dependencies
sloppy-joe check --type npm
# Python: every dependency group and extra is scanned by default.
# Narrow to the groups/extras your install actually uses (others are reported as not scanned)
sloppy-joe check --python-groups dev,test --python-version 3.12
sloppy-joe check --python-extras docs --python-platform linux --python-version 3.12
# Enforce canonical rules and org standards via config
sloppy-joe check --config /etc/sloppy-joe/config.json
# Config from a URL (useful in CI — no secrets to manage)
sloppy-joe check --config https://raw.githubusercontent.com/yourorg/security-configs/main/sloppy-joe.json
# JSON output for CI pipelines
sloppy-joe check --json
# Review exact maintainer-change exceptions with evidence
sloppy-joe check --review-exceptions
# Create and register a safe per-repo config outside the repo
sloppy-joe init --register
# Create an ecosystem-specific greenfield starter policy
sloppy-joe init --greenfield --ecosystem npm
# Print review-only bootstrap suggestions for an npm or Cargo repo
sloppy-joe init --from-current
# Or write/register those suggestions safely outside the repo
sloppy-joe init --from-current --register
# Or write a config manually to a secure path outside the repo
sloppy-joe init > /secure/location/sloppy-joe.json
# Explain every lockfile problem check blocks on, and verify the safe fixes (writes nothing)
sloppy-joe fix-lockfile
# Write the verified lockfiles (the previous file is kept as <name>.sloppy-joe.bak)
sloppy-joe fix-lockfile --write
check blocks on lockfiles it cannot model or trust: a missing or stale lockfile, a pnpm lockfile
older than 9.0, an npm lockfileVersion: 1, a bun.lockb, a shadow lockfile under a
workspace member. Every such error names the exact command and the minimum tool version.
sloppy-joe fix-lockfile [--dir D] [--type T] [--config C] [--write] [--json] plans each problem
as one of:
| Class | Meaning |
|---|---|
fixable | The command is run for you, in a private scratch copy, with scripts disabled |
guided | The manual command is shown with the reason it is not automated (Bundler, Gradle and .NET restore run repository code; Pipenv and pip-compile re-resolve or build sdists; Yarn Classic has no lockfile-only mode) |
human | No safe fix: integrity, source and provenance findings, manifest pins that disagree with the lockfile, and dependency rewrites (overrides, resolutions, patchedDependencies) |
A fixable candidate is written only if it keeps every locked version, integrity hash and source
the project still reaches, adds packages only for direct dependencies the old lockfile lacked,
parses with the scanner's own parser, and passes a full check --full rescan. The version diff is
printed before anything is written; without --write nothing in the project changes. The tool
runs as an argument vector with an environment built from nothing (HOME, caches and config in
the scratch directory, only absolute PATH entries outside the project), a timeout and no stdin;
a project with a code-execution surface for the tool (a pnpmfile, Yarn plugins, .npmrc script
settings, Cargo wrappers, Composer VCS repositories, Poetry plugins, a Go toolchain line, git or
local-path dependencies) is refused before the tool runs. Exit status is 0 when nothing needed
fixing or every fix was verified (and written with --write), 1 when a problem remains, a fix
was refused or a tool failed, and 2 on a runtime error. See
docs/specs/fix-lockfile.md for the full catalog.
nix profile install github:brennhill/sloppy-joe
The flake on main pins the published binary release and its checksums.
Scan modes:
sloppy-joe check runs the fast local guardrail. It always enforces manifest parsing, lockfile/sync, provenance, and unsupported-source policy. If dependency or policy state changed, or the last successful full scan is older than 24 hours, it recommends sloppy-joe check --full.sloppy-joe check --full runs the strict online scan and refreshes the recorded successful full-scan state.sloppy-joe check --ci runs the same strict coverage as --full, with CI-oriented intent.sloppy-joe check scans every declared dependency group (Poetry groups, PEP 735 [dependency-groups] including include-group, uv/PDM dev dependencies, Hatch environments) and every extra by default, because uv and Poetry install groups without extra flags. --python-groups and --python-extras narrow the scan to the named groups/extras and warn (resolution/python-groups-not-scanned) about the declared ones they leave out. Environment markers never remove a package from the scan: a dependency whose marker is false for the target (or that the evaluator cannot decide) still gets source policy, existence, metadata and vulnerability checks, because some other machine installs it. For Poetry and uv, markers only choose which locked version the target resolves; they are evaluated for the current host unless you pass --python-platform, --python-arch, or --python-version, and sloppy-joe warns when that happened implicitly.sloppy-joe check output always reminds you to use --ci or --full for CI and production gating.Exit codes: 0 = no blocking issues found in the selected mode, 1 = blocking findings, 2 = unsupported scan input or runtime error. Unsupported syntax/configuration is not a malware finding.
Supports: JavaScript (npm, pnpm, Yarn, Bun), Python, Rust, Go, Ruby, PHP, JVM (Gradle/Maven), and .NET — auto-detected from manifest files.
Ecosystem guides: see docs/ecosystems/README.md for the current trust model, supported features, and fail-closed limits for each ecosystem.