# Agent query targeting rule exceptions

**URL:** <https://forum.buildkite.community/t/agent-query-targeting-rule-exceptions/1253>\
**Category:** Features Requests\
**Created:** [September 23, 2020, 9:10pm UTC](https://forum.buildkite.community/t/agent-query-targeting-rule-exceptions/1253 "2020-09-23T21:10:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommeier](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/tommeier/32/869_2.png) [@tommeier](https://forum.buildkite.community/u/tommeier)\
**Post date:** [September 23, 2020, 9:10pm UTC](https://forum.buildkite.community/t/agent-query-targeting-rule-exceptions/1253/1 "2020-09-23T21:10:55Z")

</div>

Hi,

I’d really love to have _exceptions_ to targeting rules applied to agents ([https://buildkite.com/docs/agent/v3/queues#targeting-a-queue](https://buildkite.com/docs/agent/v3/queues#targeting-a-queue)) . This is currently a ‘must have whatever scoped in agent metatags’ list, I’d like to say “whatever scoped in agent metatags list _unless_ they have this”.

Context:

We have ~40 mac minis running native builds, say they’re targetted with `mac_mini=true` - sometimes the hardware fails or performance decreases to a point where they’re still useful to package builds but not to run GUI tests.

Ideal scenario:

```auto
mac_mini=true
!host_name=slow.mac.mini

```

---

<div class="post-metadata">

**Author:** ![petemounce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/petemounce/32/339_2.png) [@petemounce](https://forum.buildkite.community/u/petemounce)\
**Post date:** [September 23, 2020, 10:05pm UTC](https://forum.buildkite.community/t/agent-query-targeting-rule-exceptions/1253/2 "2020-09-23T22:05:42Z")

</div>

If you inverted your logic, would that work ok?

```auto
mac_mini=true
mac_is_healthy_for_general=true # flip to false if mac degrades
mac_is_ok_for_packaging=true

```

---

<div class="post-metadata">

**Author:** ![tommeier](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/tommeier/32/869_2.png) [@tommeier](https://forum.buildkite.community/u/tommeier)\
**Post date:** [September 23, 2020, 10:17pm UTC](https://forum.buildkite.community/t/agent-query-targeting-rule-exceptions/1253/3 "2020-09-23T22:17:25Z")

</div>

yup definitely - and what I’m looking to do now - but would be better to have the ability to scope via code in pipeline - rather than updating ‘x’ number of agent configs
