Skip to main content

Security & Trust

Tradewink stores broker API keys for users who connect a paper or sandbox broker account for Paper Autopilot. Public subscriptions are paper-only; separately approved private beta accounts may submit live broker orders. Here's exactly how we protect your data.

In short: your broker API keys are encrypted at rest with Fernet (AES-128-CBC) using PBKDF2-derived keys, never stored or logged in plaintext, and decrypted only transiently in memory. Authentication runs on Clerk-issued RS256 JWTs verified against rotating JWKS keys, and public API and WebSocket traffic is encrypted in transit over TLS. Tradewink does not hold your money, and its code has no withdrawal or transfer path.

Encrypted at Rest
Encrypted in Transit
30,000+ Tests
Non-Custodial

Broker Key Encryption

Your broker API keys are encrypted at rest using Fernet symmetric encryption with PBKDF2-derived keys.

  • AES-128-CBC encryption via Fernet (Python cryptography library)
  • PBKDF2-HMAC-SHA256 key derivation with 600,000 iterations
  • New key records are encrypted with a unique random salt per record; older records that used a shared static salt are being re-encrypted
  • Keys are never persisted in plaintext in the database or logs
  • Decryption happens transiently in application memory only when needed for broker API communication

Data Protection

Public API traffic is encrypted in transit, and the database and stored broker keys are encrypted at rest.

  • TLS for public API and WebSocket connections
  • PostgreSQL database hosted on Neon, which encrypts stored data at rest (AES-256); application connections to it use TLS
  • Application logs pass through a structlog SanitizingProcessor that strips API keys, tokens, and secrets
  • The Discord bot token and the service credentials of Fly.io apps are stored as encrypted Fly.io secrets

Infrastructure

Production runs on managed cloud services.

  • Fly.io hosting on isolated Firecracker microVMs, not shared containers
  • Neon Serverless Postgres with point-in-time recovery and daily snapshots
  • PostHog error tracking that scrubs secrets and email addresses before events are sent
  • Axiom log aggregation of the same sanitized application logs
  • Deployments run through Buildkite CI/CD from a tagged release

Access Controls

Access controls at the sign-in, role, and per-user data layers.

  • Clerk authentication with RS256 JWT tokens, verified against rotating JWKS keys
  • JWKS-based token verification — no shared secrets between services
  • Role-based access control for admin vs. user operations
  • Per-user data isolation — each user can only access their own keys, strategies, and trades
  • Rate limiting on authentication, key-submission, and service API endpoints
  • CORS restricted to tradewink.com origins for authenticated endpoints (public read-only API excepted)

Trading Safety

Multiple layers of protection keep automation on paper and within the limits you set.

  • Public subscriptions are paper-only; separately approved private beta accounts may submit live broker orders. Broker connections are limited to paper or sandbox accounts
  • Paper Autopilot is off by default and runs only after you turn it on
  • Daily loss limits and circuit breakers halt Paper Autopilot during drawdowns
  • Maximum open position limits and sector concentration checks
  • Paper or sandbox account buying power and margin checks keep simulated entries within account capacity
  • Trade actions (entry, exit, fill, cancellation, and rejection) write audit log entries. Most audit writes are best-effort: a failed database write is reported to error tracking, and that entry can be missing
  • Per-user broker resolution — your keys are never mixed with another user's

Network Security

Network-level protections guard against unauthorized access and attacks.

  • Edge TLS with automatically managed certificates
  • Database access over TLS to a managed Postgres provider
  • Signed inbound webhooks from Stripe, Clerk, and the inbound-email provider are verified before processing and refused when the signing secret is unset. TradingView alerts cannot be signed, so each user gets a secret webhook URL token instead
  • A static egress IP on the trading service, so a broker gateway can restrict connections to Tradewink

Code Quality & Testing

Automated tests and code-quality checks run in CI.

  • 30,000+ Python test functions across 800+ test files, plus frontend unit and end-to-end suites
  • CI test suite runs against PostgreSQL (SQLite supported for local development)
  • Config-to-schema field mappings validated at CI time
  • Ruff lint and format checks, ty type checks on trading and core code, and pip-audit dependency scanning run in CI as advisory checks that report failures without blocking a merge

Read the Code

