Skip to main content

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

Project description

Code Pathfinder Python SDK

Write security rules in Python for Code Pathfinder, an open-source security scanner that combines structural code analysis with AI-powered vulnerability detection.

What you can do:

  • Write custom security rules using Python instead of regex or YAML
  • Trace data flows from sources (user input) to sinks (SQL, eval, file operations)
  • Run rules in VS Code, CLI, or CI/CD pipelines
  • Export findings to DefectDojo, GitHub Advanced Security, SARIF, JSON, or CSV

Documentation: https://codepathfinder.dev/

Installation

pip install codepathfinder

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

Verify Installation

# Test CLI binary
pathfinder --version

# Test Python SDK
python -c "from codepathfinder import rule, calls; print('SDK 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.6.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.6-py3-none-win_amd64.whl (5.0 MB view details)

Uploaded Python 3Windows x86-64

codepathfinder-1.3.6-py3-none-manylinux_2_17_x86_64.whl (4.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

codepathfinder-1.3.6-py3-none-manylinux_2_17_aarch64.whl (4.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

codepathfinder-1.3.6-py3-none-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

codepathfinder-1.3.6-py3-none-macosx_10_9_x86_64.whl (4.9 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: codepathfinder-1.3.6.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.6.tar.gz
Algorithm Hash digest
SHA256 3de865dc2fc04d7ceaccf1db13431513268d36f7593d8a2863be35ea7e02576e
MD5 ffa320266047fcd97f07cd5c13130588
BLAKE2b-256 4392b20601c2818da64af753915b03819b833c8db48b2d7a8b7ff5d347ea16cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 87ca6822ca63afbdd9107388fbf9b8c2c174e83e157bdfa89471603e63e59fd3
MD5 562b8ef736e746f4e083f7133909abc0
BLAKE2b-256 43cd65c73d4be3e554b19a470c93478019af1df7057f6080365025a149d06aa8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.6-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 51fa3c9b85177bc6ace96ce601357277250a87d1f10bf1bfde2fdeae2c517b38
MD5 a9870bb7a2cbd66fb4e4053a334991f6
BLAKE2b-256 962fc42d1ecbeb0bc43891e26f7065954e1a40bdd1a8a88d83302c9f63d2e4a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.6-py3-none-manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 ac7197f921f50d0e84209e8071aa4580ff1ca2b6582c3f1438436e7b5104beff
MD5 65b28f64609c19a426d5e7703bf826a8
BLAKE2b-256 28dd3384f5a58cd0507dbda555c18a495c637c72e6dd924e0eeb28338ea3e96d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22015108ea0857ad7ddc66e748d975ea9e373a03f8ace8b3bf88a4afa0216503
MD5 2fd3c7cb4ccb6bcb706744823c369ba0
BLAKE2b-256 baa0204774292cae338f89648ea95eae9c8aebd75cefd8e4aad88d97ccbe22f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codepathfinder-1.3.6-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f7dc97f1facbafbb6bc3f17129ec8e97f4ed1990a0f4f8214d023da57ae8e3ff
MD5 d2f2b479667f6a03bd3cf0c032781f37
BLAKE2b-256 415f3f481966ca2f071ad4d4b8312b12741296bb8216045d13cafc91a693cb19

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