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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

codepathfinder-1.2.0-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.0.tar.gz.

File metadata

  • Download URL: codepathfinder-1.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8ac96c0b08a70bf3fc248d3e78dc4467a33813d31868ec78d2872a9721407399
MD5 a2b0cfcdcfe4aa715879d8df0a94012b
BLAKE2b-256 d13d10068b3c84dd1c036e29b2210c0e2deb57e45d9dd4c66fefabe703b3c43b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 383bacfdaac615e6ed6b1ec4691be5f81daf032ca8928cd02d88758af2ef35d2
MD5 a4493bcbe1495d4aef5febaab590ba41
BLAKE2b-256 244a05c8978dbb8dbb43fd9818b884b57365adedcd6cae994d3c798a40f3e383

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8aab40f0888e7edc6a3b0e6ff371a73e7a646b7250a34eac73d4805c8d4656cc
MD5 b476bd6100247a72229bc5cb4de8a299
BLAKE2b-256 6784a48c1d2146fd32009db1c0a5f395cf7ec28d0426b61cae2bfe8984fc20b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 31bbfc0e52e8e3059a48cb9bf3f69ad1d57f6472179e4a7423d9091de87c682a
MD5 a57f80b0dba169637a520c332b62d492
BLAKE2b-256 add1486df60133a688f988f135303b6ea42646958d44f9753632bc361ea66ab0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 745fb1d83776c7f78a8d34177eb67f1cf2568898ea8265426a48a6e9e4001000
MD5 f8a4c8ec13e9e99608a84e407b7242d3
BLAKE2b-256 6289b84d7f431664085cbb1362ad900c8d2a994352c84bbe046005ce19f5e896

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.2.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ff6835096c3c62aa9ed65e38b6f74e7884f84e44455620c12ecf57d6045ac04c
MD5 48ed5c1830c1acd6f2cd1460a8fe15f7
BLAKE2b-256 0343a67776d9eb08cb3aa67e95abc7cd2fd1ec479c076aabfa9fd3d43ffdbca7

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