Local-first security scanner and egress proxy for trading bots and AI agents.
Project description
QuantTape
Local security scanner and egress firewall for trading bots and AI agents.
Quick Start
Install:
pip install quanttape
Scan your code for secrets:
quanttape scan my_bot.py
Start the Guard proxy to block secrets in outbound requests:
pip install quanttape[guard]
quanttape guard --mode agent
Test it:
curl -x http://127.0.0.1:8080 \
--cacert ~/.quanttape/ca.pem \
"https://api.example.com/data?token=ghp_a1b2c3SECRET"
403 Forbidden
X-QuantTape-Action: blocked
{"error": "QuantTape Guard: request blocked", "allowed": false, "reason": "Blocked: 1 secret(s) detected"}
Everything runs locally. No cloud service required.
What QuantTape Does
Scanner
Static detection of secrets and risky patterns in code and files.
- 33+ built-in rules across credentials, broker secrets, and trading-code risk patterns
- Suppresses false positives in common trading-bot structures
- Scans single files, directories, and git history
- Outputs Console, JSON, or SARIF
Guard
Local egress proxy that intercepts outbound HTTP/HTTPS requests and blocks secrets before they leave your machine.
- HTTPS interception via locally generated CA
- Inspects URLs, headers, and request bodies
- Deterministic block-or-forward decision
- JSON audit logging to
~/.quanttape/guard.log - Real-client MITM validated with curl, requests, and httpx (24/24 tests passing)
What It Looks For
- Hardcoded broker/API secrets (Alpaca, Binance, Coinbase, IB, Kraken, Tradier, Polygon)
- AWS, GCP, Azure, Slack, Telegram, JWT credentials
- SSH private keys,
.envcontent, webhook URLs - Unsafe market-order usage, position sizing without caps
- Busy loops, risky blocking sleeps, hardcoded symbols
Scanner CLI
quanttape scan my_bot.py
quanttape scan ./my_project/ --output json
quanttape scan ./my_project/ --output sarif
quanttape scan ./my_project/ --git-history
quanttape scan my_bot.py --generic-mode
Guard CLI
quanttape guard # start on :8080
quanttape guard --port 9090 # custom port
quanttape guard --mode agent # credential + general rules
quanttape guard --mode trading # all rules including broker + trading logic
quanttape guard --mode all # everything (default)
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/")
for f in findings:
print(f"{f.severity} | {f.secret_type} | {f.file}:{f.line}")
Output Formats
from quanttape import SecretScanner
from quanttape.output import format_results
findings = SecretScanner().scan_directory("./bots/")
format_results(findings, "console") # rich terminal output
json_output = format_results(findings, "json")
sarif_output = format_results(findings, "sarif")
Finding Object
| Attribute | Type | Description |
|---|---|---|
file |
str |
Path to the file |
line |
int |
Line number |
secret_type |
str |
Rule that matched |
severity |
str |
CRITICAL, HIGH, MEDIUM, or LOW |
match_preview |
str |
Partially redacted preview |
License
Links
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.21.tar.gz.
File metadata
- Download URL: quanttape-0.0.21.tar.gz
- Upload date:
- Size: 46.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cddc8b5cc83b625b5a31936b70cbc6b0c4f871e866ceab000f47dcbc43529b9
|
|
| MD5 |
c3871c1645eefb749ddacc95b534d81c
|
|
| BLAKE2b-256 |
61846b3f2c04a5042d707087d3bbd4bc0166f36b4d56882c352ac7a1673dd5fe
|
File details
Details for the file quanttape-0.0.21-py3-none-any.whl.
File metadata
- Download URL: quanttape-0.0.21-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eb2b4b80f1f6009987ab97ae6f28a306ac8c22a3bd1d2f5029d153f16d38709
|
|
| MD5 |
de43a1fccb83d8382349bbb1eb9e9a79
|
|
| BLAKE2b-256 |
b844de011fbb5938b64bf02de6c9ca3d1216c937fdf80f0bc9d3370fe5bb4f1d
|