Skip to main content

security-claim-audit

An offline, standard-library-only Python CLI that checks documentation promises about execution safety against Python source. It reads root README.md and docs/**/*.md, excluding fenced code blocks, and compares positive claims with AST call patterns. Inline code spans count as prose. It executes no audited project code, makes no network requests, and never opens .env files.

Requires Python 3.9 or later. Install and run:

pip install .
security-claim-audit path/to/project
security-claim-audit path/to/project --json
security-claim-audit --verbose --fail-on HIGH
security-claim-audit --ignore documented-no-shell-claim-false

The optional path defaults to .. --json emits findings, verified claims and a summary. --verbose includes verified claims in human output. --ignore RULE,... drops listed rules. --fail-on HIGH|MEDIUM defaults to MEDIUM. --version prints 0.1.0. Exit codes are 0 for PASS, 2 for findings meeting the threshold, and 1 for usage or input errors. Findings include severity, rule, relative documentation file, line, claim text, and a short code pattern; no source bodies are emitted.

Rule Severity
documented-no-eval-claim-false HIGH
documented-no-shell-claim-false HIGH
documented-no-pickle-claim-false HIGH
documented-safe-input-claim-false HIGH
documented-no-eval-claim-test-only MEDIUM
documented-no-shell-claim-test-only MEDIUM
documented-no-pickle-claim-test-only MEDIUM
documented-safe-input-claim-test-only MEDIUM

Claims such as “no eval”, “never shells out”, “no unsafe deserialization”, and “safe for untrusted input” are recognized case-insensitively. Warning lines containing “not enough”, “not sufficient”, “insufficient”, “is not safe”, “is unsafe”, or “avoid” are excluded. “No system calls” requires command context. Eval evidence includes builtin eval, exec, compile and nonliteral __import__ calls. Shell evidence includes subprocess calls, OS command calls, and legacy commands calls. Deserialization evidence includes pickle, marshal, shelve, dill, and yaml.load without an explicit Loader= keyword. ast.literal_eval, yaml.safe_load, and yaml.load with explicit Loader= are excluded. This Loader check is syntactic; it does not validate loader safety.

Evidence under tests, fixtures, docs, or test-named files is reported at MEDIUM only when production evidence is absent. No claims means PASS. Without any Python source, each claim receives a HIGH finding. Invalid Python syntax is skipped. Symlink files and directories are skipped.

Neighbours

Bandit and Ruff identify code issues rather than comparing documentation promises. privacy-claim-audit checks network and telemetry presence; readonly-claim-audit checks filesystem writes; auth-claim-audit checks credential requirements; config-claim-audit checks default values. This tool focuses on documented execution behaviour.

Limitations

Static pattern matching is not semantic judgement or a security certification. Subprocess calls with shell=False and literal argv still count because a promise of no subprocess or shell commands concerns external command execution. Use --ignore if your promise means only absence of shell=True. Dead code counts. Dynamic construction such as getattr tricks and string-built execution names is missed. Alias tracking is per file and resolves one attribute step. Local definitions and assignments suppress bare builtin evidence across the file, without scope or control-flow analysis. “Safe input” maps only to eval evidence, not shell or pickle evidence; this is not a full taint analysis. Warnings are filtered at line granularity. Audited source is never imported; the good fixture's YAML examples do not require PyYAML to be installed.

Development

PYTHONPATH=src python3 -m unittest discover -s tests -v
python3 -m build

MIT licensed. Runtime dependencies: none.

Metadata

Release files for security-claim-audit 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 security-claim-audit 0.1.0
File Size Uploaded Provenance Actions
security_claim_audit-0.1.0.tar.gz 10.2 kB Without provenance Details for security_claim_audit-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.2 kB

Release files / security_claim_audit-0.1.0.tar.gz

Download URL security_claim_audit-0.1.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d40bb39b937b5bbb542c5572d961dc19aae54d9b44e82740e6abd3fd425c58a2
BLAKE2b-256 checksum
How to use checksums
692ca65a96bf58ff12a56c5ffcad7db3a6000d68b95684a06120235409286bf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

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

Download URL security_claim_audit-0.1.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4798db3632b74ab100a4159190bc560215d6964c8a53caa88d041aa57e34daeb
BLAKE2b-256 checksum
How to use checksums
e1c77fa1e37696f27dc90206df79d49db598c57faf98702ca2486dc1734b98f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for security-claim-audit 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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