Patronus Ark Core for Python
Local PII, DLP and prompt-injection scanning with optional Wolf Defender.
This package binds only patronus-ark-core, under MIT OR Apache-2.0.
Install the Core Python package into the same environment as your application:
python -m pip install 'patronus-ark-core>=0.1.14'
Version 0.1.14 is the first standalone Core Python release. Model weights are separate assets; native checks do not need a model or an API connection.
from patronus_ark_core import Scanner, ScanControl, ScannerConfig
config: ScannerConfig = {"categories": ["pii", "dlp", "injection"]}
scanner = Scanner(config)
report = scanner.scan("Text to inspect", control=ScanControl(timeout_ms=1000))
Optional ScannerConfig, WolfConfig, WarmupOptions, WolfExecutionOptions
and OnnxRuntimeOptions TypedDicts describe accepted settings. Plain dictionary
arguments remain supported; runtime validation stays in Core.
report contains input_bytes, native (Core results including layers and
original UTF-8 byte/character evidence spans), and wolf (a separate model
result, or None). Native results preserve Core labels and policy evidence;
the host decides whether to block or redact. Native layer matched may be true
for a safe classification; use class/evidence/decision for native policy.
wolf["matched"] means the model attack probability met its threshold.
For local Wolf, configure existing assets explicitly:
scanner = Scanner(
{"wolf": {"bundle_dir": "/srv/models/wolf-defender", "threshold": 0.8,
"precision": "fp16", "backend": "cpu"}},
warmup={"download": "never"},
wolf_options={"window_tokens": 256, "overlap_tokens": 0, "batch_size": 1},
)
report = scanner.scan("Text to inspect", pii=False, dlp=False)
Thresholds are deployment-specific. The default Wolf window profile preserves
Core's 256 total tokens / overlap 0 / batch 1 behavior. Downloads require explicit
warmup={"download": "missing"} during construction; scans never download.
Scanner construction warms the configured model and subsequent calls reuse it.
Calls release the GIL and run synchronously on the calling thread. Async hosts
should use a reusable worker pool. Finite ONNX deadlines share Core's timer thread.
Serialize calls to a scanner or use a bounded pool of
scanners; simultaneous use raises ScannerBusyError. ScanControl.cancel() can
be called from another thread and propagates into Core/ONNX. Expired deadlines
raise TimeoutError, explicit cancellation raises CancelledError, invalid
configuration raises ValueError, and scanner/resource failures raise
RuntimeError. No partial report is returned on failure. The timeout starts when
ScanControl is constructed, so sharing it across fields shares one remaining
budget, including time spent waiting before the scan.
Build from the repository using a virtual environment:
.venv/bin/python -m maturin develop --manifest-path ark-core/python/Cargo.toml
.venv/bin/python -m pytest ark-core/python/tests
Published wheels include CPU Wolf support. Source builds may opt out with
maturin build --no-default-features; such builds reject Wolf configuration.
Model weights are separate assets, not bundled with the Python package.
Publishing setup
The first upload uses a GitHub Actions pending publisher configured at PyPI account publishing with:
| Field | Value |
|---|---|
| PyPI project name | patronus-ark-core |
| Owner | patronus-protect |
| Repository | patronus-security |
| Workflow filename | core-python.yml |
| Environment | release |
The filename is relative to .github/workflows/. Use the existing release
environment, matching the publish job in core-python.yml. Registering the
pending publisher neither uploads files nor reserves the package name. PyPI
creates the project and converts the publisher on the first successful upload.
The Core Python workflow builds and tests wheels on Linux, macOS and Windows,
and rebuilds the source distribution. Publishing requires a separate manual
workflow dispatch with publish: true; its default is false. Preparing the
release or merging changes does not request publication. Keep publish off
until the release commit and publisher are reviewed.
Metadata
Release files for patronus-ark-core 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| patronus_ark_core-0.1.14.tar.gz | 559.6 kB | With provenance | Details for patronus_ark_core-0.1.14.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| patronus_ark_core-0.1.14-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for patronus_ark_core-0.1.14-cp311-abi3-win_amd64.whl |
| patronus_ark_core-0.1.14-cp311-abi3-manylinux_2_28_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.28+ x86-64 | Details for patronus_ark_core-0.1.14-cp311-abi3-manylinux_2_28_x86_64.whl |
| patronus_ark_core-0.1.14-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for patronus_ark_core-0.1.14-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 34.6 MB
Release files / patronus_ark_core-0.1.14.tar.gz
| Download URL | patronus_ark_core-0.1.14.tar.gz |
|---|---|
| Size | 559.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8de4c50430923fa9896a750bf5e9154e64340f58126ee6c5aa318294eac3d8cc
|
|
BLAKE2b-256 checksum How to use checksums |
495ab272b00603dc5290bd4009d264f66893dfcf84b1187bdaab6076b44b40ad
|
| 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 Oct 28, 2026.
Transparency logRelease files / patronus_ark_core-0.1.14-cp311-abi3-win_amd64.whl
| Download URL | patronus_ark_core-0.1.14-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 10.1 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
676eade4754fad5ceae3d2ccc0c365f5653e10ec01cfb9f642737355ac022ed2
|
|
BLAKE2b-256 checksum How to use checksums |
4eff59dd33892f7499ae73dad742b4ab5bd839f711c253c33642ba6c2b43d582
|
| 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 Oct 28, 2026.
Transparency logRelease files / patronus_ark_core-0.1.14-cp311-abi3-manylinux_2_28_x86_64.whl
| Download URL | patronus_ark_core-0.1.14-cp311-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.8 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
291396351ac9c0bfb098844b73e3b9b4d2f1bb0acd201ad6bd29c4700406e113
|
|
BLAKE2b-256 checksum How to use checksums |
9ba4f1285e4e3e2af7e927c2642c5d37dea24b18acae299748406cebe60cf0f7
|
| 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 Oct 28, 2026.
Transparency logRelease files / patronus_ark_core-0.1.14-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | patronus_ark_core-0.1.14-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 11.2 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4b23a84173334e3f382aa48e3ae4e4035edae9e669c8e83ffd5627a297a47d47
|
|
BLAKE2b-256 checksum How to use checksums |
bf118a99bfbcbb7069f3d5118eb33d1666ce585f32f7729ff5f77deaf7845a7c
|
| 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 Oct 28, 2026.
Transparency logSecurity for patronus-ark-core 0.1.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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for patronus_ark_core-0.1.14.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 28, 2026.
Transparency logA 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.