Security claims are cheap. Code is not.

The Tradewink codebase is MIT-licensed — more than 500,000 lines of application Python, backed by 30,000+ test functions. The repository is currently private, so we will not pretend you can click through to it today: it is source-available on request. Email support@tradewink.com to request review access. These are the exact files we point reviewers to first:

Per-user broker key encryption

tradewink/trading/user_keys.py

Fernet (AES-128-CBC) encryption with PBKDF2-HMAC-SHA256 key derivation and a unique random salt per stored record. Records written before per-record salts were introduced used a shared static salt and are being re-encrypted to the per-record format. This is the file that decides whether your broker keys are safe.

Risk circuit breakers

tradewink/trading/risk_manager.py

Daily loss limits, maximum open position limits, sector concentration checks, the circuit breaker that halts trading during drawdowns, and broker-reported buying-power and intraday-margin checks.

Position sizing

tradewink/trading/position_sizer.py

Risk-based, ATR-based, and half-Kelly sizing where the most conservative answer wins — the discipline layer that decides how much of your account a single trade can touch.

Research methodology

docs/research/algo-improvement-research-prompt.md

The working document behind our improvement loop. Its rules say new capabilities ship behind a default-off feature flag, bug fixes ship with a regression test, and a merge must not change live trading behavior.

Why this matters: Tradewink is non-custodial by architecture, not by promise — the code that encrypts your keys, caps your risk, and sizes your positions is specific, inspectable Python, and we would rather show it to you than ask you to take a comparison table on faith. Honest system history lives on our status page, including full incident writeups.

Security & Trust FAQ

How are my broker API keys stored?+

Your broker API keys are encrypted at rest using Fernet symmetric encryption (AES-128-CBC) with PBKDF2-HMAC-SHA256 key derivation at 600,000 iterations and a unique random salt per stored record. Records created before per-record salts were introduced were encrypted with a shared static salt and are being re-encrypted to the per-record format. Keys are never persisted in plaintext in the database or logs, and are decrypted only transiently in application memory when needed for broker API communication.

Can Tradewink withdraw my funds?+

Tradewink does not hold your money, and its code has no withdrawal or transfer path: the broker base class rejects any integration that defines a deposit, withdrawal, or fund-transfer method. Tradewink does not yet check what permissions a connected exchange API key carries, so create keys with trading permission only and withdrawals turned off. Public subscriptions and their broker connections are paper or sandbox only; separately approved private beta accounts may submit live broker orders. Per-user broker resolution means your keys are never mixed with another user's, and each user can only access their own keys, strategies, and trades.

What encryption does Tradewink use?+

Broker keys use Fernet (AES-128-CBC) with PBKDF2-HMAC-SHA256 key derivation. Public API and WebSocket connections use TLS. The PostgreSQL database is hosted on Neon, which encrypts stored data at rest with AES-256, and the application connects to it over TLS.

How does Tradewink authenticate users?+

Tradewink uses Clerk authentication with RS256 JWT tokens verified against rotating JWKS keys, with no shared secrets between services. Role-based access control separates admin and user operations, and rate limiting is applied to authentication, key-submission, and service API endpoints.

What stops the system from runaway trading?+

Public subscriptions are paper-only; separately approved private beta accounts may submit live broker orders. Paper Autopilot is off until you turn it on, and daily loss limits plus circuit breakers halt it during drawdowns. Maximum open position limits and sector concentration checks add further guardrails.

Can I audit Tradewink's source code?+

The Tradewink codebase is MIT-licensed. The repository is currently private, so it is source-available on request rather than fully public — email support@tradewink.com to request review access. The files we point reviewers to first are the per-user broker key encryption (tradewink/trading/user_keys.py), the risk circuit breakers (tradewink/trading/risk_manager.py), and position sizing (tradewink/trading/position_sizer.py).

Responsible Disclosure

If you discover a security vulnerability in Tradewink, please report it responsibly. Email support@tradewink.com with details and we will respond within 48 hours. Please do not publicly disclose the vulnerability until we have had an opportunity to address it. We appreciate security researchers who help us keep our users safe. The same contact is published in our security.txt.

Start Trading Securely

Your broker keys are encrypted from the moment you enter them. Free to start, no credit card needed.

Start free