โ† Back to SmashCost

Security

Last updated June 22, 2026  ยท  Questions? support@smashcost.com

SmashCost sits in the critical path of your AI requests. This page describes the main controls we use to protect your data and API keys, without exposing operational details that could weaken the system. Key security controls are covered by automated tests that run on every code change.

๐Ÿ”‘Provider API keys โ€” encrypted at rest

Your provider API keys (OpenAI, Anthropic, Groq, Google) are encrypted with industry-standard symmetric encryption before being stored. The encryption key is never stored alongside the data โ€” it lives in a separate secure environment variable and is required at startup. Keys are decrypted in memory only for the duration of a single request.

๐Ÿ™ˆPrompts and responses โ€” never stored, never logged

SmashCost uses a bring-your-own-keys (BYOK) model. Requests are forwarded directly to your configured providers. We store only request metadata for cost and routing analytics: model name, token counts, latency, routing decision, and cost. The content of your messages is never written to our database.

As a defense-in-depth measure, application logs are scrubbed for fields commonly associated with prompt or response content. Records containing those fields are redacted before emission, reducing the chance of accidental content leakage.

Automated tests cover the logging protections so normal metadata remains useful while prompt and response content stays out of logs.

๐Ÿ”’Data in transit โ€” TLS enforced

All production traffic between clients and SmashCost is served over HTTPS with TLS 1.2+. Connections to upstream AI providers are made over HTTPS with certificate validation enabled, and production responses include HSTS.

๐ŸชชAuthentication and session security

Dashboard sessions use cryptographically signed cookies with a secret key required at startup. Cookies are HttpOnly and Secure in production.

Passwords are hashed with bcrypt. The plaintext password is never stored or logged.

Gateway access uses API keys stored as one-way hashes. The raw key is shown to the user once at creation and is never retrievable again.

The admin panel requires two independent credentials at login: a server-side secret and a time-based two-factor code. After login, the browser receives a short-lived signed HttpOnly cookie โ€” credentials are not stored in the browser or sent with every admin request.

State-changing requests that rely on session cookies are protected with a same-origin check in production. Cross-site requests with a missing or untrusted origin are rejected before reaching application handlers.

๐Ÿ”Session isolation โ€” scoped by organization

Routing decisions cached per session are always scoped to the organization that made the request. Two organizations using the same session identifier cannot share or observe each other's routing state. This property is verified by automated tests that assert distinct cache keys for distinct organizations and stable keys for the same organization across calls.

๐ŸšฆRate limiting

Each organization is subject to rate limits enforced before the request reaches any upstream provider. Limits apply at the organization level โ€” rotating or creating additional API keys does not increase the allowed request rate.

๐ŸชWebhook integrity โ€” HMAC-SHA256

Paddle billing webhooks are verified using HMAC-SHA256 signature checking against a shared secret. Requests with missing or invalid signatures are rejected with HTTP 401 before any processing occurs.

๐Ÿ›กHTTP security headers

Every response includes security headers enforced via server-side middleware:

๐ŸŒCORS policy

In production, cross-origin requests are restricted to smashcost.com and www.smashcost.com. Only the specific headers required by the gateway are permitted.

โšกProvider circuit breaker

SmashCost uses provider health controls to reduce the blast radius of upstream outages. When a provider or model becomes consistently unavailable, eligible traffic can be shifted to fallbacks instead of repeatedly hitting a failing route.

๐Ÿ”Routing records and savings integrity

Every request records exactly how the model was selected: classifier-driven routing, session cache, client override, or passthrough. The unit prices used to compute cost are frozen at request time and stored with the log entry, so the savings calculation is always reproducible without depending on current price tables.

Override requests are excluded from savings calculations. When a client specifies a model manually, no cost delta is attributed to SmashCost's routing. The savings report only counts decisions made by the router, preventing inflated figures.

๐Ÿ‘Shadow routing โ€” observable before commitment

During the free observation period, SmashCost operates in pure passthrough mode: your traffic is forwarded using the exact model you requested, with no substitutions. Simultaneously, the gateway computes โ€” in memory, with no extra latency โ€” what models would have been selected and stores projected costs in the request log.

This gives you a reproducible record of what SmashCost would have done before you commit to enabling routing. The observation guarantee is tested explicitly: the real request always uses your original model โ€” SmashCost never substitutes a model while in shadow mode.

๐Ÿ“‹Audited security events

Security-relevant actions are recorded with timestamps and actor context, including API key creation and revocation, provider configuration changes, invites, member removal, and admin actions. These records support incident review without storing prompt or response content.

When a member is removed from an organization, active API keys created by that member for that organization are revoked in the same transaction as the membership change.

๐Ÿ—“Free observation โ€” no automatic cutoff

Free observation is designed to be low-risk: requests remain in passthrough mode until routing is explicitly activated. There is no automatic observation-window cutoff that blocks gateway traffic.

๐Ÿ“กStreaming โ€” same privacy guarantees

SmashCost supports Server-Sent Events (SSE) streaming on supported routes. The streaming path has the same storage policy as the non-streaming path: message content in SSE chunks is never written to logs, the database, or error messages. Only usage metadata โ€” such as token counts and latency โ€” is captured at the end of the stream for cost calculation when available.

๐ŸคShared responsibility model

SmashCost's security controls cover the gateway layer. Certain responsibilities remain with you as the customer. Understanding this boundary prevents misunderstandings about what SmashCost does and does not protect.

SmashCost is responsible for You are responsible for
Gateway security โ€” authentication, rate limiting, session isolation, CSRF protection Security of your SmashCost account credentials and session
Encryption of your provider API keys at rest and in transit Security of your AI provider accounts and billing
No-prompt-storage policy โ€” content never written to logs or database Content of prompts and what you send to AI providers
Routing integrity and savings accuracy Compliance with each provider's acceptable use policy
HMAC-verified webhook processing Application security of systems that call the SmashCost gateway
Security of our infrastructure (Railway hosting, database) Keeping your API keys rotated and revoked if compromised

SmashCost cannot protect against: compromise of your own systems or credentials; actions taken by third-party AI providers; or events outside our infrastructure boundary.

Responsible disclosure

If you discover a security vulnerability in SmashCost, please report it to us privately before disclosing it publicly. We aim to acknowledge reports within 48 hours and resolve confirmed issues promptly.

Email: support@smashcost.com
Subject line: [Security] <short description>

We do not currently operate a bug bounty program, but we genuinely appreciate responsible disclosures and will acknowledge your contribution publicly if you wish.