Modify a File

In this guide, you will modify an existing Guardrails File using the console UI. You can update the file's title, description, and content. When you save changes to a file's content, Guardrails automatically re-evaluates all calculated policies that reference it: no policy changes needed.

Prerequisites

Step 1: Navigate to the File

Find the file you want to modify. You can navigate to it from the parent folder's Resources tab, or search for it in the Resources page.

Step 2: Open the Edit Dialog

On the file's detail page, click Edit in the top-right corner. The Edit File dialog opens with the file's current name, description, and content.

Edit File dialog showing the current Name, Description, and Content fields with existing CIDR range data

[!NOTE] The AKA field is not shown in the edit dialog because it is immutable: once set during creation, it cannot be changed. This ensures that calculated policies referencing the file by AKA continue to work without modification.

Step 3: Update the File

Modify the fields you want to change:

FieldDescription
NameUpdate the display name. Max 64 characters.
DescriptionUpdate or add a description. Max 1,024 characters.
ContentEdit the YAML or JSON data in the Edit tab. The editor validates syntax in real time.

Click Update to apply the changes.

What Happens After Saving

When you update a file's content:

  1. Immediate update: The file's data is updated in Guardrails.
  2. Automatic re-evaluation: All calculated policies that reference this file via resource(id: "file_aka") are automatically re-evaluated. This may take a few minutes depending on the number of policies and resources affected.
  3. No policy changes needed: You don't need to modify or redeploy any policy settings. The policies pick up the new file data on their next evaluation cycle.

This is one of the key benefits of using files: you can change centralized data (like CIDR ranges, cost center mappings, or approved regions) in one place and have all referencing policies update automatically.

Troubleshooting

IssueSolution
Update button disabledMake a change to the name, description, or content. If the content has a YAML or JSON syntax error, fix the highlighted error in the editor.
Content must be an objectFile content must be a JSON object (e.g., {"key": "value"}). Scalar values like strings or numbers are not allowed.
Policies not updating after saveRe-evaluation may take a few minutes. Check the control's Activity tab to confirm re-evaluation is in progress.
Further assistanceOpen a Support Ticket

Next Steps