Authentication & Authorization
NextAuth.js handles user authentication with support for:- Email/password (default)
- SSO providers: Azure AD, Okta, Auth0, AWS Cognito, Google, GitHub, GitLab
- Organization-level roles (owner, admin, member)
- Project-level permissions
API_TOKEN_JWT_SECRET) for SDK authentication.
Encryption
At Rest
The
CREDENTIALS_SECRET environment variable is used to encrypt API keys and credentials stored in PostgreSQL (e.g., LLM provider keys configured in the UI). This is application-level encryption on top of database-level encryption.
In Transit
Secrets Management
Development (Auto-Generated)
For development, enableautogen.enabled: true in the Helm chart. This generates random secrets automatically. Not suitable for production, secrets change on reinstall.
Production (Kubernetes Secrets)
Create secrets manually and reference them in the Helm chart:values.yaml:
Production (External Secret Managers)
For tighter security, use an external secrets operator to sync secrets from your cloud provider:- AWS Secrets Manager: via External Secrets Operator
- HashiCorp Vault: via Vault Secrets Operator
- Azure Key Vault: via Azure Key Vault Provider
secretKeyRef pattern works with any Kubernetes Secret, regardless of how it was created.
Network Security
Recommended Network Architecture
- Only the LangWatch App should be exposed externally via Ingress or Load Balancer
- All other components (Workers, NLP, LangEvals, PostgreSQL, ClickHouse, Redis) should be on internal networks only (ClusterIP services)
- Place databases in private subnets with no internet access
- Use VPC endpoints, PrivateLink for S3 access
Kubernetes Network Policies
Restrict traffic between pods:Firewall Rules
Pod Security
The Helm chart applies secure defaults to all pods:- No containers run as root
- No privilege escalation is possible
- Containers cannot modify their own filesystem
- All Linux capabilities are dropped
PII Redaction
LangWatch includes a built-in PII redaction pipeline step that automatically detects and masks personally identifiable information in traces before storage.- Enabled by default in the Helm chart
- Disable with
app.features.disablePiiRedaction: true(not recommended) - Runs as part of the event sourcing pipeline in workers
Multitenancy
LangWatch enforces tenant isolation at the application level:- Every ClickHouse query includes
WHERE TenantId = ...as the first predicate - PostgreSQL queries include
projectIdin WHERE clauses - API tokens are scoped to a specific project
- Cross-tenant data access is prevented at the query layer
Supply Chain
LangWatch container images and CLI packages are published with verifiable supply-chain attestations so operators can confirm an artifact was built by LangWatch CI from a specific source commit.Container images (Docker Hub)
Every release oflangwatch/langwatch, langwatch/langwatch_nlp, langwatch/langevals, and langwatch/ai-gateway is signed with Sigstore cosign using keyless OIDC. Both the multi-arch index manifest and each per-platform manifest (linux/amd64, linux/arm64) are signed by digest. A CycloneDX SBOM is generated per platform and attached as a cosign attestation against the matching platform manifest digest, so the SBOM you verify always corresponds to the architecture you actually pulled.
Verify a signature with cosign:
*.cdx.json files (e.g. langwatch-linux-amd64.cdx.json, langwatch-linux-arm64.cdx.json) are also attached to each langwatch@vX.Y.Z GitHub release.
npm CLI
Thelangwatch npm package is published with npm provenance attestations via GitHub Actions OIDC, also backed by Sigstore. The provenance link is visible on the package page and can be verified with npm audit signatures.
Production Hardening Checklist
-
autogen.enabled: false, use manually created secrets - All secrets stored in a secrets manager (not inline in values.yaml)
- TLS enabled on Ingress (HTTPS only)
- Database connections use TLS (
?sslmode=require) - PostgreSQL, ClickHouse, Redis in private subnets (no public access)
- Network policies restrict pod-to-pod traffic
- S3 buckets have public access blocked
- ClickHouse backups enabled and tested
- Monitoring and alerting configured
- Secret rotation procedure documented
- Pod security contexts verified (non-root, read-only filesystem)
- Ingress rate limiting configured
- Audit logs enabled (Enterprise)
- Image signatures verified at pull time (admission controller or
cosign verifyin CI)