pub struct AuditConfig {
pub enabled: Option<bool>,
pub path: Option<String>,
pub schema_version: Option<u32>,
pub redact_content: Option<bool>,
pub hash_chain: Option<bool>,
pub attestation_cadence_minutes: Option<u32>,
pub append_only: Option<bool>,
pub retention_days: Option<u32>,
pub compliance: Option<AuditComplianceConfig>,
}Expand description
[audit] block in config.toml. Drives the hash-chained audit
trail emitted from every memory mutation call site.
Fields§
§enabled: Option<bool>Master toggle. Default false.
path: Option<String>Audit log path. Either a directory (in which case audit.log
is appended) or an explicit file path. Default
~/.local/state/ai-memory/audit/.
schema_version: Option<u32>Documented schema version on the wire. The binary always emits
audit::SCHEMA_VERSION; this knob is reserved for forward
compatibility and must equal the binary’s emitted version
today (validated at init).
redact_content: Option<bool>Whether to redact memory.content from emitted events. The
only supported value in v1 is true — the audit schema does
not expose a content field at all; this flag is reserved for a
future per-namespace exception API.
hash_chain: Option<bool>Whether to compute and verify the per-line hash chain. Default true.
attestation_cadence_minutes: Option<u32>Cadence in minutes for the periodic CHECKPOINT.sig
attestation marker. The marker is a synthetic audit event that
pins the chain head into the log so an attacker who truncates
the file can’t silently rewind history. Default 60. 0 disables.
append_only: Option<bool>Apply the platform-appropriate “append-only” file flag at
startup. Best-effort defense in depth; the chain is the
load-bearing tamper-evidence. Default true.
retention_days: Option<u32>Retention horizon (days). ai-memory logs purge warns about
deleting audit records younger than this, and audit verify
surfaces gaps when retention is shorter than the chain extent.
Default 90. Compliance presets override.
compliance: Option<AuditComplianceConfig>Compliance presets — apply industry-standard retention /
redaction policy on top of the base config. See
docs/security/audit-trail.md §Compliance.
Implementations§
Source§impl AuditConfig
impl AuditConfig
Sourcepub fn effective_retention_days(&self) -> u32
pub fn effective_retention_days(&self) -> u32
Resolve the effective retention horizon after applying any
active compliance preset. Presets win when applied = true;
when multiple presets are applied the most-conservative
(longest) retention wins so the binary never picks a value
that violates any active policy.
Sourcepub fn effective_attestation_cadence_minutes(&self) -> u32
pub fn effective_attestation_cadence_minutes(&self) -> u32
Resolve the effective attestation cadence — the most-frequent (smallest non-zero) cadence across the base config and applied presets so the strictest compliance rule wins.
Trait Implementations§
Source§impl Clone for AuditConfig
impl Clone for AuditConfig
Source§fn clone(&self) -> AuditConfig
fn clone(&self) -> AuditConfig
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 AuditConfig
impl Debug for AuditConfig
Source§impl Default for AuditConfig
impl Default for AuditConfig
Source§fn default() -> AuditConfig
fn default() -> AuditConfig
Source§impl<'de> Deserialize<'de> for AuditConfig
impl<'de> Deserialize<'de> for AuditConfig
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 AuditConfig
impl RefUnwindSafe for AuditConfig
impl Send for AuditConfig
impl Sync for AuditConfig
impl Unpin for AuditConfig
impl UnsafeUnpin for AuditConfig
impl UnwindSafe for AuditConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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