Security

Lagniappe is installed as your own App Engine application inside your own Google Cloud project, paired with your own Redis Cloud database. There is no centralized Lagniappe SaaS control plane, shared tenant database, or licensing service that can inspect your workspace.

The core security rule is straightforward: the browser is an untrusted client, and the server is the authority. Access checks happen on the server before records, search results, files, or AI context are assembled.

Protection at a Glance

Server-Enforced Access

Every route checks authentication and permissions on the server before rendering HTML or returning data. Frontend code hides unavailable controls for clarity, never as a security boundary.

Your Cloud, Your Data

Datastore, Cloud Storage, App Engine, Identity Platform, Cloud Tasks, and optional Vertex/Document AI stay in your Google Cloud project; Redis data stays in your Redis Cloud subscription.

Isolated Secrets

Runtime credentials can live in Google Cloud Secret Manager (lagniappe-runtime-secrets). During AI-guided setup, a one-shot local browser vault sends keys straight to Secret Manager so they never enter chat history or local files.

Bounded AI & Agents

Connected AI agents inherit the signed-in user’s exact permissions and propose reviewable Plans instead of mutating records directly. Interactive HTML artifacts preview in a locked-down sandbox.

Running directly in your own cloud removes an extra third-party SaaS layer, while keeping shared responsibility clear: Google Cloud and Redis Cloud secure the underlying platforms, and you control account access, optional integrations, and database security settings.

Client and Server Split

Lagniappe uses server-rendered pages with lightweight JavaScript widgets layered on top. Private records are never shipped to the browser for the frontend to filter later—the server decides what a user may see once, before sending the response, so client-side code cannot drift out of sync with real permissions.

  • Permission checks happen before rendering. Protected routes verify the current user and requested action before returning pages, partials, or JSON.
  • Search, filters, and files respect access. Restricted records are omitted from rendered pages, search results, filter results, file downloads, and direct route lookups.
  • Mutations go through server routes. Forms, uploads, task changes, permissions, and settings changes require server-side CSRF and permission verification.
  • User content is sanitized and isolated. Rich-text documents and HTML answers are sanitized on the server before rendering, and interactive HTML artifacts run inside a sandboxed preview that cannot access your Lagniappe session.
  • Cached views stay verifiable. ETag fingerprints and service-worker invalidation headers prompt browsers to refresh stale private views after permission or content changes.

App Protections

HTTP and Browser Policy

  • Defensive login cookies. Session cookies travel over HTTPS, resist JavaScript access, and limit cross-site sending. See MDN’s secure cookie guide.
  • Anti-forgery (CSRF) protection. State-changing requests require valid CSRF tokens so another site cannot trick a signed-in browser into submitting actions. See MDN’s CSRF overview.
  • Browser security headers. Responses include HSTS for HTTPS enforcement, clickjacking and MIME-sniffing protections, referrer limits, and cache rules.
  • Narrow Content Security Policy (CSP). By default, scripts and assets load only from your instance, with explicit allowances for the Google, Sentry, and YouTube no-cookie endpoints used by the app. See MDN’s CSP guide.

Auth, Webhooks, and Internal Work

  • Strict login token verification. Identity Platform tokens are verified against the exact Google Cloud project, issuer, and user before starting a Lagniappe session.
  • Login hardening. Google sign-in verifies its anti-forgery token, login routes rate-limit repeated attempts, and post-login redirects are validated before forwarding.
  • Authenticated background jobs. Cloud Tasks callbacks must present a Google-signed identity token from the expected internal service account before worker routes run.
  • Verified inbound email webhooks. When optional inbound AI Email is enabled via Resend, incoming webhooks are verified with cryptographic Svix signatures and matched against an authorized Lagniappe user account before processing.

AI, External Agents, and Artifacts

Whether you use built-in AI tools, scheduled automations, or an external assistant connected over MCP/API, Lagniappe applies the same user permission boundaries as the web interface.

  • User-scoped agent authentication. External agents authenticate on behalf of a specific Lagniappe user and see only the categories, pages, tasks, and files that user is allowed to access. They cannot bypass page or form restrictions or act as an Administrator unless that user is one.
  • Reviewable Plans before changes run. AI tools and external agents build structured Plans showing every proposed change. By default, changes wait for explicit user review and approval before executing, and individual actions can be skipped.
  • Sandboxed interactive HTML artifacts. HTML artifacts attached to a page preview inside a sandboxed <iframe> paired with a strict artifact CSP (default-src 'none', form-action 'none', Referrer-Policy: no-referrer, and no allow-same-origin). Scripts inside an artifact run in an isolated opaque origin and cannot read Lagniappe cookies, call your API routes, or send data to external servers.

Owner, Administrators, and Installation Secrets

Lagniappe has one configured primary Owner and may have additional Administrators. Administrators can manage ordinary Site Settings, users and groups, ingress, content, and exports. AI provider entitlement is granted separately per user.

Only the Owner can change the Administrator roster, edit or delete Administrator accounts, protect the canonical Owner account, or view and download installation configuration. Because that configuration can reference Redis passwords, API keys, SMTP/Resend credentials, and recovery material, the Maintenance / Configuration controls are neither rendered nor permitted on the server for other Administrators.

