pub struct AgentSafetyConfig {
pub enabled: bool,
pub max_rows: u32,
pub max_timeout: Duration,
pub forbidden_tables: Vec<String>,
pub require_where_tables: Vec<String>,
pub block_ddl: bool,
pub block_admin: bool,
}Expand description
Agent query safety configuration
Fields§
§enabled: boolEnable agent safety rules
max_rows: u32Maximum rows for agent queries
max_timeout: DurationMaximum query timeout for agents
forbidden_tables: Vec<String>Forbidden tables for agents
require_where_tables: Vec<String>Required WHERE clause tables
block_ddl: boolBlock DDL for agents
block_admin: boolBlock admin commands for agents
Implementations§
Source§impl AgentSafetyConfig
impl AgentSafetyConfig
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive config (for trusted agents)
Sourcepub fn restrictive() -> Self
pub fn restrictive() -> Self
Create a restrictive config (for untrusted agents)
Sourcepub fn is_forbidden(&self, table: &str) -> bool
pub fn is_forbidden(&self, table: &str) -> bool
Check if a table is forbidden
Trait Implementations§
Source§impl Clone for AgentSafetyConfig
impl Clone for AgentSafetyConfig
Source§fn clone(&self) -> AgentSafetyConfig
fn clone(&self) -> AgentSafetyConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentSafetyConfig
impl Debug for AgentSafetyConfig
Auto Trait Implementations§
impl Freeze for AgentSafetyConfig
impl RefUnwindSafe for AgentSafetyConfig
impl Send for AgentSafetyConfig
impl Sync for AgentSafetyConfig
impl Unpin for AgentSafetyConfig
impl UnsafeUnpin for AgentSafetyConfig
impl UnwindSafe for AgentSafetyConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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