pub struct ShellPolicy {
pub default_timeout_secs: u64,
pub max_timeout_secs: u64,
pub max_capture_bytes: u64,
pub scrub_env: Vec<String>,
pub allow_env: Vec<String>,
}Expand description
Limits for the shell tool.
Fields§
§default_timeout_secs: u64Seconds a command may run when the call does not choose.
max_timeout_secs: u64Upper bound on any timeout the model requests.
max_capture_bytes: u64Bytes kept from each captured stream. The middle of a larger stream is dropped before the model-facing result is truncated again.
scrub_env: Vec<String>Exact variable names removed from the child environment in addition to
the credential pattern, for example a provider’s api_key_env.
allow_env: Vec<String>Exact variable names exempt from the credential pattern.
Implementations§
Source§impl ShellPolicy
impl ShellPolicy
Sourcepub fn scrubs(&self, name: &str) -> bool
pub fn scrubs(&self, name: &str) -> bool
Whether a variable is removed from the child environment.
Anything a command can read, the model can read and send to its
provider: env is one command away. Credentials are therefore removed
by name pattern rather than listed one by one, because a real
environment holds more of them than any list anticipates. Matching whole
_-separated segments avoids false positives such as MONKEY or
KEYCHAIN_PATH, and leaves SSH_AUTH_SOCK usable for git.
Trait Implementations§
Source§impl Clone for ShellPolicy
impl Clone for ShellPolicy
Source§impl Debug for ShellPolicy
impl Debug for ShellPolicy
Source§impl Default for ShellPolicy
impl Default for ShellPolicy
Source§impl<'de> Deserialize<'de> for ShellPolicywhere
ShellPolicy: Default,
impl<'de> Deserialize<'de> for ShellPolicywhere
ShellPolicy: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ShellPolicy
Source§impl PartialEq for ShellPolicy
impl PartialEq for ShellPolicy
Source§impl Serialize for ShellPolicy
impl Serialize for ShellPolicy
impl StructuralPartialEq for ShellPolicy
Auto Trait Implementations§
impl Forget for ShellPolicy
impl Freeze for ShellPolicy
impl Move for ShellPolicy
impl RefUnwindSafe for ShellPolicy
impl Send for ShellPolicy
impl Sync for ShellPolicy
impl Unpin for ShellPolicy
impl UnsafeUnpin for ShellPolicy
impl UnwindSafe for ShellPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.