Create an Exception

In this guide, you will create a policy exception to override a parent policy setting for a specific resource. Exceptions are how you handle cases where a broad governance rule needs to be relaxed for particular resources, such as a legacy application that can't meet a compliance requirement, or a sandbox bucket where enforcement isn't appropriate.

An exception is not a special object in Guardrails. It's simply a Required policy setting created at a lower level in the resource hierarchy that overrides a Required setting at a higher level. The most specific Required setting always wins.

Prerequisites

How the Policy Hierarchy Works

Guardrails evaluates policy settings from the broadest scope down to the most specific:

Workspace Root
  └── Cloud Provider (e.g., GCP)
        └── Organization (goliathfederalbank.com)
              └── Project (goliathfederalbank)
                    └── Region (us-east1)
                          └── Bucket (goliath-bucket-1-goliathfederalbank)

When multiple settings exist for the same policy type at different levels:

This hierarchy is what makes exceptions possible: you create a more specific Required setting that takes priority over the broader one.

Step 1: Review the Current Policy Values

This example starts from a Required Check: Enabled setting for GCP > Storage > Bucket > Versioning on the goliathfederalbank project. Open that setting and select the Values tab to see the effective value for every bucket it governs. All five buckets inherit Check: Enabled from the project-level setting.

Policy setting Values tab showing all five GCP storage buckets with Check: Enabled

Step 2: Inspect the Policy Hierarchy

Click a bucket's Versioning value to open its Policy Value page. The Which policy setting is in effect for this value? section walks the hierarchy from the workspace root down to the bucket, marking each level that has a setting and highlighting the one that wins.

Here the Check: Enabled value comes from the project-level setting (goliathfederalbank), marked EFFECTIVE SETTING with Required precedence. Every level below it shows Create setting, so you can add an override at the region or the individual bucket.

Policy Value page for a bucket showing the project-level Check: Enabled marked as the effective setting

In this guide we'll add the exception at the bucket level so only goliath-bucket-1-goliathfederalbank is affected.

Step 3: Create the Exception

Next to the bucket in the hierarchy, click Create setting (or Create Setting at the top of the page). The Create Policy Setting form opens pre-filled with the policy type (Versioning) and the bucket as the resource.

Select Skip as the value and leave the precedence as Required. This is critical: a Recommended setting cannot override a parent Required setting.

Create Policy Setting form pre-filled for goliath-bucket-1 with Skip selected and Required precedence

FieldValueWhy
ValueSkipDisables versioning checks for this specific bucket.
PrecedenceRequiredMust be Required to override the parent Required setting at the project level.

[!TIP] Click Add expiration to make the exception temporary. When the date passes, Guardrails removes the exception and the bucket reverts to the parent policy value. Setting an expiration is a best practice for exceptions unless you have a permanent business reason for the override.

[!TIP] Click Add note to document the business justification (for example, "Legacy data pipeline uses unversioned buckets. Approved by security team, JIRA-1234.").

Click Create to save the exception.

Step 4: Verify the Exception

Reopen the bucket's Policy Value page. The hierarchy now shows two settings: the project-level Check: Enabled and the new bucket-level Skip. The bucket's Skip setting is marked EFFECTIVE SETTING, confirming the exception overrides the parent.

Policy Value page showing the bucket-level Skip setting marked as effective, overriding the project-level Check: Enabled

Return to the project setting's Values tab. It now reports 1 lower setting and lists only the four remaining buckets at Check: Enabled. The excepted bucket follows its own Skip setting and no longer inherits the project value.

Project setting Values tab showing 4 values at Check: Enabled and 1 lower setting

Via Terraform

Managing exceptions in Terraform keeps your governance configuration auditable and version-controlled. Create a second turbot_policy_setting resource at the more specific scope:

# Parent setting: check versioning across the project
resource "turbot_policy_setting" "gcs_versioning_check" {
  resource   = "gcp://cloudresourcemanager.googleapis.com/projects/goliathfederalbank"
  type       = "tmod:@turbot/gcp-storage#/policy/types/bucketVersioning"
  value      = "Check: Enabled"
  precedence = "required"
  note       = "Project-wide GCS versioning check"
}

# Exception: skip versioning check for the legacy data pipeline bucket
resource "turbot_policy_setting" "gcs_versioning_exception" {
  resource   = "gcp://storage.googleapis.com/projects/goliathfederalbank/buckets/goliath-bucket-1-goliathfederalbank"
  type       = "tmod:@turbot/gcp-storage#/policy/types/bucketVersioning"
  value      = "Skip"
  precedence = "required"
  note       = "Legacy data pipeline, approved by security team, JIRA-1234"
}

Troubleshooting

IssueSolution
Exception not overriding the parentCheck that the exception uses Required precedence. A Recommended setting cannot override a parent Required setting.
Controls still show alarms after the exceptionAllow a few minutes for re-evaluation. If alarms persist, verify the exception targets the correct resource in the hierarchy.
Exception expired but the setting still existsExpiration processing runs periodically. If the setting persists after its expiration date, allow a few more minutes or delete it manually.
Too many exceptions making policy hard to manageConsider restructuring your hierarchy. Move resources that need different treatment into a separate folder with its own policy setting, rather than creating individual exceptions.
Further assistanceOpen a Support Ticket

Next Steps