# Inverting conditions in Locksmith

There are many instances in which it is useful for a key to grant access if the *opposite* of your key condition is true.

Locksmith makes it easy to invert keys. To do so, simply click the box next to "invert" when you're editing the key:

<figure><img src="/files/CsoPSw2MHqs9LBGXRxQg" alt=""><figcaption></figcaption></figure>

Notice that when this is done, the wording will update, inverting the key condition logic:

<figure><img src="/files/igGMnvCAVqEpWxIuZoom" alt=""><figcaption></figcaption></figure>

Make sure to "Save" the lock, and you're done!

As always, **feel free to contact us via email** at <team@uselocksmith.com>.<br>

{% hint style="info" %}
**A note on inverted customer account keys**

When you invert a [customer account key condition](/keys/customer-account-keys.md) — such as "is tagged with," "has purchased," or "email contains" — the inverted key will also grant access to visitors who are **not** signed in, since they technically meet the inverted condition — they have no customer account details (tags, email, purchase history, etc.) associated with them.

If you want to require sign-in, combine the inverted condition with an "is signed in" condition inside the same key:

[Combining key conditions](/keys/more/combining-key-conditions.md)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.locksmith.guide/keys/more/inverting-conditions-in-locksmith.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
