Skip to main content

Standalone pickle security scanner extracted from ModelAudit

Project description

modelaudit-picklescan

Standalone pickle security scanner package used by ModelAudit's pickle scanners.

This package is intentionally small: it exposes pickle byte/stream analysis, safety verdicts, typed findings, and direct scanning of pickle members inside common PyTorch ZIP checkpoints without importing the broader ModelAudit scanner framework.

Installation

The standalone modelaudit-picklescan wheel includes the Python API and the native Rust scanner extension. The root modelaudit wheel depends on this distribution so installed ModelAudit scans use the same native Rust scanner for pickle payload analysis.

For local package work from a checkout, install the package directory directly:

python -m pip install packages/modelaudit-picklescan

Usage

from modelaudit_picklescan import ScanOptions, scan_bytes, scan_file

report = scan_file("model.pt")  # raw pickle files and PyTorch ZIP checkpoints
if report.has_security_findings:
    for finding in report.findings:
        print(finding.rule_code, finding.severity.value, finding.message)

report = scan_bytes(
    payload,
    source="archive.pt:data.pkl",
    options=ScanOptions(
        timeout_s=30.0,
        max_opcodes=1_000_000,
        max_string_literal_scan_chars=8 * 1024 * 1024,
        max_nested_pickle_bytes=2 * 1024 * 1024,
        max_nested_depth=2,
    ),
)

Native Scanner

The wheel includes a native Rust scanner for pickle payload analysis. Nested pickle payload analysis is capped by byte budget and depth; the default depth is 2 so common double-wrapped encoded pickle payloads are inspected while recursive or adversarial nesting stays bounded. Release wheels are published for Linux x86_64, Linux aarch64, macOS arm64, macOS x86_64, and Windows targets. Other platforms may install from the source distribution and need a local Rust toolchain available during install. Use Rust 1.83+ when building from source.

Report Contract

  • status: scan completeness (complete, inconclusive, error)
  • verdict: safety decision (clean, suspicious, malicious, unknown)
  • findings: warning/critical security findings
  • notices: informational coverage notes, including explicit partial-analysis notices when literal or nested-pickle budgets are reached
  • errors: operational failures

Notices are intended for explainability and audit trails. Aggregate dashboards should treat findings at warning or critical severity as security alerts, and group or count notices by code instead of presenting every INFO row as an actionable issue.

Report mappings are read-only after construction. Use to_dict() when a mutable plain-Python representation is needed.

Package Boundary

modelaudit-picklescan analyzes raw pickle payloads and PyTorch ZIP checkpoint pickle members. For full model-file routing, archive context, CLI output, SARIF/export integrations, and broader scanner coverage, use the root modelaudit package.

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

modelaudit_picklescan-0.1.2.tar.gz (92.2 kB view details)

Uploaded Source

Built Distributions

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

modelaudit_picklescan-0.1.2-cp310-abi3-win_amd64.whl (325.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl (465.0 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl (460.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

modelaudit_picklescan-0.1.2-cp310-abi3-macosx_11_0_arm64.whl (420.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

modelaudit_picklescan-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl (425.9 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file modelaudit_picklescan-0.1.2.tar.gz.

File metadata

  • Download URL: modelaudit_picklescan-0.1.2.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for modelaudit_picklescan-0.1.2.tar.gz
Algorithm Hash digest
SHA256 06110e30d49ff03d1ddb1a5b5bc3d079cc8318500dc18b44d780d5993eb393cb
MD5 a1cd1104410f2a7b2c4c3ddc6354a0e3
BLAKE2b-256 7bbe2efd096586e7e4013beb520776b1481ad788b05e32875b6d76697c0140d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelaudit_picklescan-0.1.2.tar.gz:

Publisher: release-please.yml on promptfoo/modelaudit

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

File details

Details for the file modelaudit_picklescan-0.1.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for modelaudit_picklescan-0.1.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 13843ae94d0c939337e33c6dd074a454490473b47bebe8690e621236e0e33984
MD5 49146e8d3e0e05ca3ad4947c8e5cfbe8
BLAKE2b-256 b2e44981f2df61d80f829984e60968bb45e5803cf073d8387285aab76cf0ecf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelaudit_picklescan-0.1.2-cp310-abi3-win_amd64.whl:

Publisher: release-please.yml on promptfoo/modelaudit

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

File details

Details for the file modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ccc1a3a5e6899753f2904eebdb48d673d264cb5c728ee28fa39b741329f75989
MD5 778a513dfb61f62143aef8740de2b9d6
BLAKE2b-256 9514b94bfe038fd34fd24846af9cae7ccdac2ea3664f03df1e1b3eab30af427e

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: release-please.yml on promptfoo/modelaudit

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

File details

Details for the file modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c40cbefa4d36aec67683ba61e3723cbf7a8322de1a2dd29b7244583d2c245508
MD5 d26cfc064e703242cd8f8e5f7956d2c9
BLAKE2b-256 e3371d0a3d7a84bc2f65df105869142b79d26b6854f8492c60d0df4ec5c797fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelaudit_picklescan-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: release-please.yml on promptfoo/modelaudit

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

File details

Details for the file modelaudit_picklescan-0.1.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for modelaudit_picklescan-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 feaae44a6f40b0afa14e913461d8b0005cb01f4c6c29539429f38309175e76fa
MD5 2a49f15baa8fa2a66b7ee974b6ef8c24
BLAKE2b-256 a4dfec575c947fae02251845128897017be05e72a1104137ace169d3d80d83d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelaudit_picklescan-0.1.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release-please.yml on promptfoo/modelaudit

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

File details

Details for the file modelaudit_picklescan-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for modelaudit_picklescan-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bdb90ef9efe339db2a2b3e6f797ebcbeab334a7e65b02269b775602c140712a7
MD5 4983799995017205dbd4b64f5ee06ec8
BLAKE2b-256 1521b9c67d18650bbae6286b0406278cb51c6e0812b601cb33890af640efd337

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelaudit_picklescan-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release-please.yml on promptfoo/modelaudit

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