pub struct AgentDefinition {
pub name: String,
pub description: String,
pub native: bool,
pub hidden: bool,
pub permissions: PermissionPolicy,
pub model: Option<ModelConfig>,
pub prompt: Option<String>,
pub max_steps: Option<usize>,
pub tool_free: bool,
pub confirmation_inheritance: Option<ConfirmationInheritance>,
}Expand description
Agent definition
Defines the configuration and capabilities of an agent type.
Fields§
§name: StringAgent identifier (e.g., “explore”, “plan”, “general”)
description: StringDescription of what the agent does
native: boolWhether this is a built-in agent
Whether to hide from UI
permissions: PermissionPolicyPermission rules for this agent
model: Option<ModelConfig>Optional model override
prompt: Option<String>System prompt for this agent
max_steps: Option<usize>Maximum execution steps (tool rounds)
tool_free: boolWhether this role is a pure model decision with no visible or executable tools.
confirmation_inheritance: Option<ConfirmationInheritance>How child runs resolve Ask decisions. Default: AutoApprove when the agent has explicit allow rules, DenyOnAsk otherwise.
Implementations§
Source§impl AgentDefinition
impl AgentDefinition
Sourcepub fn worker(spec: WorkerAgentSpec) -> Self
pub fn worker(spec: WorkerAgentSpec) -> Self
Create an agent definition from a disposable worker recipe.
Mark as hidden from UI
Sourcepub fn with_permissions(self, permissions: PermissionPolicy) -> Self
pub fn with_permissions(self, permissions: PermissionPolicy) -> Self
Set permission policy
Sourcepub fn with_model(self, model: ModelConfig) -> Self
pub fn with_model(self, model: ModelConfig) -> Self
Set model override
Sourcepub fn with_prompt(self, prompt: &str) -> Self
pub fn with_prompt(self, prompt: &str) -> Self
Set system prompt
Sourcepub fn with_max_steps(self, max_steps: usize) -> Self
pub fn with_max_steps(self, max_steps: usize) -> Self
Set maximum execution steps
Sourcepub fn tool_free(self) -> Self
pub fn tool_free(self) -> Self
Make this role a pure LLM step. Tool definitions are removed before the child turn, and parent tool permissions are not inherited into it.
Sourcepub fn has_defined_permissions(&self) -> bool
pub fn has_defined_permissions(&self) -> bool
Whether this definition has non-empty permission rules.
Sourcepub fn with_confirmation(self, inheritance: ConfirmationInheritance) -> Self
pub fn with_confirmation(self, inheritance: ConfirmationInheritance) -> Self
Set confirmation inheritance policy for child runs.
Trait Implementations§
Source§impl Clone for AgentDefinition
impl Clone for AgentDefinition
Source§fn clone(&self) -> AgentDefinition
fn clone(&self) -> AgentDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentDefinition
impl Debug for AgentDefinition
Source§impl<'de> Deserialize<'de> for AgentDefinition
impl<'de> Deserialize<'de> for AgentDefinition
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>,
Source§impl From<WorkerAgentSpec> for AgentDefinition
impl From<WorkerAgentSpec> for AgentDefinition
Source§fn from(spec: WorkerAgentSpec) -> Self
fn from(spec: WorkerAgentSpec) -> Self
Auto Trait Implementations§
impl Freeze for AgentDefinition
impl RefUnwindSafe for AgentDefinition
impl Send for AgentDefinition
impl Sync for AgentDefinition
impl Unpin for AgentDefinition
impl UnsafeUnpin for AgentDefinition
impl UnwindSafe for AgentDefinition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more