When handling auth secrets, user directory/path-based configuration, or shell-generated code, treat any value that could reveal identity/organization or execute code as sensitive and untrusted by default.

Apply these rules:

1) Define trust boundaries explicitly

2) Escape/serialize as data, never as code

3) Redact sensitive logs and diagnostics

4) Don’t “silently weaken” authorization scopes

Example patterns

A) Redacted warning message (path-key privacy)

fn warn_directory_override(key: &str, theme: &str) {
  let redacted = redacted_key_id(key); // stable short id; never reversible without a local salt
  log::warn!(
    "directory_overrides[hash={}] : unknown theme '{}' — skipping this entry until corrected",
    redacted,
    theme
  );
}

B) Inert secret/command snippets in untrusted flows

Enforcement checklist / tests