Please report security issues privately to the repository owner (open a GitHub security advisory on this repo, or contact the maintainer directly). Do not open a public issue for security reports.
This project runs an LLM agent that can (optionally) query BigQuery and execute model-written code, so several guards are enforced in code:
-
Hosted/public launch is frozen. Local loopback desktop development remains supported. Hosted, public-network, multi-tenant operation and public release publishing fail closed through
backend/ocd_core/launchguard.py. Seedocs/launch-freeze.mdfor the source-controlled exit criteria. -
Fail-closed networking. The backend binds
127.0.0.1by default and refuses to start on a non-loopback interface during the freeze. The development-only Compose carve-out requires bothOCD_DEPLOYMENT_MODE=developmentand the explicitOCD_ALLOW_INSECURE_NETWORK=1marker, but authentication remains mandatory for every non-loopback bind and whenever tenancy is enabled. Seebackend/ocd_core/launchguard.py,backend/ocd_core/netguard.py, and their tests. -
Dangerous capabilities default off. Remote marketplace sources, stdio MCP, host code execution, and scheduled automations require explicit operator opt-ins. Cowork starts with manual approval and sensitive tools default to
askmode. -
Database and migration failures are fatal.
OCD_DB_FALLBACK=0is the default; database reachability, backup, schema, and Alembic failures abort startup rather than silently changing persistence or running against a stale schema. -
Temporary edge limits. Direct launches cap body size and process concurrency. Compose adds Nginx request-size, connection, and request-rate limits; upload routes stream under a separate 25 MiB cap. These do not satisfy the distributed production quota/WAF exit criterion.
-
Secrets in the OS keychain. Connector credentials (and provider API keys from Phase 1) are stored via
keyringwith an encrypted-file fallback, never plaintext in tracked files. Seebackend/ocd_core/secrets.py. -
BigQuery is read-only by default (optional connector):
execute_sqlrejects any non-SELECTstatement, enforces a per-project table allowlist on BigQuery's parsedreferenced_tables(not substring matching), and caps bytes billed. Seebackend/tests/test_sql_guard.pyandtest_execute_sql_guard.py. -
Code execution fails shut. The
code_executiontool runs only inside a container (docker --network none); with no container runtime it refuses rather than running on the host.bashis allowlisted and path-jailed to its sandbox (pythonis not allowlisted). When a chat is attached to a code workspace,bashadditionally allows curated build/test runners (incl.python/nodeon the repo's own script files — inline-c/-e/REPL blocked,--flag=<path>jailed, secret env vars stripped) in the workspace directory, behind the permission-mode gate + the catastrophic-command breaker. This is host execution, not a sandbox. Seebackend/tests/test_bash_jail.py. -
Hooks are app-owned, and fail closed. Harness lifecycle hooks (shell commands run at
PreToolUse,PostToolUse, etc.) are read only from the app's own settings — a workspace/repo can never contribute one, because a hook executes where a workspace permission rule only restricts. Tool input reaches a hook as stdin JSON (never interpolated into its command line), hooks runshell=Falsewith the same secret-stripped environment as workspace bash, a timed-out hook's whole process tree is killed, and a failing/timing-outPreToolUsehook denies the tool call. A hook that requests approval in an unattended run (Cowork/scheduler, where no one can answer) also denies rather than proceeding. Note the converse power: a hook returningallowskips the approval prompt — including for sensitive built-ins — so treat a broad-matcherallowhook with the same caution asbypasspermission mode. Seebackend/tests/test_harness_hooks.py. -
SSRF-guarded fetches.
web_fetchand REST connectors block private/internal hosts and drop custom auth headers on cross-origin redirects. Seebackend/tests/test_connector_ssrf.py. -
Authentication. The backend requires a valid bearer token on every request when credentials are configured (
APP_USERNAME/APP_PASSWORD/APP_AUTH_SECRET); login attempts are rate-limited. When unconfigured it runs open for local single-user use — which is why the network guard above keeps that mode loopback-only. -
Credentials. BigQuery auth uses Application Default Credentials (Workload Identity /
gcloud auth application-default login) — never a key file in the repo..gitignoreis deny-by-default for secrets, and agitleakspre-commit hook + CI job block secret commits.
Treat any secret that has touched a working tree as compromised. Rotate the GCP
service account, ZHIPU_API_KEY, APP_PASSWORD, and CHAINLIT_AUTH_SECRET if
there is any chance they were exposed.