pub struct ContextGatewayConfig {
pub enabled: bool,
pub mode: GatewayModeV1,
pub secrets: FilterAction,
pub pii: FilterAction,
pub injection: FilterAction,
pub classification: FilterAction,
pub max_inspected_bytes: usize,
pub detector_timeout_ms: u64,
pub destination_constraints: Vec<DestinationConstraintV1>,
pub allowed_destinations: Vec<DestinationV1>,
pub hud: HudPlacement,
}Expand description
[context_gateway] — global only; never merged from a project-local file.
Fields§
§enabled: boolMaster switch. LEAN_CTX_CONTEXT_GATEWAY=off overrides it.
mode: GatewayModeV1§secrets: FilterActionCredentials and keys (patterns from [secret_detection]).
pii: FilterActionChecksum-validated PII only: payment cards.
injection: FilterActionPrompt-injection heuristic (OWASP LLM01).
classification: FilterActionExplicit classification markings (CONFIDENTIAL, classification: …).
max_inspected_bytes: usizeBytes each detector may inspect per object; beyond it, coverage is
partial. Governed and sovereign modes withhold partially inspected
content, developer mode delivers it with a visible note.
detector_timeout_ms: u64Per-detector time budget; a detector that runs out reports timed_out.
destination_constraints: Vec<DestinationConstraintV1>Additional placement constraints applied to every final egress target. These remain active when content scanning is disabled.
allowed_destinations: Vec<DestinationV1>Optional target allow-list. Provider and locality are always checked; model/account/region are checked when the configured entry supplies them. Unknown locality never matches. Account references are configured labels, not provider-verified identities.
hud: HudPlacementWhere redaction counts are shown (see hud).
Implementations§
Source§impl ContextGatewayConfig
impl ContextGatewayConfig
Sourcepub fn enabled_effective(&self) -> bool
pub fn enabled_effective(&self) -> bool
Effective master switch. The LEAN_CTX_CONTEXT_GATEWAY kill switch
(0|false|off) is a developer convenience: it disables admission only
in developer mode. A governed or sovereign deployment is configured by
its operator in the global file; a process environment cannot switch
its protection off, so the variable is ignored there (and reported, see
Self::kill_switch). Any other value still forces the gateway on.
Sourcepub fn kill_switch(&self) -> KillSwitch
pub fn kill_switch(&self) -> KillSwitch
What the LEAN_CTX_CONTEXT_GATEWAY environment variable does under
this configuration (for doctor and the admission log). Reads the
live environment.
Trait Implementations§
Source§impl Clone for ContextGatewayConfig
impl Clone for ContextGatewayConfig
Source§fn clone(&self) -> ContextGatewayConfig
fn clone(&self) -> ContextGatewayConfig
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 ContextGatewayConfig
impl Debug for ContextGatewayConfig
Source§impl Default for ContextGatewayConfig
impl Default for ContextGatewayConfig
Source§fn default() -> ContextGatewayConfig
fn default() -> ContextGatewayConfig
Source§impl<'de> Deserialize<'de> for ContextGatewayConfigwhere
ContextGatewayConfig: Default,
impl<'de> Deserialize<'de> for ContextGatewayConfigwhere
ContextGatewayConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContextGatewayConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContextGatewayConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ContextGatewayConfig
Source§impl PartialEq for ContextGatewayConfig
impl PartialEq for ContextGatewayConfig
Source§impl Serialize for ContextGatewayConfig
impl Serialize for ContextGatewayConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ContextGatewayConfig
Auto Trait Implementations§
impl Forget for ContextGatewayConfig
impl Freeze for ContextGatewayConfigwhere
*const u8 is !null: Freeze,
PhantomData<DestinationConstraintV1>: Freeze,
PhantomData<DestinationV1>: Freeze,
impl Move for ContextGatewayConfig
impl RefUnwindSafe for ContextGatewayConfig
impl Send for ContextGatewayConfigwhere
RawVecInner: Send,
impl Sync for ContextGatewayConfigwhere
RawVecInner: Sync,
impl Unpin for ContextGatewayConfig
impl UnsafeUnpin for ContextGatewayConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<DestinationConstraintV1>: UnsafeUnpin,
PhantomData<DestinationV1>: UnsafeUnpin,
impl UnwindSafe for ContextGatewayConfigwhere
RawVecInner: UnwindSafe,
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<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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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