Skip to main content

Module gate

Module gate 

Source
Expand description

SafetyGate — composing trait for the AIMDS 3-gate pipeline.

This trait formalizes the canonical 3-gate flow that AIMDS consumers expect:

  1. Pre-storage PII detection (aimds-detection)
  2. Sanitization for cookies / tokens / high-entropy blobs (aimds-detection + aimds-analysis)
  3. Prompt-injection / role-hijack / jailbreak check (aimds-detection + aimds-response)

Downstream consumers (notably ruvnet/ruflo‘s ruflo-federation-peer — see ADR-120 Step 3) embed this trait to run the 3-gate inspection in-process on every federation message hop. Composing the three crates’ surfaces through one trait lets the embedder swap or stub the gate (e.g. for tests) without binding to a concrete pipeline type.

aimds-detection, -analysis, and -response (v0.2.0+) provide concrete implementations of this trait via a ComposedGate type; this crate exports the trait shape only so aimds-core stays dep-light.

Enums§

SafetyVerdict
Result of running the 3-gate pipeline on one input.

Traits§

SafetyGate
The three gates surfaced as a single composing operation.