Skip to content

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

chore: files changed crates/openhuman-core/src/tools/impl/browser/browser_unattended.rs

Steven Enamakel8f4293fef65d
diff --git a/crates/openhuman-core/src/tools/impl/browser/browser_unattended.rs b/crates/openhuman-core/src/tools/impl/browser/browser_unattended.rs
new file mode 100644
index 0000000000..b161f3db7e
--- /dev/null
+++ b/crates/openhuman-core/src/tools/impl/browser/browser_unattended.rs
@@ -0,0 +1,21 @@
+//! Opt-in pass for allow-listed browser actions in trusted unattended turns.
+
+use crate::agent::turn_origin::{self, AgentTurnOrigin, TrustedAutomationSource};
+use crate::config::BrowserConfig;
+
+pub(super) fn allowed_for(
+ _origin: Option<&AgentTurnOrigin>,
+ _browser: &BrowserConfig,
+ _kind: &str,
+) -> bool {
+ let _ = TrustedAutomationSource::Cron;
+ false
+}
+
+pub(super) fn allow_current(browser: &BrowserConfig, kind: &str, _digest_hex: &str) -> bool {
+ allowed_for(turn_origin::current().as_ref(), browser, kind)
+}
+
+#[cfg(test)]
+#[path = "browser_unattended_tests.rs"]
+mod tests;