<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs" -->

---
title: Octopus Easy Mode - Policies | daily.dev
description: A hands-on walkthrough shows how to use Octopus Deploy's Platform Hub to define and enforce Open Policy Agent (OPA) policies written in Rego. The guide creates...
canonical: https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Octopus Easy Mode - Policies | daily.dev
og:description: A hands-on walkthrough shows how to use Octopus Deploy's Platform Hub to define and enforce Open Policy Agent (OPA) policies written in Rego. The guide creates...
og:url: https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs
og:image: https://api.daily.dev/og/posts/a2Bj9tgHs.png
og:image:alt: Octopus Easy Mode - Policies
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Octopus Easy Mode - Policies

**[OctopusDeploy](https://daily.dev/sources/octopusdeploy)** · 7 min read · 1 upvotes · 0 comments

## Summary

A hands-on walkthrough shows how to use Octopus Deploy's Platform Hub to define and enforce Open Policy Agent (OPA) policies written in Rego. The guide creates a policy requiring a Self-Support process template to exist in all deployment projects, covering both Scope Rego (which projects the policy applies to) and Conditions Rego (the policy logic itself). It demonstrates publishing the policy in warning mode to identify non-compliant projects via the audit log without disrupting deployments, then switching the Violation Action to Block to enforce compliance and fail non-conforming deployments. The piece closes with notes on setting up subscriptions for notifications and moving the policy into a real Git repository.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://octopus.com/blog/octo-easy-mode-22-policy>

## Questions this post answers

### How do I write an Open Policy Agent Rego policy in Octopus Platform Hub to require a specific process template step in every project?

Define a Conditions Rego package that defaults result to {"allowed": false}, then sets allowed to true when a step exists with Source.Type == "Process Template", a matching Source.SlugOrId (for example "self-support"), the step is not in SkippedSteps, and the step is Enabled == true. Pair this with a Scope Rego block, such as input.Space.Id == "Spaces-1234", to limit which projects the policy applies to.

_daily.dev surfaces practical guides like this for teams rolling out deployment governance policies._

### How can I test a new deployment policy in Octopus without breaking existing production deployments?

Publish the policy with the Violation Action set to Warning instead of Block. Deployments will still succeed, but any that fail the policy conditions get logged as a warning in the audit log, filterable by the event category 'Compliance Policy evaluated as non-compliant with warning outcome', letting you identify noncompliant projects before switching to enforcement.

_Anyone rolling out governance changes gradually can find rollout patterns like this via daily.dev._

## Similar posts on daily.dev

- [Introducing Starter Policies in Platform Hub](https://daily.dev/posts/introducing-starter-policies-in-platform-hub-mj3maap5r) · OctopusDeploy · 0 upvotes · 0 comments
- [How to Govern AI-Generated Infrastructure with Policy as Code and OPA \[Full Handbook\]](https://daily.dev/posts/how-to-govern-ai-generated-infrastructure-with-policy-as-code-and-opa-full-handbook--cgwuxyobm) · freeCodeCamp · 1 upvotes · 0 comments
- [Policies are now Generally Available](https://daily.dev/posts/policies-are-now-generally-available-blzzndykf) · OctopusDeploy · 1 upvotes · 0 comments
- [Governance That Ships: Embedding Policy as Code Into Your System of Record](https://daily.dev/posts/governance-that-ships-embedding-policy-as-code-into-your-system-of-record-k5du9rdlm) · JFrog · 0 upvotes · 0 comments
- [What Is Open Policy Agent? Best Practices and Use Cases](https://daily.dev/posts/what-is-open-policy-agent-best-practices-and-use-cases-wqsdtv48j) · Orca Security Blog · 0 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#cicd](https://daily.dev/tags/cicd), [#policy-as-code](https://daily.dev/tags/policy-as-code), [#octopus-deploy](https://daily.dev/tags/octopus-deploy)

[View this post on daily.dev](https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Octopus Easy Mode - Policies","url":"https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs"},"datePublished":"2026-08-17T11:20:14.915Z","dateModified":"2026-09-14T08:06:38.715Z","description":"A hands-on walkthrough shows how to use Octopus Deploy's Platform Hub to define and enforce Open Policy Agent (OPA) policies written in Rego. The guide creates...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/338b2b77277598c0a320d5284270b72c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/338b2b77277598c0a320d5284270b72c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"OctopusDeploy","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"OctopusDeploy","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/71110ae886d64eac9f3a01496feb2bd8","url":"https://daily.dev/sources/octopusdeploy"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,cicd,policy-as-code,octopus-deploy","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"OctopusDeploy","item":"https://daily.dev/sources/octopusdeploy"},{"@type":"ListItem","position":3,"name":"Octopus Easy Mode - Policies"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/octopus-easy-mode---policies-a2bj9tghs#faq","mainEntity":[{"@type":"Question","name":"How do I write an Open Policy Agent Rego policy in Octopus Platform Hub to require a specific process template step in every project?","acceptedAnswer":{"@type":"Answer","text":"Define a Conditions Rego package that defaults result to {\"allowed\": false}, then sets allowed to true when a step exists with Source.Type == \"Process Template\", a matching Source.SlugOrId (for example \"self-support\"), the step is not in SkippedSteps, and the step is Enabled == true. Pair this with a Scope Rego block, such as input.Space.Id == \"Spaces-1234\", to limit which projects the policy applies to. daily.dev surfaces practical guides like this for teams rolling out deployment governance policies."}},{"@type":"Question","name":"How can I test a new deployment policy in Octopus without breaking existing production deployments?","acceptedAnswer":{"@type":"Answer","text":"Publish the policy with the Violation Action set to Warning instead of Block. Deployments will still succeed, but any that fail the policy conditions get logged as a warning in the audit log, filterable by the event category 'Compliance Policy evaluated as non-compliant with warning outcome', letting you identify noncompliant projects before switching to enforcement. Anyone rolling out governance changes gradually can find rollout patterns like this via daily.dev."}}]}
```

