Skip to main content

CanoP CLI

CanoP logo

PyPI version License: MIT Python 3.8+ Code style: black

A fast, standalone static analysis tool for finding security risks in AI-generated code. CanoP runs locally and produces actionable findings with remediation guidance.

See CanoP in Action

CanoP scanning a project

Example fixes.json output

Features

  • High signal-to-noise: Targets AI-era risks such as SQL injection, unsafe reflection, and hardcoded secrets.
  • Language support: Supports Python and JavaScript.
  • CI/CD ready: Gate builds by severity or security score.
  • AI prescriptions: Generates fixes.json prompts for LLM-assisted remediation.
  • Standard reporting: Exports JSON and SARIF for GitHub and other security tools.

Installation

pip install canop

On macOS and Linux, use pipx if global pip installation is restricted:

pipx install canop

Verify the installation:

canop --version

Quick Start

Initialize .canop.yml and .canopignore:

canop init

Scan the current directory, or only files changed in Git:

canop scan .
canop scan . --changed

Findings are capped at 50 by default. Use --all for no cap or --limit N for a custom cap:

canop scan . --all
canop scan . --limit 10

Advanced Usage

CI/CD

These options return a non-zero exit code when the threshold is not met:

canop scan . --fail-on HIGH
canop scan . --min-score 85

Exporting Results

canop scan . --json-out results.json
canop scan . --sarif results.sarif
canop scan . --prescriptions fixes.json

The SARIF output can be uploaded to GitHub for inline findings. fixes.json contains prompts for LLM-assisted remediation.

Configuration

Add .canop.yml to the project root to define policy thresholds and ignored paths:

min_grade: B
fail_on:
  - CRITICAL
  - HIGH
ignore:
  - "tests/**"
  - "docs/**"
max_findings: 0

.canopignore uses .gitignore-style patterns to exclude files and directories.

How Detection Works

CanoP loads rules from canop/rules/*.yml and scans locally with its built-in pattern engine. Secret rules inspect comments to catch credentials accidentally left in frontend source by AI coding agents; other rules ignore comment-only lines to reduce noise. If installed, Semgrep adds AST-based analysis. It is optional and is not installed with CanoP.

Local Development

git clone https://github.com/openbreach/CanoP.git canop
cd canop
pip install -e .
python -m unittest discover -s tests -v

Build distribution artifacts with:

pip install -r requirements-dev.txt
python -m build

Rule Development

Rules use Semgrep YAML format and live in canop/rules/*.yml. See CONTRIBUTING.md for guidelines.

Support

For bugs and feature requests, open a GitHub issue or email canop.security@gmail.com.

License

This project is licensed under the MIT License.

Metadata

Release files for canop 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for canop 0.3.4
File Size Uploaded Provenance Actions
canop-0.3.4.tar.gz 76.9 kB Without provenance Details for canop-0.3.4.tar.gz

Built distribution (wheel)

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

Total release size: 173.3 kB

Release files / canop-0.3.4.tar.gz

Download URL canop-0.3.4.tar.gz
Size 76.9 kB
Tags Source
SHA-256 checksum
How to use checksums
be54eb731e49b3900019c2e9506772eff46db795072d763d64d3342478cf73f7
BLAKE2b-256 checksum
How to use checksums
9d2b1342227e38333aa38d7d6b504516ad6191323fa1037a59789fab61ea33df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / canop-0.3.4-py3-none-any.whl

Download URL canop-0.3.4-py3-none-any.whl
Size 96.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
beae4114a62d86f4cdd5c204a829c6a119a3c102e14c82f4ba7253bf910f0d43
BLAKE2b-256 checksum
How to use checksums
14c9b94c32b43fbf12b05a6c26c3d97158698e679fca1b0983a983b8401cb860
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for canop 0.3.4

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.

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