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.2.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.2-py3-none-win_amd64.whl (4.4 MB view details)

Uploaded Python 3Windows x86-64

codepathfinder-1.2.2-py3-none-manylinux_2_17_x86_64.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

codepathfinder-1.2.2-py3-none-manylinux_2_17_aarch64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

codepathfinder-1.2.2-py3-none-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

codepathfinder-1.2.2-py3-none-macosx_10_9_x86_64.whl (4.3 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: codepathfinder-1.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2ef5ebede4da95deb0a283f0d8f42ed9701bd2a2fba13e6df04d4762609d80e2
MD5 1ccf2a4d2da0a5aced367f0cec2d8070
BLAKE2b-256 ac8857f2266499956e5521f6b6a5b95c7ea2a44c11c6ef4a4f85d095cadac249

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b2e92fca3d61ba830124bc7f1118cf5cde1e70a45bcbc6330f160e26cfe1336b
MD5 688d7960bd1eb6d577195f759353695f
BLAKE2b-256 5bf85e63fed7493710df84d1a80ad2bcbf3890b780499e288db6147d9a10d733

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.2-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fb7f3dbbe13a545a96a27a3fec36d9cf6f8fa445e9f5fe6818be6902f1babafd
MD5 11deebe7431fa960afaaf3648e307f61
BLAKE2b-256 11b7a4f360510a182728c7eb51af505927b69d1e49a3b0afbceb70ab276dd260

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.2-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 fda4593b5ec9d1a33e4a4a4121e7cb3dca32fe0c6fa55d0946f8309ccfa11d41
MD5 b85d6e9c9cf667d745e07dfc93e568c4
BLAKE2b-256 328815df071ead684ae944d4ef5c8dc27b8982a069a3123bc679bd6fe4ce5690

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d9bf806fd6246b007c13922b4fccdd9f507a5c30d609835d792965bacfb308a
MD5 79a6db9ce5e9578fe4e044a9b8cdc5ef
BLAKE2b-256 4a9d8e34b2d1d46624caf06b6767ef70ad48f4cd3b11dfa325e8436a9d291aea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.2-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4b12983ebf7c0e2d7a8264965e2b06415586403c14b76838d9b9359ee70eceff
MD5 f5b5e8a5ede81710d3e06fc1f310d5e2
BLAKE2b-256 b29d8f544a3afe91c8d0874a15e82cb3610c8c34ba111ed54227d8e8278172d1

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