rtk-ai/rtk · error

Custom filters found but none enabled — re-run `rtk trust…

Error message

Custom filters found but none enabled — re-run `rtk trust --yes`.

What it means

`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.

Solutions

  1. Re-run with `rtk trust --yes` to trust the filters non-interactively, exactly as the message says.
  2. If you want to review them, run `rtk trust` in an interactive terminal and confirm each filter at the prompt.
  3. Set the environment override (TrustStatus::EnvOverride is accepted) if your deployment supports pre-trusting via env instead of the prompt.
  4. If you do NOT want these filters enabled, remove or disable them in the filters.toml instead of trusting them.

Example fix

// before (non-interactive, no flag)
$ rtk trust
Error: Custom filters found but none enabled — re-run `rtk trust --yes`.

// after
$ rtk trust --yes
Filters will now be applied.
Defensive patterns

Strategy: try-catch

Validate before calling

import sys, os

def trust_needs_yes():
    return not sys.stdin.isatty()  # non-interactive: --yes is required

Try / catch

import subprocess, sys
cmd = ["rtk", "trust"] + (["--yes"] if not sys.stdin.isatty() else [])
r = subprocess.run(cmd, capture_output=True, text=True)
if r.returncode != 0 and "none enabled" in r.stderr:
    r = subprocess.run(["rtk", "trust", "--yes"], capture_output=True, text=True)
if r.returncode != 0:
    raise RuntimeError(r.stderr)

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19). Data as JSON: /api/errors/3a24adc00da6398d. Report an issue: GitHub.

Appendix: source

Thrown at src/hooks/trust.rs:315

        if !(yes || confirm_enable_at_tty()?) {
            eprintln!("  Not enabled — re-run `rtk trust --yes` to trust non-interactively.");
            continue;
        }
        let hash = crate::hooks::integrity::compute_hash_bytes(&bytes);
        trust_filter_with_hash(&filter_path, &hash)?;
        enabled_any = true;
        eprintln!("  Enabled — revoke with `rtk untrust`.");
    }

    if !found_any {
        if had_error {
            anyhow::bail!("Filter file present but not valid TOML — see the error above.");
        }
        anyhow::bail!("No custom filters found (.rtk/filters.toml or ~/.config/rtk/filters.toml)");
    }
    if !enabled_any {
        if !interactive {
            anyhow::bail!("Custom filters found but none enabled — re-run `rtk trust --yes`.");
        }
        return Ok(());
    }
    println!("Filters will now be applied.");
    Ok(())
}

pub fn print_filter_notice(path: &Path, scope: &str, filters: &[(String, String)]) {
    let yellow = "\x1b[33m";
    let reset = "\x1b[0m";
    eprintln!();
    eprintln!(
        "{yellow}Detected {} custom {scope} scoped toml filter(s) in {} — they rewrite matching command output:{reset}",
        filters.len(),
        path.display()
    );
    for (name, regex) in filters {
        eprintln!("{yellow}    {name:<20} {regex}{reset}");

View on GitHub (pinned to 0924356b4c)