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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codepathfinder-1.1.6.tar.gz.
File metadata
- Download URL: codepathfinder-1.1.6.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7bbac006c7be8c85b42126717fcbd9021e76c37fbb9e8299b0fab08152bac05
|
|
| MD5 |
81cdcc80305708d8e2c9920b3812d17f
|
|
| BLAKE2b-256 |
3dc9ddc0f8cfc6aad0c81720a2c28b53cf95ffe1fd95c922374c09ff7acc6fa9
|
File details
Details for the file codepathfinder-1.1.6-py3-none-win_amd64.whl.
File metadata
- Download URL: codepathfinder-1.1.6-py3-none-win_amd64.whl
- Upload date:
- Size: 3.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f64a547672233315ee0c2204ab16280a24489ecf0b539b29c226a28bef24a893
|
|
| MD5 |
490a392d66039762738324cf57c91c00
|
|
| BLAKE2b-256 |
a31a80b8d029f2a924c91f09e4910564559f39eda21626f1401d4ecf2eb84b5f
|
File details
Details for the file codepathfinder-1.1.6-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: codepathfinder-1.1.6-py3-none-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78c48ed46e4e78ae594b97b41dafe92be6cb32ff698637f91325f0e39034d783
|
|
| MD5 |
7c4b8dabd18152bba758761e8900b174
|
|
| BLAKE2b-256 |
970d41e004ccf1f604050cfa3c5e226843eac5e458bf21340672ef549346182c
|
File details
Details for the file codepathfinder-1.1.6-py3-none-manylinux_2_17_aarch64.whl.
File metadata
- Download URL: codepathfinder-1.1.6-py3-none-manylinux_2_17_aarch64.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1199bc394569f7e66b4bd75f20797bd66a35912b41371f0e30e45db6472b7cd2
|
|
| MD5 |
8211ad97381fe78dfddb51048e7352df
|
|
| BLAKE2b-256 |
31bfa58a4edbb593efd7564c475d6b0f4a9951eba83ea525725bdb73ec80e7c8
|
File details
Details for the file codepathfinder-1.1.6-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: codepathfinder-1.1.6-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc3e8995876758f97c6c21680517db5f496839749579aee94fe51550a5798868
|
|
| MD5 |
2e0d67fdcf844801831fa206a63dd27f
|
|
| BLAKE2b-256 |
308e4dfeee5033e23fec8cc84a4be3bb43d0ccdd0b88f99c851e904ca2cdcb55
|
File details
Details for the file codepathfinder-1.1.6-py3-none-macosx_10_9_x86_64.whl.
File metadata
- Download URL: codepathfinder-1.1.6-py3-none-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: Python 3, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4112eb941d17f0b159b0868887a6263415586ff5c5874d6908aa51176b9293f
|
|
| MD5 |
f4be8cbba6543bcc0f243701245e8a06
|
|
| BLAKE2b-256 |
40b9ac9f4700a7ab9a5bfc54a2c00ee47dd2d4fa9308cba3c69bda305d3ac36c
|