Trading-aware local security scanner for bots, strategies, and execution code.
Project description
Quant Tape
The Last Line Before The Market.
Quant Tape is a local security scanner for trading bots and algorithmic trading code. It finds exposed broker keys, embedded credentials, and risky execution patterns before they hit production.
- Local-first - scans your files, repos, and optional git history without uploading code
- Trading-aware - built for broker wrappers, sizing logic, execution flows, and bot loops
- CI-ready - outputs findings as Console, JSON, and SARIF
What The SDK Does Today
Quant Tape currently ships with a scanner built for trading codebases.
- Detects 33 built-in rules across credentials, broker secrets, and trading-code risk patterns
- Suppresses obvious false positives in common trading-bot structures
- Scans single files, full directories, and optional git history
- Fits local development, pre-commit checks, and CI pipelines
- Exports findings as Console, JSON, or SARIF
What It Looks For
- Hardcoded broker/API secrets
- Embedded credentials and webhook URLs
- Unsafe market-order usage
- Full-account position sizing without caps
- Busy loops and risky blocking sleeps
- Hardcoded trading symbols and other reusable-bot mistakes
Supported broker and market-data patterns include:
- Alpaca
- Binance
- Coinbase
- Interactive Brokers
- Kraken
- TD Ameritrade / Schwab
- Tradier
- Polygon.io
Quick Start
CLI
pip install quanttape
quanttape scan my_bot.py
quanttape scan ./my_project/ --output json
quanttape scan ./my_project/ --git-history
Default behavior is trading-aware scanning. If you want generic raw scanning behavior instead:
quanttape scan my_bot.py --generic-mode
Python SDK
from quanttape import SecretScanner
scanner = SecretScanner()
# Scan a single file
findings = scanner.scan_file("my_bot.py")
# Scan an entire directory
findings = scanner.scan_directory("./trading_bots/")
# Check results
for f in findings:
print(f"{f.severity} | {f.secret_type} | {f.file}:{f.line}")
With custom rules or generic mode:
from quanttape import SecretScanner
scanner = SecretScanner(
config_path="my_rules.yaml", # custom rules file
trading_bot_mode=False, # generic scanning (no AST suppression)
)
findings = scanner.scan_directory("./src/")
Output Formats
from quanttape import SecretScanner
from quanttape.output import format_results
findings = SecretScanner().scan_directory("./bots/")
# Rich console output (prints directly)
format_results(findings, "console")
# JSON string
json_output = format_results(findings, "json")
# SARIF string (for GitHub Code Scanning, VS Code, CI)
sarif_output = format_results(findings, "sarif")
Finding Object
Each finding has these attributes:
| Attribute | Type | Description |
|---|---|---|
file |
str |
Path to the file |
line |
int |
Line number |
secret_type |
str |
Rule that matched (e.g. "Alpaca API Key") |
severity |
str |
CRITICAL, HIGH, MEDIUM, or LOW |
match_preview |
str |
Partially redacted preview of the match |
Coming Soon
- Guard SDK - runtime trade validation, kill-switch, drawdown controls
- Zero-Knowledge Vault - encrypted local-first credential storage
Join the waitlist: quanttape.com
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
Built Distribution
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 quanttape-0.0.17.tar.gz.
File metadata
- Download URL: quanttape-0.0.17.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b4a608c7fd17644b5ec82bd54f07e96846d90d31e658f926ba28a6958fccdba
|
|
| MD5 |
9133f4436ed9be9df56bdc2a40c02d5f
|
|
| BLAKE2b-256 |
f7845ebbef280f152ee3b2b951c938a542f9c4b37ee8123fd5c991655f05ebfc
|
Provenance
The following attestation bundles were made for quanttape-0.0.17.tar.gz:
Publisher:
publish.yml on quanttape/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quanttape-0.0.17.tar.gz -
Subject digest:
0b4a608c7fd17644b5ec82bd54f07e96846d90d31e658f926ba28a6958fccdba - Sigstore transparency entry: 1105915743
- Sigstore integration time:
-
Permalink:
quanttape/sdk@a7463288a14babd4a2066697d8db58bcb6eb443a -
Branch / Tag:
refs/tags/v0.0.17 - Owner: https://github.com/quanttape
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a7463288a14babd4a2066697d8db58bcb6eb443a -
Trigger Event:
release
-
Statement type:
File details
Details for the file quanttape-0.0.17-py3-none-any.whl.
File metadata
- Download URL: quanttape-0.0.17-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05a68d0fa931a9c96fc7f910f8b1635ca6388d91a0c8ba365a7f881ee8511ba4
|
|
| MD5 |
113f5ab926161b4f5a5ccba6f82acdd5
|
|
| BLAKE2b-256 |
776050ecaa4b0e4c9e27cbc0dde0db96151c07101afec8ac4286055a4a0346ac
|
Provenance
The following attestation bundles were made for quanttape-0.0.17-py3-none-any.whl:
Publisher:
publish.yml on quanttape/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quanttape-0.0.17-py3-none-any.whl -
Subject digest:
05a68d0fa931a9c96fc7f910f8b1635ca6388d91a0c8ba365a7f881ee8511ba4 - Sigstore transparency entry: 1105915751
- Sigstore integration time:
-
Permalink:
quanttape/sdk@a7463288a14babd4a2066697d8db58bcb6eb443a -
Branch / Tag:
refs/tags/v0.0.17 - Owner: https://github.com/quanttape
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a7463288a14babd4a2066697d8db58bcb6eb443a -
Trigger Event:
release
-
Statement type: