pub struct EnvScrub { /* private fields */ }Expand description
Decides which environment variables are removed before an agent CLI starts.
Agent CLIs inherit okbot’s environment, which holds platform tokens. A prompt-injected agent must not be able to read them, so every variable named here, and every variable whose name starts with one of the prefixes, is removed from the child.
Implementations§
Source§impl EnvScrub
impl EnvScrub
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Also removes name (for example a configured token_env).
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Also removes every variable starting with prefix.
Sourcepub fn names_to_remove(
&self,
current: impl IntoIterator<Item = OsString>,
) -> Vec<OsString>
pub fn names_to_remove( &self, current: impl IntoIterator<Item = OsString>, ) -> Vec<OsString>
The variables to remove, given the current environment’s variable names.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EnvScrub
impl RefUnwindSafe for EnvScrub
impl Send for EnvScrub
impl Sync for EnvScrub
impl Unpin for EnvScrub
impl UnsafeUnpin for EnvScrub
impl UnwindSafe for EnvScrub
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more