pub struct TriggerConfig {
pub name: String,
pub pattern: String,
pub enabled: bool,
pub actions: Vec<TriggerActionConfig>,
pub prompt_before_run: bool,
pub i_accept_the_risk: bool,
pub allowed_commands: Vec<String>,
}Expand description
A trigger definition that matches terminal output and fires actions.
Fields§
§name: String§pattern: String§enabled: bool§actions: Vec<TriggerActionConfig>§prompt_before_run: boolWhen true (default), dangerous actions show a confirmation dialog before executing. When false, they execute automatically (with rate-limit + denylist guards still applied).
Previously named require_user_action. The old name is accepted as an alias for
backward compatibility with existing config files.
§SECURITY WARNING
Setting prompt_before_run: false is a high-risk configuration that allows
terminal output — including output produced by commands you run in the terminal —
to trigger RunCommand, SendText, and SplitPane actions without any user
confirmation. This is effectively a terminal-output-to-command-execution path.
Known risks with prompt_before_run: false:
- Prompt injection: a web page, log file, or remote server response printed to the terminal could contain text that matches your trigger pattern and causes arbitrary commands to run.
- Denylist bypass: the command denylist is a best-effort heuristic, not a security boundary. Encoded or obfuscated payloads can bypass it.
- No audit trail: commands execute silently; there is no confirmation step that would give you a chance to notice unexpected execution.
This field MUST remain true (the default) unless you have a specific,
well-understood automation need and have set i_accept_the_risk: true to
explicitly acknowledge the above risks.
i_accept_the_risk: boolExplicit opt-in required when prompt_before_run: false is set for any trigger
that contains dangerous actions (RunCommand, SendText, SplitPane).
When prompt_before_run: false, the denylist is the only automated protection
against malicious terminal output triggering arbitrary command execution.
Setting this to true signals that you have reviewed and accepted this risk.
If prompt_before_run: false AND this is false (default), the trigger will
not execute and a warning will be logged.
allowed_commands: Vec<String>SEC-002: Optional allowlist of commands that this trigger is permitted to
execute via RunCommand actions.
When allowed_commands is set (non-empty), only commands whose binary
name or canonical path matches an entry in this list are allowed. This is
more secure than the denylist because it defaults to deny-everything and
only allows explicitly approved commands.
When allowed_commands is empty or absent (the default), the existing
denylist behavior continues — all commands are allowed unless they match
a denylist pattern.
§Matching rules
- Entries are matched against the command binary name (the first token) using case-insensitive substring matching.
- For exact matching, include the full command name (e.g.,
"git","docker","npm"). - Path-based matching is also supported (e.g.,
"/usr/bin/git").
§Example
triggers:
- name: deploy
pattern: "deploy:\\s*(\\S+)"
prompt_before_run: false
i_accept_the_risk: true
allowed_commands:
- git
- docker
- kubectl
actions:
- type: run_command
command: "/usr/local/bin/deploy"Trait Implementations§
Source§impl Clone for TriggerConfig
impl Clone for TriggerConfig
Source§fn clone(&self) -> TriggerConfig
fn clone(&self) -> TriggerConfig
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 TriggerConfig
impl Debug for TriggerConfig
Source§impl<'de> Deserialize<'de> for TriggerConfig
impl<'de> Deserialize<'de> for TriggerConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TriggerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TriggerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TriggerConfig
impl PartialEq for TriggerConfig
Source§impl Serialize for TriggerConfig
impl Serialize for TriggerConfig
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 TriggerConfig
Auto Trait Implementations§
impl Freeze for TriggerConfig
impl RefUnwindSafe for TriggerConfig
impl Send for TriggerConfig
impl Sync for TriggerConfig
impl Unpin for TriggerConfig
impl UnsafeUnpin for TriggerConfig
impl UnwindSafe for TriggerConfig
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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