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.16.tar.gz (17.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.16-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quanttape-0.0.16.tar.gz
  • Upload date:
  • Size: 17.5 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.16.tar.gz
Algorithm Hash digest
SHA256 923f7e829a6d310e016f7e910630ddb730a1cf968967661618bed1d11d75581b
MD5 e92dc9ff71e51f85b250a427b895e377
BLAKE2b-256 49f541030734028172a7154c10e64cc0044f0a0504dd891531a44b12656c5a9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for quanttape-0.0.16.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.16-py3-none-any.whl.

File metadata

  • Download URL: quanttape-0.0.16-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

Hashes for quanttape-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 2966ab225c5f5ccadc09f27ad4e5842090c13e56da53efa8d32ce7d597ca69ed
MD5 51345c154e2d6b00a4894718a2678028
BLAKE2b-256 396e7edc3f347497c75e1a8f77ab2b8e14fbc7b96f90355813364c6537fdbb7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for quanttape-0.0.16-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