🛡 QSHIELD — Quantum Software Supply Chain Security Framework
Offline security checks for quantum circuits and the software that ships them — catch backdoor gates, trojan unitaries and tampered dependencies in OpenQASM circuits before they reach a run.
v2.0 — software-only, by design and forever. No QPU, no device SDK, no cloud account, no hardware in any acceptance criterion. Detection, verification and scoring all run offline on files. See the live interactive demo at
katepallewarprathmesh-sketch.github.io/QShield/.
What it does
| Command / surface | What it gives you |
|---|---|
qshield scan |
Severity-ranked findings for a circuit (structural analysis + builtin threat signatures); --fail-on high as a CI gate |
qshield compare |
Equivalence of two circuits — exact ZX-calculus proof or randomized identity testing |
qshield verify |
Unitary check of a circuit against an expected matrix (≤12 qubits) |
qshield audit-deps |
Quantum supply-chain audit of a requirements.txt (typosquatting, vulnerable pins) |
qshield sig |
Manage the built-in threat signature pack (offline, sha256-verified) |
qshield ui |
Workbench — local web UI: scan, compare, Policy Studio (your policies scored against the bundled fixture corpus), Robustness Probe (does a finding survive semantics-preserving camouflage?) |
| Reports | SARIF (GitHub Security tab) · JSON · HTML · PDF |
Everything runs offline: no hardware, no cloud, no accounts, no network calls.
Why
Everyone is busy with post-quantum cryptography (PQC) — security for classical data against quantum attacks. Almost nobody is securing quantum software itself. Classical SAST/DAST/SCA tools cannot analyze quantum circuits: gates are unitary matrices, states can't be copied for inspection, and measurement is destructive. QSHIELD is purpose-built for this territory.
Install
pip install qshield # core (OpenQASM parser, static analysis, CLI)
pip install 'qshield[qiskit,cirq]' # + framework parsers (qiskit-aer used by --full)
pip install 'qshield[formal]' # + ZX-calculus verification (PyZX, Z3)
Docker: docker pull ghcr.io/katepallewarprathmesh-sketch/qshield:1.2.0 (or build from source: docker build -t qshield .).
From source: git clone https://github.com/katepallewarprathmesh-sketch/QShield.git && cd QShield && pip install -e '.[dev]'
Requires Python ≥ 3.10.
Quickstart
qshield scan circuit.qasm # scan (text report)
qshield scan circuit.qasm --fail-on high # CI gate: exit 1 on high+ findings
qshield scan . --recursive --format sarif -o out.sarif # GitHub Security tab
qshield compare original.qasm suspicious.qasm --formal # ZX-calculus equivalence proof
qshield audit-deps --requirements requirements.txt # quantum supply-chain audit
qshield ui # Workbench at http://127.0.0.1:8765
Python API:
import qshield
results = qshield.scan("circuit.qasm") # quick static scan
print(results.is_clean, results.summary.total)
Optional AI assistance (cloud, advisory)
pip install sarvamai
export SARVAM_API_KEY=... # or gitignored .env
qshield ai triage circuit.qasm # plain-English findings + remediation priority (sends finding summaries, not the raw circuit)
qshield ai report circuit.qasm --to hi-IN # audit report in Hindi/Marathi/etc.
qshield ai speak "text" # Bulbul text-to-speech
qshield ai listen clip.wav # Saaras speech-to-text
Advisory only, never a verdict — the offline core never touches the network; qshield ai is opt-in. The Workbench surfaces the same features (AI Triage tab + the qshield ui page, key stays server-side).
What it detects
| Threat | Example | Verdict |
|---|---|---|
| Parameter perturbation / drift | rz(π/4 + 0.001) |
catches cumulative drift |
| Extra gate injection | cancelling cx … cx pairs, count anomalies |
immediate |
| Ancilla information leakage | ancilla copied out before mixing | deterministic |
| Parameter-encoded payloads | angles = bytes on a grid | deterministic |
| Measurement basis manipulation | h right before measure |
immediate |
| Package tampering | typosquatting, vulnerable pins, direct URLs | immediate |
| Compromised compiler / backend | pre/post-compile or cross-backend divergence | statistical / exact |
Honest limits
- Detection is evidence, never proof that a circuit is honest. Measured on the bundled synthetic fixture corpus (202 clean / 215 malicious) — fixture-corpus rates, not field rates.
- Randomized equivalence catches large deviations, not angles ≲ 1e-3 rad; use
--formalor dense matrix verification where feasible. - The community signature pack ships empty by design (candidates that measured TPR ≈ FPR were rejected).
- Published to PyPI and as a GHCR image; Apache-2.0. Detection rates above are fixture-corpus measurements, not field rates.
Status & license
v1.2.0 — software-only. See CHANGELOG.md for release notes.
Apache 2.0 — see LICENSE. Contributions (signatures, analyzers, corpus circuits) welcome.
Development
pip install -e '.[dev,qiskit,cirq,formal]'
python -m pytest tests
ruff check src tests benchmarks
mypy src
Metadata
Release files for qshield 1.2.0
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 |
|---|---|---|---|---|
| qshield-1.2.0.tar.gz | 304.8 kB | With provenance | Details for qshield-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qshield-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for qshield-1.2.0-py3-none-any.whl |
Total release size: 475.4 kB
Release files / qshield-1.2.0.tar.gz
| Download URL | qshield-1.2.0.tar.gz |
|---|---|
| Size | 304.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33b9da9cb59fdfdd987c72bafe7f0ba4889ba3ccca8d9602a0d979cf18555d73
|
|
BLAKE2b-256 checksum How to use checksums |
69513e6870868ccbb975b31fba377671093825745cc3d332e6af894f938e8bcf
|
| 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 Nov 17, 2026.
Transparency logRelease files / qshield-1.2.0-py3-none-any.whl
| Download URL | qshield-1.2.0-py3-none-any.whl |
|---|---|
| Size | 170.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e38119bf5daa300d0bccb6f6d3ab435c41a4f5805a802d230ff9adf26cd1df4
|
|
BLAKE2b-256 checksum How to use checksums |
00353aca15861a2929e7800f5578939c39ff38ed500d791c948250619ce60038
|
| 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 Nov 17, 2026.
Transparency logSecurity for qshield 1.2.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.
Attestation for qshield-1.2.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 Nov 17, 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.