{"record":{"id":"3a24adc00da6398d","repo":"rtk-ai/rtk","slug":"custom-filters-found-but-none-enabled-re-run-rt","errorCode":null,"errorMessage":"Custom filters found but none enabled — re-run `rtk trust --yes`.","messagePattern":"Custom filters found but none enabled — re-run `rtk trust --yes`\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/hooks/trust.rs","lineNumber":315,"sourceCode":"        if !(yes || confirm_enable_at_tty()?) {\n            eprintln!(\"  Not enabled — re-run `rtk trust --yes` to trust non-interactively.\");\n            continue;\n        }\n        let hash = crate::hooks::integrity::compute_hash_bytes(&bytes);\n        trust_filter_with_hash(&filter_path, &hash)?;\n        enabled_any = true;\n        eprintln!(\"  Enabled — revoke with `rtk untrust`.\");\n    }\n\n    if !found_any {\n        if had_error {\n            anyhow::bail!(\"Filter file present but not valid TOML — see the error above.\");\n        }\n        anyhow::bail!(\"No custom filters found (.rtk/filters.toml or ~/.config/rtk/filters.toml)\");\n    }\n    if !enabled_any {\n        if !interactive {\n            anyhow::bail!(\"Custom filters found but none enabled — re-run `rtk trust --yes`.\");\n        }\n        return Ok(());\n    }\n    println!(\"Filters will now be applied.\");\n    Ok(())\n}\n\npub fn print_filter_notice(path: &Path, scope: &str, filters: &[(String, String)]) {\n    let yellow = \"\\x1b[33m\";\n    let reset = \"\\x1b[0m\";\n    eprintln!();\n    eprintln!(\n        \"{yellow}Detected {} custom {scope} scoped toml filter(s) in {} — they rewrite matching command output:{reset}\",\n        filters.len(),\n        path.display()\n    );\n    for (name, regex) in filters {\n        eprintln!(\"{yellow}    {name:<20} {regex}{reset}\");","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/rtk-ai/rtk/blob/d977e1c31621fe8704e6500ceeb9c7a0de2b6836/src/hooks/trust.rs#L297-L333","documentation":"Trust requires explicit consent. When stdin is not a terminal and --yes was not passed, confirm_enable_at_tty cannot prompt, every untrusted filter is skipped ('Not enabled' lines above), and because enabled_any stayed false on a non-interactive run, rtk aborts instead of leaving filters silently unapplied. An interactive run that declines everything simply returns Ok.","triggerScenarios":"`rtk trust` (no --yes) with piped or closed stdin — CI, cron, scripts — while at least one untrusted filters.toml with active filters exists: bail at src/hooks/trust.rs:315.","commonSituations":"First trust run inside CI or over an SSH pipe; automation assuming custom filters auto-enable.","solutions":["Run `rtk trust --yes` in any non-interactive context","Or run plain `rtk trust` from a real terminal and confirm at the prompt","Trust is hash-pinned, so this is one-time per filters.toml version — re-trust after every edit"],"exampleFix":"# before (CI job, stdin not a tty)\nrtk trust        # bails: none enabled\n\n# after\nrtk trust --yes","handlingStrategy":"validation","validationCode":"# bash: choose the trust mode by context\nif [ -t 0 ]; then rtk trust; else rtk trust --yes; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on `rtk trust --yes` for CI, cron, and piped contexts","Re-run trust after every edit to filters.toml — trust is pinned to the file's exact hash","Check `rtk trust --list` to confirm which files are trusted before assuming filters apply"],"tags":["trust","non-interactive","ci","filters"],"backgroundTag":null,"analyzedSha":"d977e1c31621fe8704e6500ceeb9c7a0de2b6836","analyzedAt":"2026-08-16T05:40:46.291Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}