pub struct SecurityConfig {
pub strict_policy: bool,
pub disable_policy: bool,
pub disable_suffix: bool,
pub allowed_directories: Vec<String>,
pub encryption: bool,
pub encryption_key_path: Option<String>,
pub sandbox_backend: String,
pub sandbox_image: Option<String>,
pub sandbox_memory: Option<String>,
}Fields§
§strict_policy: boolAbort agent startup on tamper or suspicious content (default: false).
When true, TamperDetected and SuspiciousContent are fatal errors
that prevent the agent from starting. When false (default), the agent
warns and falls back to hardcoded-only security.
disable_policy: boolSkip loading and injecting the LocalGPT.md workspace security policy
(default: false).
When true, the user’s signed LocalGPT.md content is not loaded or
injected into the context window. The hardcoded security suffix still
applies unless [disable_suffix] is also set.
disable_suffix: boolSkip injecting the hardcoded security suffix (default: false).
The suffix is a compiled-in reminder that tells the model to treat tool outputs and retrieved content as data, not instructions. When disabled, the user policy (if any) still applies.
Warning: Setting both disable_policy and disable_suffix to
true removes all end-of-context security reinforcement. The system
prompt safety section still exists, but may lose effectiveness in
long sessions due to attention decay (“lost in the middle” effect).
allowed_directories: Vec<String>Restrict file tools to these directories (empty = unrestricted). Paths are canonicalized at startup. Symlinks are resolved before checking.
encryption: boolEnable encryption at rest for sessions and config secrets (default: false).
encryption_key_path: Option<String>Path to the encryption key file. Default: data_dir/encryption.key (~/.local/share/localgpt/encryption.key)
sandbox_backend: StringContainer sandbox backend: “disabled” (default), “auto”, “docker”, “podman” “auto” tries Docker then Podman, falls back to kernel sandbox.
sandbox_image: Option<String>Docker image for container sandbox (default: “ubuntu:24.04”)
sandbox_memory: Option<String>Memory limit for sandbox container (e.g., “512m”, “1g”)
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityConfig
impl Debug for SecurityConfig
Source§impl Default for SecurityConfig
impl Default for SecurityConfig
Source§fn default() -> SecurityConfig
fn default() -> SecurityConfig
Source§impl<'de> Deserialize<'de> for SecurityConfig
impl<'de> Deserialize<'de> for SecurityConfig
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>,
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnsafeUnpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().