Skip to main content

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.

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

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

quanttape-0.0.22.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quanttape-0.0.22-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file quanttape-0.0.22.tar.gz.

File metadata

  • Download URL: quanttape-0.0.22.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for quanttape-0.0.22.tar.gz
Algorithm Hash digest
SHA256 fc49350370f1fc0b64728fe0c3dc0a4adf6b7bbd534fb2eeca5bbd9c8d777792
MD5 433015f46b1f57dc2aaef03bc0daec56
BLAKE2b-256 91d86156d1ecc20ae8bda2b14c954873f511aab69e3cbbedc5da9341b3c456f0

See more details on using hashes here.

File details

Details for the file quanttape-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: quanttape-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for quanttape-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 5da6c5e59977dc39e97bc049512c2124dd02e07a16473e8a474ec3d8a33d6296
MD5 f4800f7889f582fc4aa28aabb393b738
BLAKE2b-256 7c8d9da71a460284cd90e864232460a3a8f8d85ef48559b47d56ca788d389f50

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