Skip to content

Security: ruthick76/VoiceCommerce-AI

Security

docs/security.md

Security, privacy, and operational limits

Implemented boundaries

  • Typed environment settings and explicit provider opt-in; SecretStr credentials; .env/runtime data/reports excluded from Git. Demo keys are public local fixtures.
  • Bearer authentication for all business routes. Principal ownership and merchant isolation are checked before conversation or voice access. Admin functions require merchant admin privilege. Even anonymous principals have distinct token-bound owners.
  • Chroma filters both authenticated merchant and configured namespace. Customers cannot choose a namespace, merchant, customer, tool name, price, or provider URL.
  • Model outputs use bounded schemas; tools are hardcoded and read-only. Money uses Decimal with half-up cent rounding. Prompt text cannot override rule functions.
  • Retrieved text is untrusted data. Obvious instruction-like evidence is dropped; OpenAI can select only indices from existing evidence. Policy responses are extractive, so no unverified model policy claims or model-authored prices are used. This filtering is defense in depth, not a general solution for malicious documents; only trusted merchant administrators should ingest reviewed policy text.
  • Actual streamed body limits include chunked uploads. Audio signatures/frames, duration, channels, rate, and size are checked; JSON content has bounded fields.
  • Fixed upstream hosts, canonical Shopify hostname validation, parameterized GraphQL, HTTPS/TLS verification, timeouts, bounded retries, no redirects, safe upstream errors.
  • In-process bounded per-IP rate limiter (10,000 retained entries); retry-after headers. A gateway must provide distributed limits, trusted forwarding, TLS, and abuse controls.
  • Structured logs contain event names and server-generated correlation IDs only. Request text, headers, raw exception/provider bodies, customer IDs, tokens, and audio are never logged. Customer and order identifiers/tracking are omitted from tool traces. Error responses omit stack traces and submitted input.

Data handling

Raw audio is not retained by application repositories. Multipart handling may use temporary spool files managed by the framework; they are closed after the request. The request body is bounded in memory. Responses use base64 audio or no-store WAV. Conversation transcripts, answers, retrieval sources, and safe tool traces are stored in SQLite and may contain personal data supplied by the customer. Local storage is not encrypted by this application. Backups need the same access controls. There is no automated retention/erasure scheduler in this version. Operators must set an appropriate retention policy and implement scoped deletion before processing real customer data. Do not include card numbers or secrets in messages/policies.

Opting into OpenAI sends the selected audio/text/policy content to that provider; review its current retention, regional-processing, and contractual terms. Opting into Shopify uses privileged Admin API credentials and reads merchant/customer resources only within app scopes; verify those scopes and identity mappings. No real customer data, external credentials, or paid API calls were used for tests.

Production deployment work remaining

This repository supplies a cohesive local development implementation, not a production certification. Before shared deployment:

  1. Replace demo bearer tokens with a real identity service and secret rotation. Supply stable subjects and verified commerce customer mappings; enforce TLS.
  2. Add gateway/distributed rate limits, per-merchant quotas, resource budgets, and request/deadline limits. The current limiter keys immediate client IP and is neither proxy-aware nor distributed.
  3. Replace embedded persistence for multi-worker/horizontal scale. Use transactional policy publishing/version pointers and an external Chroma deployment or vector DB; add schema migrations and tested backups. This initial schema has no migration framework; do not reuse early development snapshots with incompatible schema.
  4. Add audit retention, scoped deletion, encryption, operational metrics, alerting, disaster recovery, policy review, and load/security testing.
  5. Validate live provider contracts, app scopes, supported model/API versions, failure budgets, Shopify protected-customer-data access, and production corpus embedding relevance. Controlled adapter tests are not live integration proof.
  6. Add immutable catalog/rule snapshots if historical quote replay is required. Prompt snapshots are durable, but policy content and merchant rule JSON may be updated. Current quotes are informational, not contractual checkout totals.

No inventory guarantee, checkout, payments, refunds, cancellations, discount creation, write idempotency mechanism, or automatic retry of commerce writes exists. New write operations are deliberately unavailable until separately authorized and designed.

Policy HTML/links are returned as plain text and should be escaped by any future frontend. There is no frontend, CORS relaxation, arbitrary URL fetcher, debug route, or publicly exposed development server in the default commands.

There aren't any published security advisories