Skip to main content

is_trusted

Function is_trusted 

Source
pub fn is_trusted(config: &Config, surface: TrustSurface) -> bool
Expand description

BP-10: is this workspace trusted to load surface?

Order, first answer wins:

  1. [capabilities.trust] enabled = false ⇒ there is NO trust gate, so TrustSurface::undecided answers: config-declared code is still refused (plugins → trust is a hard resolver dependency — plugins cannot even be enabled without this module), project instruction text is still loaded. Both are the pre-BP-10 behavior exactly; a module nobody turned on must not silently acquire a new refusal.
  2. default = "always"true; default = "never"false. An explicit answer is never overridden by a stale recorded one.
  3. A recorded per-project decision ⇒ that answer, without prompting.
  4. default = "ask" with a door installed ⇒ ASK, on the one engine’s handler. AllowForSession (“don’t ask again”) records the answer; a one-shot Allow does not. A refusal records nothing, so a later run asks again rather than remembering a “no” the user may have meant only for that moment.
  5. default = "ask" with no door ⇒ TrustSurface::undecided — see this module’s doc comment for why that differs by surface.