If you discover a security vulnerability, please report it privately by opening a GitHub Security Advisory or contacting the maintainers directly. Do not file public issues for security bugs.
All server-side features are disabled by default and must be explicitly enabled via environment variables.
| Feature | Environment Variable | Default | Notes |
|---|---|---|---|
| Docker | AICODE_ENABLE_DOCKER + DOCKER_HOST |
Disabled | Requires both to be set |
| Terminal PTY | AICODE_ENABLE_TERMINAL |
Disabled (virtual) | Requires node-pty + Node.js server |
| LSP | AICODE_ENABLE_LSP |
Disabled (simulated) | Requires installed language servers |
| Database Writes | AICODE_DB_WRITE_ENABLED |
Disabled (read-only) | Only SELECT/WITH/PRAGMA allowed by default |
All file and git operations are sandboxed to WORKSPACE_DIR. Any path that resolves outside this directory is rejected. This prevents path traversal attacks.
- The database API uses a SQL guard that blocks destructive statements by default.
- Only
SELECT,WITH,PRAGMA, andEXPLAINare allowed withoutAICODE_DB_WRITE_ENABLED=true. - Row limits and timeouts are enforced.
- Table names in PRAGMA are validated with regex.
- API keys entered in the UI are NOT persisted to localStorage by default.
- The Zustand store's
partializefunction stripsapiKey,endpoint,githubToken, and database credentials before saving. - A migration (v0 → v1) automatically clears any previously persisted secrets.
- API keys are sent to your AICodeStudio instance via
/api/ai. They are never sent to third-party servers by the application itself.
- Docker integration is disabled by default.
- Requires explicit
AICODE_ENABLE_DOCKER=trueANDDOCKER_HOSTto be set. - TCP on port 2375 without TLS is not recommended and is strongly discouraged.
- Never expose Docker on a public-facing server without authentication, TLS, or a secure tunnel.
- By default, the terminal is virtual/simulated — no real shell process is spawned.
- A real PTY requires
AICODE_ENABLE_TERMINAL=true, a Node.js server, and thenode-ptypackage. - When enabled, terminal sessions should be isolated per workspace with idle timeouts.
- Git operations are sandboxed to
WORKSPACE_DIRviaassertInsideWorkspaceRoot. - Arbitrary
workDirvalues that resolve outside the workspace are rejected. - All inputs are validated with Zod schemas.
- Never run AICodeStudio with Docker/Terminal enabled on a public server without authentication.
- Use
WORKSPACE_DIRto restrict file system access. - Keep
AICODE_DB_WRITE_ENABLEDoff unless you need database modifications. - Use HTTPS in production.
- Rotate any API keys that may have been accidentally persisted in localStorage.