pub enum RulesAction {
Add {
id: String,
kind: String,
matcher: String,
severity: String,
reason: String,
namespace: String,
disabled: bool,
sign: bool,
},
List,
Check {
kind: String,
payload: String,
agent_id: Option<String>,
},
Enable {
id: String,
sign: bool,
},
Disable {
id: String,
sign: bool,
},
Remove {
id: String,
sign: bool,
},
Keygen {
out: Option<PathBuf>,
force: bool,
},
SignSeed {
key: Option<PathBuf>,
db: Option<PathBuf>,
},
}Variants§
Add
Add a new agent-action rule. Requires operator keypair on disk; signs the canonical row encoding before persisting.
Fields
List
List every rule (enabled + disabled). Read-only, no key required.
Check
Evaluate a proposed action against the live rule set without
committing it. Read-only. The output is the same JSON
[Decision] shape the MCP / HTTP path returns.
Fields
Enable
Activate a rule (flip enabled = 1). Requires --sign.
Disable
Deactivate a rule (flip enabled = 0). Requires --sign.
Remove
Remove a rule from the table. Requires --sign.
Keygen
v0.7.0 L1-6 — generate a fresh Ed25519 operator keypair and
write the private 32-byte seed to --out (mode 0600 on Unix)
plus a base64-encoded public key sibling at <out>.pub
(mode 0644). Default --out is ~/.config/ai-memory/operator.key.
Refuses to overwrite an existing file unless --force is passed;
even with --force a stderr warning is emitted (an existing
operator key is the keystone of the signature verify chain — a
silent overwrite would invalidate every prior signed rule).
The 32-byte seed never appears in stdout, stderr, or any
memory the agent emits. Only the fingerprint
sha256(public_key)[:16] is logged.
Fields
SignSeed
v0.7.0 L1-6 — sign every seeded rule (R001..R004 today) with
the operator key. Sets signature = ed25519(canonical_payload)
and attest_level = 'operator_signed'. enabled stays at 0
— the operator audits and activates manually after this runs.
The canonical payload includes enabled, so a direct
UPDATE governance_rules SET enabled = 1 after signing would
fail signature verification at load time — that is the
bypass-prevention property.
Trait Implementations§
Source§impl FromArgMatches for RulesAction
impl FromArgMatches for RulesAction
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for RulesAction
impl Subcommand for RulesAction
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for RulesAction
impl RefUnwindSafe for RulesAction
impl Send for RulesAction
impl Sync for RulesAction
impl Unpin for RulesAction
impl UnsafeUnpin for RulesAction
impl UnwindSafe for RulesAction
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<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