Skip to main content

0011: Trust decisions and permission epochs

  • Status: Proposed (implemented in Phase 2, task 002; refines 0007)
  • Date: 2026-12-05

Context​

The MVP stored a list of trusted folders and trusted any folder below one. Restricting a subfolder of a trusted folder had no effect, because revoking only removed an exact entry. Upcoming tasks, debuggers and AI tools need one place to ask "may this run?" and a way to discard work that was allowed before a revocation.

Decision​

  • Store explicit grant or deny decisions per canonical folder in a versioned file (version = 2) in the user config directory. For each permission the nearest explicit decision wins.
  • Keep workspace execution and external sharing as separate permissions. Execution defaults to denied, sharing to allowed (with per-request preview).
  • Fail closed: unreadable storage restricts everything and refuses grants; grants persist before taking effect; revocations apply even if they cannot be saved.
  • Every permission change or workspace switch increments a permission epoch. Ide::authorize returns a token at dispatch; results are applied only if Ide::is_authorized still holds.

Alternatives considered​

  • Keep the trusted list and add a deny list: two lists with ad hoc precedence; the nearest-decision rule is simpler to explain.
  • Per-feature prompts each time: noisy, and still needs revocation of running work.
  • Trust configuration in the repository: a repository must never grant itself permissions.

Consequences​

  • Version 1 files are read and upgraded on the next change; older builds cannot read version 2 files and fail restricted.
  • Components that start work must hold and re-check an Authorization. Per-process generations for late protocol messages arrive with task 003/004.

Validation​

Unit tests in crates/ide-core/src/trust.rs and session tests in crates/ide-core/tests/session.rs; evidence in Phase 2 validation.