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.3.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.3.0-py3-none-win_amd64.whl (4.7 MB view details)

Uploaded Python 3Windows x86-64

codepathfinder-1.3.0-py3-none-manylinux_2_17_x86_64.whl (4.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

codepathfinder-1.3.0-py3-none-manylinux_2_17_aarch64.whl (4.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

codepathfinder-1.3.0-py3-none-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

codepathfinder-1.3.0-py3-none-macosx_10_9_x86_64.whl (4.6 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: codepathfinder-1.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 0439fa9fec6aa2f12df910b7fc208930169cb1dd34819ae35cb17a4929eb69c6
MD5 02ff25385d50e89d99bd4440abb5e60d
BLAKE2b-256 355aedbff53ffd431bf2852d55ebd00e7f5ecac7e6ab675f011cba5924ad0f16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6a1730e3acb564d85ccdb9427c274787fdb89623d929a10624f7bba5f5326222
MD5 3092064951638a9a291445772f2c4f39
BLAKE2b-256 7c59f58a81b103ccb0f2f94a41abadc5477c27d191d4a9f248026291bad4bc4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f5cc39480dfd568ad7b4bf6344582f95c81302461ed6d971356cfac63ad0c11e
MD5 00761a5fdcedb5ce359497a918188ed9
BLAKE2b-256 23bf3552ba19ba140ba9d9ab347ada3ff28a5bafe697efd52ef6599ff9f053bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.0-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 e773251bd5f25266d5d5de6da173e936446963c9a8583f9f27cd90250ca80e5e
MD5 d61ed07e751d2679f3351bd2edf8fdfa
BLAKE2b-256 83419ea1fcc3a0a5042c6c700f1166c88d7c4f9ebad443cfbcb702d52d6da4f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c067cf51b60f3af3a5ac1a3fd8ca71e86453b78f10fe652e7043cf57a8eb7272
MD5 9f820bb92f0bb8f34e94cf12cd8e55f3
BLAKE2b-256 3bf82aea5126c9ad2fe259292e532f568ed8238d4799692fb991da0b733aa7f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fdc5f7cc4e0be49fdcdee9d205216f374c8913e98b61c4226e40aa2a99a10472
MD5 eb4d687714f8f335b9b5c0aac8b01f2a
BLAKE2b-256 3749d92e7e015ffe26f1c25f4992ae5f8dd193ed7c2228461db8d44ea0eeb259

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