Skip to content

Security: ComradeJhonConnor/RenPyStoryArchitect

Security

SECURITY.md

Security Policy

Reporting a vulnerability

If you discover a security vulnerability, please report it privately through GitHub's Report a vulnerability feature.

  1. DO NOT open a public GitHub issue.
  2. Open the repository's Security tab.
  3. Choose Report a vulnerability.
  4. Include a description of the vulnerability, affected functionality, and steps to reproduce when possible.

Please avoid including secrets, API keys, private project files, or other sensitive data unless they are strictly necessary to explain the issue.

We will acknowledge the report as soon as reasonably possible and coordinate fixes and disclosure through GitHub Security Advisories when appropriate.

Security model

AI secrets

  • The browser never stores or requests a secret provider API key.
  • The browser never holds a NEXT_PUBLIC_* secret.
  • The browser never holds a bearer token, session token, or any other Authorization-shaped credential.
  • Direct mode sends only Content-Type: application/json. No Authorization header is ever sent from the browser.
  • The same-origin server proxy reads STORY_ARCHITECT_AI_* env vars server-side only. The key never appears in client bundles, responses, or logs.
  • The browser cannot choose the server-proxy upstream URL — it is server configuration only.
  • The /api/ai/status endpoint returns only enabled, model, and provider. It NEVER returns the API key or the full upstream URL.
  • Server-proxy error responses NEVER echo the upstream URL, host, Authorization header, or API key. Verbatim upstream error bodies and fetch error messages are logged server-side only.

⚠️ Public deployment warning

Do not expose a same-origin proxy backed by a paid API key on a public deployment unless you add authentication, rate limiting, and usage controls. Otherwise anonymous visitors may consume the server owner's provider quota.

The Public Alpha repository ships the proxy code, but a hosted demo should keep it disabled unless protected.

AI proposals

  • AI output is treated as untrusted. Every proposal is validated before apply:
    • Scene patches must target blocks inside the user's selection.
    • originalText must match the current source text (stale detection).
    • Continuation characterIds must exist in the request's character set.
    • Translation unitId + languageId must match the request.
    • Text length limits are enforced.
  • AI proposals are previewed as a diff before apply.
  • AI cannot mutate the project without explicit user acceptance.
  • Accepted AI changes go through the normal undo/redo history (one undo entry per accepted proposal).
  • AI translations are always saved as draft; AI cannot approve or review its own output.

Source files

  • Your .rpy files are never modified. Story Architect is read-only with respect to imported source.
  • Application-owned overrides (title, kind, description, route, stage, groups, tags, canvas) are stored in the Project Document, not in source files.

Browser storage

  • Project documents persist to browser localStorage.
  • AI settings persist to browser localStorage (mode, baseUrl, model, timeout preferences). NO API key, bearer token, or any other credential is ever stored. Historical localStorage payloads containing a bearerToken field from older versions are silently discarded on load.
  • Clearing browser data deletes all saved projects and settings.

Network

  • The app runs entirely in your browser by default.
  • The only network requests are:
    • Same-origin requests to /api/ai/* (only when AI proxy mode is enabled).
    • Same-origin requests to /api/translate/free — the keyless free machine-translation proxy (Google / MyMemory). Text is sent only when the user runs a free-translation action; no key or credential is ever involved and error responses never leak the upstream URL.
    • Direct requests to a user-configured OpenAI-compatible endpoint (only when direct mode is enabled).
  • No telemetry, analytics, or tracking.

Dependency security

We run bun audit periodically. If a dependency has a known vulnerability, we upgrade it as soon as a fix is available.

Disclosure policy

  • We will disclose fixed vulnerabilities in CHANGELOG.md and, for critical issues, in a GitHub Security Advisory.
  • We credit reporters unless they prefer to remain anonymous.

There aren't any published security advisories