Skip to main content

ReachReason

Enum ReachReason 

Source
pub enum ReachReason {
    Credential,
    FrozenTrustFile,
    FrozenTrustRoot,
    FrozenSystemIntegrity,
    RawDevice,
    OutsideWorkspace,
    Unconfined,
    ForeignTemp,
}
Expand description

Why a not-auto-approved command’s path reach was flagged — so the nudge can explain the actual reason instead of a one-size-fits-all “outside the working directory”. A peer’s hidden file and a path genuinely above cwd both deny, but the remedy differs, and conflating them is what reads as “directory parsing is broken”.

Variants§

§

Credential

A known credential store (.ssh, .aws, keychain…).

§

FrozenTrustFile

A file safe-chains reads its OWN permissions from (~/.config/safe-chains.toml, ~/.claude/settings.json). Distinct from OutsideWorkspace because the generic remedy there — grant the path — is not merely unhelpful but FALSE: the write face is frozen, so following the advice changes nothing. For safe-chains’ own config it is also circular, telling the user to edit the file they are being stopped from editing.

§

FrozenTrustRoot

The DIRECTORY a trust file lives in. Distinct from FrozenTrustFile because only HALF of it is refused: writing a file into ~/.config is ordinary and stays allowed, and only removing or replacing the directory is not. Copy that said “this is refused” flatly would misdescribe a directory the user explicitly granted.

§

FrozenSystemIntegrity

One of the files that decide who may log in (/etc/passwd, /etc/sudoers, /etc/pam.d, the loader and boot). Same false-remedy problem as FrozenTrustFile.

§

RawDevice

A raw block or character device (/dev/mem, /dev/rdisk0, /dev/sda). Distinct from FrozenSystemIntegrity because the device rung outranks system-integrity, so without its own arm every device was explained as a file that “decides who may log in” — which is both false and unhelpful about the thing that actually makes a device dangerous.

§

OutsideWorkspace

Genuinely above/outside the working directory.

§

Unconfined

A path built by an interpolation that nothing confines (./out/$i, > $(cmd)). It is not outside anything — it names WHATEVER the value turns out to be, which is why it cannot be admitted — so the remedy is to constrain the spelling, not to grant a directory.

§

ForeignTemp

A temp path that is NOT this session’s scratchpad. Reading and writing it is fine; RUNNING code from it is not, because anonymous /tmp is where downloaded/foreign code lands. This is the one reach whose remedy is usually “that IS my working directory” — so the nudge says how to bless it rather than implying the agent did something wrong.

Implementations§

Source§

impl ReachReason

Source

pub fn grant_helps(self) -> bool

The self-contained nudge body (“it reaches X, …”) including the reason-appropriate remedy. Callers add their own framing (block / please-confirm) and the docs link. Whether naming this path in ~/.config/safe-chains.toml actually changes the verdict.

The refusal copy offers a grant, or explains that granting will not help, and the two must not diverge: advice that does nothing costs more than silence, because the reader follows it, sees no change, and stops believing the rest. a_refusal_offers_a_grant_only_when_one_ would_work runs the verdict twice — once with the grant applied — and holds this to it.

Credential is true as of 2026-09-01 and was false before it. A grant naming a store used to move the locus and leave reads_secret set, so the message’s “name that path” advice was FALSE while reading exactly right. That is the failure this pairing exists to catch, and it went unnoticed because nothing compared the sentence to the behaviour.

Source

pub fn message(self, path: &str) -> String

Trait Implementations§

Source§

impl Clone for ReachReason

Source§

fn clone(&self) -> ReachReason

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ReachReason

Source§

impl Debug for ReachReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ReachReason

Source§

impl PartialEq for ReachReason

Source§

fn eq(&self, other: &ReachReason) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReachReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.