> ## Documentation Index
> Fetch the complete documentation index at: https://statsig-4b2ff144-serverless-cloudflare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Safeguard

> Learn how to create a Safeguard on one or multiple targeting rules within a Feature Gate to monitor regressions and automatically take action when alerts fire.

You can create a Safeguard on one or multiple targeting rules within a Feature Gate. To create a Safeguard on a rule, follow the steps below:

1. Go to a Feature Gate's **Setup** tab

2. Pick a targeting rule for which you want to monitor regressions

3. Click the three-dot (...) menu and choose **'Safeguard Rule'**

   <Frame>
     <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/0ENSucKrRSrgZacm/images/safeguards/create-safeguard.png?fit=max&auto=format&n=0ENSucKrRSrgZacm&q=85&s=30b9fedde319e75864faed37eae6abdf" alt="Create Safeguard on a rule" width="1226" height="288" data-path="images/safeguards/create-safeguard.png" />
   </Frame>

4. Choose the action to take when alerts fire:

   * **Rollback to 0%** - Assign Default value to all users
   * **Roll out to 100%** - Assign Pass value to all users
   * **Pause Rollout** - Stop scheduled rollout progression (only available with active Schedule Rollout policy)

   <Frame>
     <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/0ENSucKrRSrgZacm/images/safeguards/choose-safeguard-action.png?fit=max&auto=format&n=0ENSucKrRSrgZacm&q=85&s=fe00b3492b833c3327ec07efc8dc4b41" alt="Select an action" width="1230" height="608" data-path="images/safeguards/choose-safeguard-action.png" />
   </Frame>

5. (Optional) Set how long to monitor alerts for safeguarding the rule:

   | Alert type    | Evaluation period | Evaluation start time                           |
   | ------------- | ----------------- | ----------------------------------------------- |
   | Topline alert | Choose your own   | Starts when the safeguard is created            |
   | Rollout alert | Fixed (90 days)   | Starts whenever targeting rule's pass % changes |

   <Frame>
     <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/0ENSucKrRSrgZacm/images/safeguards/evaluation-period.png?fit=max&auto=format&n=0ENSucKrRSrgZacm&q=85&s=92ddc1b8a636671ffb6de13d3a0b704c" alt="Set evaluation period" width="1230" height="610" data-path="images/safeguards/evaluation-period.png" />
   </Frame>

   <Tip>**Recommended:** Ideally you want to monitor topline alerts for crashes, errors, latency, etc. *for a few days* after a Feature Gate rollout to make sure things are stable. We recommend starting with a 14-day evaluation period.</Tip>

6. Select one or more alerts to monitor:

   * Rollout alerts - For feature-specific regression detection
   * Topline alerts - For system-wide health monitoring

   <Frame>
     <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/0ENSucKrRSrgZacm/images/safeguards/add-alerts.png?fit=max&auto=format&n=0ENSucKrRSrgZacm&q=85&s=57f8decfc96e4a003d231b6ec5ed1e89" alt="Add alerts for your Safeguard" width="1228" height="864" data-path="images/safeguards/add-alerts.png" />
   </Frame>

7. Click **Save**
