Schema for Policies

A list of the inputs that are provided to the policy engine

Input Schema

Octopus has a set number of inputs that are provided to evaluate policies against deployments. The following is the full schema that is passed into the engine to evaluate deployments:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Octopus Policy input schema",
  "type": "object",
  "properties": {
    "Environment": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Slug": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Slug"
      ]
    },
    "Project": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Slug": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Slug"
      ]
    },
    "Space": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Slug": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Slug"
      ]
    },
    "Tenant": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Slug": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Slug"
      ]
    },
    "ProjectGroup": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Slug": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Slug"
      ]
    },
    "SkippedSteps": {
      "type": "array",
      "items": {}
    },
    "Steps": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "string"
          },
          "Slug": {
            "type": "string"
          },
          "ActionType": {
            "type": "string"
          },
          "Enabled": {
            "type": "boolean"
          },
          "IsRequired": {
            "type": "boolean"
          },
          "Source": {
            "type": "object",
            "properties": {
              "Type": {
                "type": "string"
              },
              "SlugOrId": {
                "type": "string"
              },
              "Version": {
                "type": "string"
              }
            },
            "required": [
              "Type",
              "SlugOrId"
            ]
          },
          "Packages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Id": {
                  "type": "string"
                },
                "Name": {
                  "type": "string"
                },
                "Version": {
                  "type": "string"
                },
                "GitRef": {
                  "type": "string"
                }
              },
              "required": [
                "Id",
                "Name"
              ]
            }
          }
        },
        "required": [
          "Id",
          "Slug",
          "ActionType",
          "Enabled",
          "IsRequired",
          "Source"
        ]
      }
    },
    "Release": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Version": {
          "type": "string"
        },
        "GitRef": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Version"
      ]
    },
    "Runbook": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string"
        },
        "Name": {
          "type": "string"
        },
        "Snapshot": {
          "type": "string"
        },
        "GitRef": {
          "type": "string"
        }
      },
      "required": [
        "Id",
        "Name",
        "Snapshot"
      ]
    }
  },
  "required": [
    "Environment",
    "Project",
    "Space",
    "SkippedSteps",
    "Steps", 
    "ProjectGroup"
  ]
}

Output Result Schema

Octopus expects the conditions Rego code to define a result object that confirms to the following schema:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Policy Result Schema",
  "type": "object",
  "properties": {
    "allowed": {
      "type": "boolean"
    },
    "reason": {
      "type": "string"
    },
    "action": {
      "type": "string",
      "enum": ["block", "warn"]
    }
  },
  "required": ["allowed"]
}

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Thursday, September 11, 2025