Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(triage): add origin for external inbound agent turns

Steven Enamakeld3876e042247
diff --git a/crates/openhuman-core/src/triage/origin.rs b/crates/openhuman-core/src/triage/origin.rs
index 8367225fd3..2690dd0459 100644
--- a/crates/openhuman-core/src/triage/origin.rs
+++ b/crates/openhuman-core/src/triage/origin.rs
@@ -15,6 +15,8 @@
//! - [`local_trigger_origin`] — the caller and the payload are both local.
//! - [`remote_trigger_origin`] — the payload arrived from outside and is
//! attacker-influenceable.
+//! - [`external_inbound_origin`] — a pinned agent's turn over events pushed
+//! into the inbound queues; remote content, the same posture.
//!
//! Deliberately *not* offered: a single blanket label. A webhook body and a
//! desktop notification are not the same trust proposition, and one label for
@@ -69,6 +71,24 @@ pub fn remote_trigger_origin(envelope: &TriggerEnvelope) -> AgentTurnOrigin {
}
}
+/// The origin for a pinned agent's turn over a batch of external events
+/// pushed into the inbound queues (`inbound.offer`).
+///
+/// The same posture as [`remote_trigger_origin`]: the turn is legitimate
+/// automation, but the content steering it was pushed from outside, so every
+/// external-effect call parks for approval instead of running. `job_id` is
+/// `inbound:<source>:<turn_id>` — the configured source name and the queues'
+/// turn id, both system-generated, never event text.
+#[must_use]
+pub fn external_inbound_origin(source: &str, turn_id: &str) -> AgentTurnOrigin {
+ AgentTurnOrigin::TrustedAutomation {
+ job_id: format!("inbound:{source}:{turn_id}"),
+ source: TrustedAutomationSource::Workflow {
+ require_approval: true,
+ },
+ }
+}
+
#[cfg(test)]
#[path = "origin_tests.rs"]
mod tests;