> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Security

> How vly secures your data, secrets, and accounts. Encryption, access control, isolation, audit logs, compliance — and what you can do on your side.

Security at vly works at three layers: the **platform** (vly's infrastructure), the **runtime** (how your app handles data), and the **practice** (the workflows your team follows). This page is the executive overview; the rest of this section deep-dives each topic.

## What vly does for you

<CardGroup cols={2}>
  <Card title="Encryption at rest and in transit" icon="lock">
    All data in Convex's managed database is encrypted at rest with AES-256. All API and admin traffic uses TLS 1.3.
  </Card>

  <Card title="Secrets isolation" icon="key">
    API keys and other secrets live in vly's secrets store, scoped per environment, never exposed to client code. See [Secrets management](/security/secrets-management).
  </Card>

  <Card title="Per-tenant isolation" icon="building">
    Each workspace's data is logically isolated. The Convex query layer prevents cross-tenant reads.
  </Card>

  <Card title="Audit logs" icon="scroll-text" href="/security/audit-logs">
    Every meaningful action — sign-in, settings change, API call — is logged. Available for export.
  </Card>

  <Card title="DDoS protection" icon="shield-check">
    Edge-level rate limiting and DDoS mitigation on every vly-served endpoint.
  </Card>

  <Card title="Backups" icon="database-backup">
    Convex maintains continuous backups; point-in-time restore available on Business+ tiers.
  </Card>
</CardGroup>

## What your app should do

The platform handles infrastructure security. Application-level security — input validation, access control, secrets handling in your custom code — is yours.

<CardGroup cols={2}>
  <Card title="Validate input at the boundary" icon="check-circle" href="/security/input-validation">
    Convex schema validators catch most bad data; for business rules, validate inside mutations.
  </Card>

  <Card title="Scope every query to the user" icon="users" href="/security/data-access-control">
    Use `ctx.auth.getUserIdentity()` and filter on the user's workspace / team. The default vly-generated code does this; preserve it.
  </Card>

  <Card title="Never expose secrets to the client" icon="eye-off" href="/security/secrets-management">
    Anything in `process.env` is server-only. Anything starting with `VITE_` is client-visible — only public keys belong there.
  </Card>

  <Card title="Rate limit user-facing actions" icon="gauge" href="/security/rate-limiting">
    Login attempts, sign-up, password reset, API endpoints exposed to the public — all need rate limits.
  </Card>

  <Card title="Sanitize and escape" icon="paintbrush" href="/security/xss-csrf">
    React handles most XSS by default. For raw HTML or user-generated markdown, use a sanitizer. CSRF is handled by built-in auth.
  </Card>

  <Card title="Audit-log meaningful actions" icon="scroll-text" href="/security/audit-logs">
    Beyond vly's platform audit log, your app should log domain-meaningful actions (sent invoice, deleted account, ran agent on production).
  </Card>
</CardGroup>

## Threat model

The threats vly's platform defends against:

| Threat | How it's mitigated |
| - | - |
| Unauthorized access to your data | Workspace-scoped auth; per-tenant isolation; encryption at rest |
| Stolen API key abuse | Rate limiting per key; instant revocation; audit log |
| DDoS / brute-force | Edge rate limiting; Convex's built-in attack mitigation |
| Data loss | Continuous Convex backups; multi-region replication |
| Supply chain (malicious npm package) | Locked dependencies; vly reviews dependency updates before they ship |
| Insider risk | Access logs for vly staff; SOC 2 controls (in progress) |
| Code injection | TypeScript + Convex schema validation; default React XSS protections |

For application-level threats (XSS, CSRF, SQLi-equivalent in Convex, IDOR), see the linked deep-dives below.

## Compliance

<CardGroup cols={2}>
  <Card title="GDPR" icon="globe">
    Customer data export and deletion supported via [Data export](/security/data-export) and [Account deletion](/security/account-deletion). DPA available on request.
  </Card>

  <Card title="SOC 2 Type II" icon="check-circle-2">
    Audit in progress; report available to Enterprise customers. Email [security@vly.ai](mailto:security@vly.ai) for status.
  </Card>

  <Card title="HIPAA" icon="heart-pulse">
    Not currently supported. If you need HIPAA, contact [enterprise@vly.ai](mailto:enterprise@vly.ai) about timing.
  </Card>

  <Card title="ISO 27001" icon="award">
    Roadmap.
  </Card>
</CardGroup>

## Reporting a security issue

If you've found a security vulnerability:

1. **Do not** file a public issue or post on social media.
2. Email [security@vly.ai](mailto:security@vly.ai) with details.
3. We'll acknowledge within 24 hours and work with you on disclosure timing.

We follow [coordinated disclosure](https://en.wikipedia.org/wiki/Coordinated_vulnerability_disclosure). Researchers acting in good faith are eligible for our [bug bounty program](mailto:security@vly.ai) — email for details.

## Security checklist for production apps

Before launching a vly app to real users:

* [ ] All third-party API keys live in vly's secrets store (not in code, not in `VITE_*`).
* [ ] All Convex queries scope by `ctx.auth.getUserIdentity()`.
* [ ] All Convex mutations validate input via the schema validators (`v.string()`, `v.number()`, etc.).
* [ ] User input rendered as raw HTML is sanitized (use [DOMPurify](https://github.com/cure53/DOMPurify) or similar).
* [ ] Login, signup, and password-reset endpoints are rate-limited.
* [ ] Account deletion is tested end-to-end.
* [ ] Webhook handlers verify signatures (Stripe, Resend, etc. — every integration that pushes events).
* [ ] Audit log is reviewed before launch (no surprising actions).
* [ ] DNS for the custom domain has a current SPF / DKIM / DMARC config (for email deliverability and anti-spoofing).
* [ ] Privacy policy and terms of service are linked from the app.

## Deep dives

<CardGroup cols={2}>
  <Card title="Auth best practices" icon="lock" href="/security/auth-best-practices">
    Patterns for sign-up, password reset, MFA, session management.
  </Card>

  <Card title="Secrets management" icon="key" href="/security/secrets-management">
    The secrets store: encryption, scoping, rotation, audit.
  </Card>

  <Card title="Input validation" icon="check-circle" href="/security/input-validation">
    Schema validators, business rule validation, sanitization.
  </Card>

  <Card title="Data access control" icon="users-round" href="/security/data-access-control">
    Per-user, per-workspace, per-team scoping patterns.
  </Card>

  <Card title="XSS / CSRF" icon="shield-x" href="/security/xss-csrf">
    React defaults, edge cases, when to sanitize, CSRF model.
  </Card>

  <Card title="Rate limiting" icon="gauge" href="/security/rate-limiting">
    Per-IP, per-user, per-endpoint patterns.
  </Card>

  <Card title="Audit logs" icon="scroll-text" href="/security/audit-logs">
    What's logged, where to read it, how to export.
  </Card>

  <Card title="Compliance" icon="award" href="/security/compliance">
    GDPR, SOC 2, DPAs, sub-processors.
  </Card>

  <Card title="Data export" icon="download" href="/security/data-export">
    Self-service export for users and admins.
  </Card>

  <Card title="Account deletion" icon="user-minus" href="/security/account-deletion">
    Permanent deletion, what's retained, what's purged.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.