Create a File

In this guide, you will create a Guardrails File using the console UI. Files store custom JSON data: such as CIDR ranges, cost center mappings, or environment labels: that calculated policies can reference by name. When you update the file data, Guardrails automatically re-evaluates all policies that reference it.

Prerequisites

Step 1: Open the Create File Dialog

Navigate to the folder where you want to create the file. Click New in the top-right corner, then select File as the Resource Type. The Create File dialog opens.

[!TIP] Files can be created at any level in the resource hierarchy: the workspace root or any folder. A common pattern is to create files in a dedicated folder (for example, "Demo" or "Configuration") to keep them organized.

Step 2: Configure the File

Fill in the file details:

Create File dialog showing Name, Description, AKA, and Content fields with CIDR range data in YAML format

FieldDescription
NameA display name for the file (for example, "Approved CIDR Ranges"). Required. Max 64 characters.
DescriptionAn optional description of the file's purpose. Max 1,024 characters.
AKAA unique alias (AKA) that policies use to reference this file (for example, goliath-cidrs). Required. Max 128 characters. Must be globally unique across all resources in the Guardrails CMDB, not just files. This value is immutable: it cannot be changed after creation, so choose carefully.
ContentThe file data in YAML or JSON, entered in the Edit tab (use Preview to review). The editor validates syntax and highlights errors. Content is stored internally as JSON regardless of the input format. Must be a JSON object: scalar values (strings, numbers) are not allowed.

[!IMPORTANT] The AKA is how calculated policies reference the file, for example resource(id: "goliath-cidrs") in a GraphQL template input query. The AKA must be unique across all resources in the workspace, not just files: if an AWS ARN, GCP resource name, or another file already uses this AKA, creation will fail. Choose a short, descriptive, lowercase name. Once created, the AKA cannot be changed.

Click Create to save the file.

Step 3: Verify the File

After creation, Guardrails opens the file's detail page. The Explore tab shows the file's breadcrumb (its parent folder) and its Data in YAML or JSON. Switch to the Detail tab for the file's AKA, timestamps, and metadata.

File detail page showing the Approved CIDR Ranges file under the Demo folder with its YAML data

The file is now ready to be referenced in calculated policies. See Use a File in a Calculated Policy for how to query file data in policy templates.

Next Steps