Skip to main content

Python SDK for code-pathfinder static analysis for modern security teams

Project description

Code-Pathfinder Python DSL

Python DSL for defining security patterns in Code Pathfinder - an open-source security suite combining structural code analysis with AI-powered vulnerability detection.

Project Goals:

  • Real-time IDE integration bringing security insights directly into your editor
  • AI-assisted analysis leveraging LLMs to understand context and identify vulnerabilities
  • Unified workflow coverage from local development to CI/CD pipelines
  • Flexible reporting supporting DefectDojo, GitHub Advanced Security, SARIF, and other platforms

Documentation: https://codepathfinder.dev/

Installation

pip install codepathfinder

This installs both the Python DSL and the pathfinder CLI binary for your platform.

Verify Installation

# Test CLI binary
pathfinder --version

# Test Python DSL
python -c "from codepathfinder import rule, calls; print('DSL OK')"

Supported Platforms

  • Linux (glibc): x86_64, aarch64
  • macOS: arm64 (Apple Silicon), x86_64 (Intel)
  • Windows: x86_64

Source distributions are available for other platforms - the binary will be downloaded automatically on first use.

Quick Example

from codepathfinder import rule, flows, calls
from codepathfinder.presets import PropagationPresets

@rule(id="sql-injection", severity="critical", cwe="CWE-89")
def detect_sql_injection():
    """Detects SQL injection vulnerabilities"""
    return flows(
        from_sources=calls("request.GET", "request.POST"),
        to_sinks=calls("execute", "executemany"),
        sanitized_by=calls("quote_sql"),
        propagates_through=PropagationPresets.standard(),
        scope="global"
    )

Features

  • Matchers: calls(), variable() for pattern matching
  • Dataflow Analysis: flows() for source-to-sink taint tracking
  • Propagation: Explicit propagation primitives (assignment, function args, returns)
  • Logic Operators: And(), Or(), Not() for complex rules
  • JSON IR: Serializes to JSON for Go executor integration

Documentation

For detailed documentation, visit https://codepathfinder.dev/

Requirements

  • Python 3.8+
  • No external dependencies (stdlib only!)

License

AGPL-3.0 - GNU Affero General Public License v3

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

codepathfinder-1.2.1.tar.gz (47.4 kB view details)

Uploaded Source

Built Distributions

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

codepathfinder-1.2.1-py3-none-win_amd64.whl (4.0 MB view details)

Uploaded Python 3Windows x86-64

codepathfinder-1.2.1-py3-none-manylinux_2_17_x86_64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

codepathfinder-1.2.1-py3-none-manylinux_2_17_aarch64.whl (3.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

codepathfinder-1.2.1-py3-none-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

codepathfinder-1.2.1-py3-none-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file codepathfinder-1.2.1.tar.gz.

File metadata

  • Download URL: codepathfinder-1.2.1.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codepathfinder-1.2.1.tar.gz
Algorithm Hash digest
SHA256 831213c23413e7ab08eaaee602b7bcd9872ac55f2547cdbbfacfdb3dc4f00069
MD5 4f8941c07618a8178f0c390ead42f4e3
BLAKE2b-256 646974d0c5b0b407f7b32b9d379e602dcf39ea908d1534ca6388611e4d229e4b

See more details on using hashes here.

File details

Details for the file codepathfinder-1.2.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2a165353ca23ddf52047c27a4737808d0fc77c83a43d9cc39e0f8602c8ce5022
MD5 ce80ea10332fd2c8fa4d02792322c753
BLAKE2b-256 9af06d507fd8c6743653dd7278a6f67d4e4cd3f7340e512568a5ecb13d58b6de

See more details on using hashes here.

File details

Details for the file codepathfinder-1.2.1-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.2.1-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 68bef8ccd80447bfd629aebb09fadb83e163c868f132df95826e2620b1881cae
MD5 0ed60546412dcd6402fc69849310b48a
BLAKE2b-256 d152d628c8e307e682b8bd56c1460af691591285ebd1580b2d2e1e032a1d4531

See more details on using hashes here.

File details

Details for the file codepathfinder-1.2.1-py3-none-manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.2.1-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 f60847e8d8ba60682a99451006fc5cb91e4f3b7b655fcaf20ba07dedbcfffd41
MD5 4de36bfaa367d000dbec455d65bd58d2
BLAKE2b-256 16ea44a895889f79cf2907b2549f16a09b23ae72c0cffbdf1266bc1f7ad62883

See more details on using hashes here.

File details

Details for the file codepathfinder-1.2.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.2.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 440c1d9bba4b4cb76cd0f7f36cb4a4442b9782047b240774b91587384508976f
MD5 c97c0cc422df73b6144bd86147a4dd29
BLAKE2b-256 4723d08020a206b3d0ae2a377008ab3150426efed4fcbf561e61aede80c14866

See more details on using hashes here.

File details

Details for the file codepathfinder-1.2.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for codepathfinder-1.2.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 18ca304256bd74a3d3028a448ff7175e617563fb7e158a68b6a18d3f74159a87
MD5 c70e1756bd2c14a93f96d569cd62f76b
BLAKE2b-256 8df2b943b60580d699ba29b8fdcafad9eed5252266f18acf6c1a961646489c06

See more details on using hashes here.

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