[Yandex Cloud documentation](../../index.md) > [Yandex Smart Web Security](../index.md) > [Step-by-step guides](index.md) > Required and recommended rules > Rule for captcha

# Rule for Yandex SmartCaptcha

Set up a rule to redirect requests to [SmartCaptcha](../../smartcaptcha/index.md) for verification.

{% note info %}

If the `Deny` action is set for the default basic rule and the requests are sent to SmartCaptcha for verification, add a basic rule that allows requests to the CAPTCHA. The address of the allowed request matches the regular expression: `/tmgrdfrend.*`. Set the rule to have a higher priority than rules with a CAPTCHA challenge.

{% endnote %}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../resource-manager/concepts/resources-hierarchy.md#folder).
  1. Navigate to **Smart Web Security**.
  1. In the left-hand panel, click ![image](../../_assets/console-icons/shield.svg) **Security profiles** and select the profile.
  1. Click ![image](../../_assets/console-icons/plus.svg) **Add rule** and in the window that opens:
     
     1. Enter a name for the rule, e.g., `allow-captcha`.
     1. Set **Priority** higher than that of the rules sending requests to captcha checks.
     1. Enable **Only logging**.
     1. Specify the rule settings:
     
        * **Type**: `Base`.
        * **Action**: `Allow`.
        * **Traffic**: `On condition`.
        * **Conditions**: `Request URI`.
        * **Request path**: `Matches the regular expression`.
        * Enter the `/tmgrdfrend.*` expression.
     
     1. Click **Add**.

{% endlist %}

### Useful links {#see-also}

* [Creating a security profile](profile-create.md)
* [Adding a rule to a security profile](rule-add.md)