{"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":null,"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/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/trust.rs#L297-L333","documentation":"`rtk trust` found custom filter files with active filters, but none ended up enabled. In non-interactive sessions (stdin is not a TTY), run_trust cannot prompt for confirmation, so without `--yes` every filter is skipped and the command bails rather than silently trusting nothing. This is a deliberate safety gate: custom filters rewrite command output, so they must be explicitly trusted.","triggerScenarios":"Running plain `rtk trust` (no --yes) when stdin is not a terminal — e.g. from a script, CI job, or AI agent — while .rtk/filters.toml or ~/.config/rtk/filters.toml contains active, not-yet-trusted filters. Also occurs when the user answers 'no' at the interactive prompt for every filter (interactive case returns Ok, but any skip plus non-interactive mode produces the bail).","commonSituations":"Running `rtk trust` inside a CI pipeline or shell script where no TTY is attached; running it through an LLM coding agent that pipes stdin; forgetting `--yes` when automating setup on a new machine; newly added filters that were never trusted.","solutions":["Re-run with `rtk trust --yes` to trust the filters non-interactively, exactly as the message says.","If you want to review them, run `rtk trust` in an interactive terminal and confirm each filter at the prompt.","Set the environment override (TrustStatus::EnvOverride is accepted) if your deployment supports pre-trusting via env instead of the prompt.","If you do NOT want these filters enabled, remove or disable them in the filters.toml instead of trusting them."],"exampleFix":"// before (non-interactive, no flag)\n$ rtk trust\nError: Custom filters found but none enabled — re-run `rtk trust --yes`.\n\n// after\n$ rtk trust --yes\nFilters will now be applied.","handlingStrategy":"try-catch","validationCode":"import sys, os\n\ndef trust_needs_yes():\n    return not sys.stdin.isatty()  # non-interactive: --yes is required","typeGuard":null,"tryCatchPattern":"import subprocess, sys\ncmd = [\"rtk\", \"trust\"] + ([\"--yes\"] if not sys.stdin.isatty() else [])\nr = subprocess.run(cmd, capture_output=True, text=True)\nif r.returncode != 0 and \"none enabled\" in r.stderr:\n    r = subprocess.run([\"rtk\", \"trust\", \"--yes\"], capture_output=True, text=True)\nif r.returncode != 0:\n    raise RuntimeError(r.stderr)","preventionTips":["Always pass --yes when running `rtk trust` from scripts, CI, or AI agents.","Reserve interactive `rtk trust` (no flags) for human review at a real terminal.","Detect non-TTY stdin in automation and add --yes automatically.","After adding new filters to filters.toml, immediately re-run `rtk trust --yes` so they are enabled."],"tags":["cli","trust","interactive","filters"],"backgroundTag":"missing-required-flag","analyzedSha":"0924356b4caba4989607227b7c8824d3d8098719","analyzedAt":"2026-09-19T19:25:29.612Z","contentChangedAt":"2026-09-19T19:25:29.612Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}