Skip to content

Project Trust

Project-local hooks, plugins, and commands can execute arbitrary code when ox opens a repository. The project trust store records user-approved project roots so untrusted repositories cannot run project-local extensions automatically.

TrustStore::load_default reads and writes a TOML file at:

  1. $XDG_STATE_HOME/ox/trusted.toml when XDG_STATE_HOME is set and non-empty.
  2. ~/.local/state/ox/trusted.toml otherwise.

Callers and tests can override the path with TrustStore::load(path).

trusted.toml stores a sorted, deduplicated list of canonicalized project root paths under trusted_roots:

trusted_roots = [
"/Users/alice/GitHub/oxide-code",
"/Users/alice/work/service-api",
]
Field Type Default Description
trusted_roots string[] [] Canonicalized absolute paths of trusted workspaces
  • Canonicalization: TrustStore::is_trusted, trust, and revoke resolve symlinks and relative segments with std::fs::canonicalize. Revoking a directory that has already been deleted falls back to matching the provided path verbatim so stale entries can still be removed.
  • Atomic writes: TrustStore::save creates missing parent directories, writes the serialized TOML to a sibling temporary file, and atomically renames it into place.
  • Extension gating: TrustStore::gate_project returns TrustDecision::Allowed or TrustDecision::Untrusted, and TrustStore::guard_project runs a closure only when the project root is trusted.
  • CLI override: Passing --trust to ox chat, ox acp, or ox run trusts the current workspace for that invocation without modifying trusted.toml. See CLI.