Skip to main content

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

quanttape-0.0.15.tar.gz (16.2 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.15-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quanttape-0.0.15.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quanttape-0.0.15.tar.gz
Algorithm Hash digest
SHA256 62108d01153ed018f5b0e008154ffdd9d113a3dc9337c0f231aeb354f9e029b5
MD5 9e1fa191188dd06e824fcf3c5b45860c
BLAKE2b-256 259ce78a9ade7a0a5988e41c24e9b6cd734040eb3cb294a6eb159302acd3b6c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for quanttape-0.0.15.tar.gz:

Publisher: publish.yml on quanttape/sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: quanttape-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for quanttape-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 a78c08e26f3fbae556ac0a903cef086e6b90945be93febfc7317a5a361ed201e
MD5 8f0c41dfe28299227cad431d042bc836
BLAKE2b-256 0159066c483541cef76b990d3eb5c554aae7ea106de962448904f35edd4fa116

See more details on using hashes here.

Provenance

The following attestation bundles were made for quanttape-0.0.15-py3-none-any.whl:

Publisher: publish.yml on quanttape/sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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