Skip to content

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

test(security): pin that the hosted gate never redacts while history is replayed (#6710)

M3gA-Mind5976caeb4149
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs
index 9f45032ca8..3420d99960 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs
@@ -429,3 +429,28 @@ async fn allow_and_deny_channel_verdicts_are_unchanged() {
.unwrap();
assert!(matches!(denied, GateDecision::Deny { .. }));
}
+
+/// Tripwire for #6710. The hosted root marks replayed history with
+/// `with_replayed_prefix`, which is only safe while replayed user rows are what
+/// the gate admitted. The session driver persists the RAW turn input
+/// (`session_host/driver.rs`, `let mut history = request.history`), so the day
+/// this gate starts returning `Redacted` (the phase-4 TODO on `screen_input`), a
+/// redacted secret would reach the model raw on every later turn. Revisit that
+/// opt-in, or persist the redacted form, before changing this assertion.
+#[tokio::test]
+async fn screen_input_never_redacts_while_replayed_history_is_trusted() {
+ let gate = gate(AutonomyLevel::Full);
+ for text in [
+ "my card is 4111 1111 1111 1111 and my email is [email protected]",
+ "call me on +1 415 555 0132, SSN 123-45-6789",
+ "api key sk-live-0123456789abcdefghijklmnop",
+ ] {
+ for origin in [ContentOrigin::User, ContentOrigin::Tool] {
+ let outcome = gate.screen_input(text, origin).await.unwrap();
+ assert!(
+ !matches!(outcome, ScreenOutcome::Redacted(_)),
+ "gate returned Redacted for {origin:?}; revisit #6710's replayed_prefix opt-in"
+ );
+ }
+ }
+}
diff --git a/vendor/tinyagents b/vendor/tinyagents
index b8fe870518..c05d69b403 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit b8fe87051855e4b557e0531bb9873c045352fda9
+Subproject commit c05d69b4035be7bed612fe7ab2e5c02ef5aa0a63