Skip to main content

Rust Audit

Auditor and auto-fixer for AI-generated Rust code: stubs, demo code, fake tests, fakes/mocks leaking into production, panic/unsafe misuse, swallowed errors, async pitfalls, and fake / hallucinated / typosquatted dependencies (slopsquatting).

Python 3.11+ stdlib only — no dependencies. English output.

Install

pipx install rust-audit      # or: pip install rust-audit
rust-audit selftest          # prints `selftest PASS`

From PyPI as rust-audit; the one-word alias rustaudit is the same package under a name that resolves to it, and both rust-audit and rustaudit run from either install. Nothing is fetched or executed at install time, and the wheel carries the same rust_audit.py as the signed release asset — so the verify-before-use chain below still applies to the script you download.

Quick start

# 0) verify before use — check the exact audited bytes before executing them
#    (key pin -> SSH signature -> checksum -> tag identity) and proceed only
#    on VERIFIED (exit 0); see SECURITY.md for the pinned key and the chain
scripts/verify_release.sh v0.2.3 ./rust_audit.py

python3 scripts/rust_audit.py selftest
python3 scripts/rust_audit.py scan  <rust-project> --format terminal,md,json,sarif --fail-on high
python3 scripts/rust_audit.py fix   <rust-project> --dry-run
python3 scripts/rust_audit.py cargo <rust-project> --deep --supply-chain

Exit codes: 0 clean · 1 findings at/above --fail-on · 2 execution error. Every run writes a not-executed report (report/not-executed-<date>.md) listing the checks that could not run and how to enable them — read it before calling an audit complete.

As a Freebuff agent skill: install rust-audit into Freebuff on any machine by following docs/freebuff-skill-install.md.

Tests

Production E2E suite: the real CLI audited against real Rust workspaces (BurntSushi/ripgrep and tokio-rs/tokio, each pinned by commit — no demo fixtures), with per-project goldens. Needs network to fetch the pinned workspaces, Python 3.11+ and pytest in a venv:

python3 -m venv .venv && .venv/bin/pip install pytest
.venv/bin/python -m pytest tests/

See SKILL.md for the rule catalog (R01–R21), the auto-fix policy, the CI templates and the honest limitations.

Security

The trust model is explicit: what executes (literal cargo argv, no shell), what leaves the machine (opt-in --online registry/OSV lookups only) and what writes to disk (transactional fix). See SECURITY.md — including the notes for static skill auditors.

Release assets are SSH-signed: an install can verify it has the exact audited rust_audit.py with preinstalled ssh-keygen alone — commands and the pinned signing key live in SECURITY.md.

Hardened scanners can enforce the static-only contract in code: every subcommand accepts --no-exec, under which process creation is impossible (one guarded entry point refuses every spawn) and each check that would have executed is recorded as skipped in the not-executed report.

License

Apache License 2.0 — see LICENSE. Copyright (c) 2026 Antonio Cantallops Alba · contact@exyonq.org

Metadata

Release files for rust-audit 0.2.3

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

Source distribution (sdist)

Source distribution for rust-audit 0.2.3
File Size Uploaded Provenance
rust_audit-0.2.3.tar.gz 67.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rust-audit 0.2.3
File Interpreter ABI Platform
rust_audit-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 115.8 kB

Release files / rust_audit-0.2.3.tar.gz

Download URL rust_audit-0.2.3.tar.gz
Size 67.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ee4f29f91cae98707dbb2f17ed5dfd4870a53fad1993594c3b19847e2d4b12a7
BLAKE2b-256 checksum
How to use checksums
77a9258af83f21587774378b568fc6639c541e049ef8d1314fa80ee200c62bb4
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 Oct 20, 2026.

Transparency log

Release files / rust_audit-0.2.3-py3-none-any.whl

Download URL rust_audit-0.2.3-py3-none-any.whl
Size 48.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e001b5087158c6a273f9c09f5f35da885fb5ebf8acf922dbc7d1ac71ccdc6ed
BLAKE2b-256 checksum
How to use checksums
7cf59d52a69221cf1a3bfcad73c95cf56a4d9cb15fe3de706851d4cd89510343
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 Oct 20, 2026.

Transparency log

Security for rust-audit 0.2.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rust_audit-0.2.3.tar.gz

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 Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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