Runtime secrets can be stored in Google Cloud Secret Manager (lagniappe-runtime-secrets) so local config files contain only non-secret settings. When installing or updating with an AI assistant (./setup.sh --agent), credentials are entered in a one-shot local browser vault on 127.0.0.1 that writes directly to Secret Manager—keeping passwords, API keys, and TLS bundles out of AI chat history and local disk. File-based installs can move to Secret Manager anytime with ./setup.sh secrets migrate.

During a delegated installation, one exact saved installer email may use Google sign-in to create a temporary application Administrator only until the primary Owner’s first successful login. That email is never shown on the login page, Owner sign-in permanently closes automatic creation, and the handoff deploy clears the saved bootstrap value before removing the installer’s cloud access.

Google Cloud Boundary

In production, Lagniappe runs on the App Engine standard environment. Google manages the underlying servers, isolates instances in the standard sandbox, and terminates HTTPS before traffic reaches the app; Lagniappe sends HSTS headers so browsers enforce HTTPS on future visits (MDN HSTS reference). Google Cloud encrypts stored data at rest by default and protects internal cloud traffic in transit.

Datastore

Firestore in Datastore mode stores Lagniappe records and metadata as a fully managed, encrypted-at-rest Google Cloud database. Datastore overview.

Cloud Storage

Uploaded files, generated assets, and backups live in Cloud Storage buckets with server-side encryption at rest and authorized reads. Cloud Storage encryption.

Redis Cloud Boundary

Lagniappe uses Redis Cloud for search indexes, filters, cache entries, rate limits, active viewer state, and live collaboration sync. Redis is not the long-term database, but it holds real operational data—names, search text, and workflow state—so protect it accordingly.

Think of Redis TLS as HTTPS for the server-to-server link between App Engine and Redis Cloud: the password controls who may connect, while TLS encrypts the connection carrying that password and your application data and verifies the Redis server’s identity.

  • Server-side only: Lagniappe connects to Redis from App Engine, keeping Redis credentials out of browsers.
  • Encryption at rest & in transit: Redis Cloud supports encryption at rest, and paid Essentials/Flex and Pro plans support database TLS (Free Essentials plans do not). Lagniappe supports verified server TLS during setup or via ./setup.sh security.
  • Shared responsibility & network controls: Redis Cloud operates the service while you choose the plan, credentials, and network controls—such as CIDR allow lists, public-endpoint blocking (Pro), or Private Service Connect—based on your risk tolerance.
Use ./setup.sh security (or .\setup.cmd security on Windows) or ask your AI setup assistant to enable, refresh, or disable Redis TLS. You can upload the downloaded Redis Cloud certificate ZIP or redis_ca.pem directly through the local browser vault (stored in Secret Manager) or place it at config/files/redis_ca.pem. Setup verifies the certificate and hostname before redeploying. Leave mutual TLS client certificates unchecked (not currently supported).

Redis Cloud references: shared responsibility, encryption at rest, TLS, public endpoint blocking, CIDR allow lists, and Private Service Connect.

Optional Data Flows

Everything below is opt-in. Your installation only sends data to these services when you configure and enable them:

  • Auth & inbound AI email (Resend / Gmail SMTP): When configured, sign-in links and password resets travel through your chosen email provider. If inbound AI Email is enabled via Resend, messages sent to your inbound address are verified via webhook signature and matched to a Lagniappe user before generating a Plan.
  • AI and OCR (Vertex AI / Document AI): Receive only the prompts, documents, images, or workspace context needed for the AI or OCR action a user triggers. External MCP/API agents receive only the data their authenticated user is permitted to read.
  • Error reporting (Sentry): Disabled unless enabled during setup. You may send privacy-reduced reports to the maintainer or supply your own Sentry DSN. Default backend PII collection is off, though diagnostic context (URLs, endpoints, or metadata) can still be attached. Review the maintainer error-reporting privacy notice before enabling the default destination.
  • Analytics & AI generation observability: Optional Administrator-only analytics records authenticated page paths and visit metadata. Optional default-off AI_OBSERVABILITY logs high-level generation timing/usage metrics only—excluding prompts, outputs, tool arguments, file contents, and entity IDs—with activity-driven cleanup of records older than 30 days.
  • Browser storage: The service worker caches app responses for speed and offline support, and clears cached private responses when the server signals permission or content changes.
Treat every optional integration as part of your privacy boundary: if a record contains sensitive information, assume it can pass through any external provider (AI, email, or diagnostics) that a feature sends it to.

Owner Checklist

  • Protect your Google Cloud account with strong 2-step verification and keep a tested recovery path for the project.
  • Grant Owner and Administrator access sparingly, and review user groups and connected external agents when roles change.
  • Store runtime secrets in Google Cloud Secret Manager and keep any local config files or recovery downloads out of public repositories.
  • Verify public pages, public files, public permissions, and group restrictions from a non-owner account.
  • Enable only the optional data flows (email, AI/OCR, error reporting, analytics, AI_OBSERVABILITY) that fit your privacy requirements.
  • Enable Redis TLS if your Redis Cloud plan supports it, and treat Redis cache/search data as sensitive operational data.