Skip to main content

QuantTape

Local security scanner and egress firewall for trading bots and AI agents.

PyPI Tests Python License: MIT

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, .env content, 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

MIT

Metadata

Release files for quanttape 0.0.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quanttape 0.0.22
File Size Uploaded
quanttape-0.0.22.tar.gz 48.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quanttape 0.0.22
File Interpreter ABI Platform
quanttape-0.0.22-py3-none-any.whl Python 3 none any Details

Total release size: 83.1 kB

Release files / quanttape-0.0.22.tar.gz

Download URL quanttape-0.0.22.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fc49350370f1fc0b64728fe0c3dc0a4adf6b7bbd534fb2eeca5bbd9c8d777792
BLAKE2b-256 checksum
How to use checksums
91d86156d1ecc20ae8bda2b14c954873f511aab69e3cbbedc5da9341b3c456f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / quanttape-0.0.22-py3-none-any.whl

Download URL quanttape-0.0.22-py3-none-any.whl
Size 34.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5da6c5e59977dc39e97bc049512c2124dd02e07a16473e8a474ec3d8a33d6296
BLAKE2b-256 checksum
How to use checksums
7c8d9da71a460284cd90e864232460a3a8f8d85ef48559b47d56ca788d389f50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.0.22 This release

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page