Skip to content

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

fix(tinyagents): stop returning Redacted from screen_input

Steven Enamakel2dc0517e522a
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_impl.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_impl.rs
index 853fba85e7..0875ff229d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_impl.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_impl.rs
@@ -54,8 +54,12 @@ impl SecurityGate for OpenHumanSecurityGate {
/// The reason string carries the verdict and the rule codes only — never
/// the screened text, which is the thing suspected of being hostile.
///
- /// Credential patterns are rewritten by TinyInference's shared scrubber,
- /// which is also used by OpenHuman's credential-scrub middleware.
+ /// TODO(phase4): no [`ScreenOutcome::Redacted`] is ever returned. Producing
+ /// one needs a free-text redactor; `tinymemory_api::safety::scan` detects spans but
+ /// returns no rewritten string, and `approval::redact::scrub_paths` is
+ /// private and shaped for JSON argument maps. Either lift a public
+ /// `redact_text(&str) -> String` out of `approval::redact` or add one to
+ /// `tinymemory_api::safety`, then map "PII found, injection clean" to `Redacted`.
async fn screen_input(&self, text: &str, origin: ContentOrigin) -> TaResult<ScreenOutcome> {
if !self.screens_input {
return Ok(ScreenOutcome::Pass);
@@ -79,14 +83,7 @@ impl SecurityGate for OpenHumanSecurityGate {
);
match decision.action {
- PromptEnforcementAction::Allow => {
- let redacted = tinyinference_core::sanitize::scrub_credentials(text);
- if redacted == text {
- Ok(ScreenOutcome::Pass)
- } else {
- Ok(ScreenOutcome::Redacted(redacted))
- }
- }
+ PromptEnforcementAction::Allow => Ok(ScreenOutcome::Pass),
PromptEnforcementAction::Blocked | PromptEnforcementAction::ReviewBlocked => {
let codes: Vec<&str> = decision.reasons.iter().map(|r| r.code.as_str()).collect();
tracing::warn!(