Skip to main content

ToolsConfig

Struct ToolsConfig 

Source
pub struct ToolsConfig {
Show 28 fields pub workspace_root: Option<PathBuf>, pub read_file: Policy, pub search_files: Policy, pub write_file: Policy, pub rewrite_guard_bytes: usize, pub patch: Policy, pub memory: Policy, pub shell: Policy, pub fetch: Policy, pub script: Policy, pub execute_code: Policy, pub delegate: Policy, pub shell_ask: ShellAsk, pub shell_timeout_secs: u64, pub shell_allowlist: Vec<String>, pub shell_isolate: ShellIsolate, pub shell_isolate_writable: Vec<PathBuf>, pub shell_isolate_hide: Vec<PathBuf>, pub shell_isolate_network: bool, pub fetch_timeout_secs: u64, pub fetch_html: FetchHtml, pub max_output_bytes: usize, pub concurrency: usize, pub disabled: Vec<String>, pub deferred: Vec<String>, pub tool_search: Policy, pub tool_describe: Policy, pub tool_call: Policy,
}

Fields§

§workspace_root: Option<PathBuf>

File tools are confined to this directory. Defaults to the current directory.

§read_file: Policy§search_files: Policy

The search_files tool: a read-only walk of the workspace. allow for the same reason as read_file — the tree it walks is confined, and a prompt per search is the noise that teaches people to approve without reading.

§write_file: Policy§rewrite_guard_bytes: usize

Above this many bytes, clobbering an existing file with write_file needs force. A rewrite carries the whole file as a tool-call argument, and that argument stays in the conversation for the rest of the session — the single most expensive way to change a line. 0 switches the guard off.

§patch: Policy

The patch tool: a targeted edit of a file that already exists. Same default as write_file, because it is the same side effect, more carefully aimed.

§memory: Policy

The memory tool: write a durable fact to MEMORY.md, which is loaded into every later system prompt of the session. ask by default: clean writes still run silently, and only writes carrying a verbatim run from a tool result in the same turn prompt (#482). allow skips the taint check; deny disables the tool.

§shell: Policy§fetch: Policy§script: Policy

The script tool, which runs a file from the scripts directory. ask by default: a script is arbitrary code, and one the agent wrote itself is no more trustworthy for it. A bare {"list": true} is a read of a directory the user owns and is not asked about.

§execute_code: Policy

The execute_code tool: a short program written for one job, run from a temporary file that is deleted afterwards, with a bridge back to the registry so the program can call tools. ask by default: it is arbitrary code, and a bridge makes it more useful, not more trustworthy.

§delegate: Policy

The delegate tool, which hands a job to a child agent. ask by default: a child spends tokens, possibly on a bigger model than the one you are talking to, and may run tools of its own.

§shell_ask: ShellAsk

Timeout for shell and for script: they are the same kind of thing, a process the agent started, and one number keeps them honest with each other. Whether the shell asks about every command or only about the dangerous ones.

§shell_timeout_secs: u64§shell_allowlist: Vec<String>

If non-empty, shell only runs these program names, without a shell.

§shell_isolate: ShellIsolate

What a shell command can reach: off (a plain process), process (a private PID namespace, filesystem unchanged) or fs (also a read-only filesystem). process by default. Any mode but off needs bubblewrap, and refuses to run without it rather than quietly running unsandboxed.

§shell_isolate_writable: Vec<PathBuf>

Paths bound read-write in fs mode, beyond the workspace and the scripts directory. ~ is the home directory. A cargo build needs ~/.cargo here.

§shell_isolate_hide: Vec<PathBuf>

Paths replaced by an empty directory in fs mode, so their contents cannot be read. ~ is the home directory.

§shell_isolate_network: bool

Whether fs mode keeps the network. true by default: a build needs it, and a task that only edits files can turn it off.

§fetch_timeout_secs: u64§fetch_html: FetchHtml

text (default) converts HTML responses to plain text; raw returns the source. The model can override per call with {"raw": true|false}.

§max_output_bytes: usize

Tool output is truncated to this many bytes before reaching the model.

§concurrency: usize

How many of one turn’s tool calls may run at the same time. 1 (the default) runs them one after another; 0 is treated as 1. Results are committed in the order the model emitted the calls, whatever this is set to.

§disabled: Vec<String>

Tools to remove entirely, whatever their policy says. Not offered to the model, and a call that names one is refused — the point is that a hallucinated call cannot slip through. Stronger than deny: it also survives a plugin claiming the name.

§deferred: Vec<String>

Tools that stay registered and callable but are not described in the request, so they cost no tokens until they are needed. tool_search finds them by keyword, tool_describe gives their arguments, and tool_call runs them — all three through the same policy, approval and hook path as a direct call, so deferring a tool moves it out of the prompt and changes nothing else. "*" defers everything registered, and a trailing * is a prefix. A pattern is matched against a tool’s name and against its source (plugin:mcp:<server>), because MCP tools keep the names their server published and so cannot be deferred by name (#351).

The shipped default is plugin:mcp:*: an MCP server is where forty tools come from, and forty schemas in every request is four thousand tokens of promise. Plugins that declare a handful of tools stay visible; anything can be deferred or un-deferred explicitly.

§tool_search: Policy

The three tools that reach the deferred ones. allow by default: none of them has a side effect of its own, and tool_call is a router — the tool it routes to is what the policy and the approval prompt are about, so asking twice would only train the user to hold down Enter.

§tool_describe: Policy§tool_call: Policy

Trait Implementations§

Source§

impl Clone for ToolsConfig

Source§

fn clone(&self) -> Self

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 Debug for ToolsConfig

Source§

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

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

impl Default for ToolsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ToolsConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ToolsConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more