{"record":{"id":"d46d8cfef53f866f","repo":"rtk-ai/rtk","slug":"no-custom-filters-found-rtk-filters-toml-or-c","errorCode":null,"errorMessage":"No custom filters found (.rtk/filters.toml or ~/.config/rtk/filters.toml)","messagePattern":"No custom filters found \\(\\.rtk/filters\\.toml or ~/\\.config/rtk/filters\\.toml\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"src/hooks/trust.rs","lineNumber":311,"sourceCode":"\n        print_filter_notice(&filter_path, scope, &filters);\n        print_risk_summary(&content);\n\n        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(),","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/rtk-ai/rtk/blob/d977e1c31621fe8704e6500ceeb9c7a0de2b6836/src/hooks/trust.rs#L293-L329","documentation":"rtk trust only operates on the two well-known custom-filter paths (.rtk/filters.toml, ~/.config/rtk/filters.toml). If neither exists — or the ones that exist parse cleanly but contain zero active filters — there is nothing to trust and the command exits with this message. Built-in rtk filters never require trust.","triggerScenarios":"Running `rtk trust` before creating any custom filter file, or from a directory where the project-level .rtk/filters.toml is not visible — bail at src/hooks/trust.rs:311.","commonSituations":"Confusing built-in filters (git/cargo compressors) with custom TOML filters; running trust outside the repo root.","solutions":["Create .rtk/filters.toml (project) or ~/.config/rtk/filters.toml (user) with [filters.*] entries","Re-run `rtk trust` from the repo root if the file already exists","If you have no custom filters, treat this exit as expected — there is nothing to do"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# bash: skip trust entirely when no custom filters exist\n[ -f .rtk/filters.toml ] || [ -f \"$HOME/.config/rtk/filters.toml\" ] \\\n  || { echo 'no custom filters — nothing to trust'; exit 0; }\nrtk trust --yes","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `rtk trust` from the repo root so the project-level .rtk/filters.toml is found","Remember built-in filters never need trust — only .rtk/filters.toml and ~/.config/rtk/filters.toml"],"tags":["trust","filters","usage","no-op"],"backgroundTag":null,"analyzedSha":"d977e1c31621fe8704e6500ceeb9c7a0de2b6836","analyzedAt":"2026-08-16T05:40:46.291Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}