Nevermind, found the solution through the AI assistant:
"if you update the "Experiment Assignment Queries" in your Data Source to exclude certain `anonymous_id`s, then any A/B test (experiment analysis) that uses this Data Source will only include users/subjects that pass the conditions in your assignment query.
However, if you run the metric on its own (outside the context of an experiment), the metric query will not be affected by the assignment query and will include all data unless you also add exclusion logic to the metric SQL itself."