Create a custom policy
Build your own approve or flag policy in four steps, preview what it matches in your estate, and publish it.
Build a custom policy when the policy packs don't decide something you care about, such as an owner tag your teams must set. By the end of this page you will have scoped a policy, written its conditions, chosen what happens to matches, checked the impact against your live estate and published it.
Anyone in the workspace can build and preview a policy. Only admins and the workspace owner can publish one.
Open Policies, then Create. You can also select Create policy on the Manage view, or on the Custom tab of Explore.
The builder is a single page with four numbered steps. The Impact preview beside them is live: it re-runs your draft against your estate as you edit.

Start from a template offers ready-made drafts, each with a count of what it would match today:
| Template | What it does |
|---|---|
| EC2 with a public IP and no owner | Flags EC2 instances that have a public IP and no owner tag. High severity. |
| S3 buckets without encryption | Flags S3 buckets without encryption at rest. Critical severity. |
| Security groups open to the internet | Flags security groups with an inbound rule open to the internet. Critical severity. |
| Resources in approved AWS accounts | Approves every AWS resource in an account on Approved AWS accounts. |
A template only fills in the steps; change anything before you publish. To build from nothing, skip the templates and start at step 1.
Select what to evaluate
The policy only ever sees assets inside this scope.
- Provider: the integration the policy covers. The list shows the integrations a policy pack covers. Octic shows how many assets it has observed for it.
- Resource types: All types, or up to 10 specific types such as S3 buckets or IAM roles.
- Advanced, then Service: narrow to one service, such as
s3. Leave*to cover every service.
The step's heading shows how many assets are in scope.
Define conditions
Conditions read attributes Octic has observed on the assets in scope. Select Add your first condition, then search for an attribute, such as owner, public or encryption. The search shows how many assets carry each attribute and the values it takes. If the attribute you need isn't listed, type its full dot path, such as
attrs.foo.bar.Conditions sit in two groups:
- Match when ALL of these hold: every condition must be true.
- …and at least ONE of these: select Add an ANY group for "at least one of" logic.
Each group holds up to 10 conditions. Pick an operator for each one:
Operator Works on Holds when the attribute is text, numbers, true/false equals the value is not text, numbers, true/false differs from the value is one of text, numbers equals any of up to 50 values exists any is present does not exist any is missing is on allowlist text is on one of your trust lists is not on allowlist text isn't on the chosen trust list, or is missing matches regex text matches a regular expression Values and patterns are limited to 256 characters. The builder warns when a condition holds for every asset in scope or can never hold.

Set the outcome
Choose the Action:
- Flag: opens a finding for each matched asset. A flag outranks any approval.
- Approve: matched assets are approved, unless a managed or custom policy also flags them.
A flag policy also takes:
- Severity: Low, Medium, High or Critical. It sets the severity of the findings the policy opens, and so their due date, and how hard a match pushes the asset's risk score.
- Risk factor: the factor the evidence counts under in the asset's risk score: Configuration hygiene, Access scope, Data exposure, Provenance, Vendor trust or Activity. See Risk scores.
Approve policies carry no severity or risk factor.

Name and publish
- Title: 3 to 120 characters. It appears on every finding and verdict the policy produces.
- Description: optional, up to 500 characters. Say why the policy matters, for whoever triages its findings.
Policy reads as spells out the whole policy in one sentence. Read it before you publish. When it reads right, select Publish policy.
The Impact preview runs your draft against your estate as you edit. Its headline shows how many assets in scope match and what would happen to them, such as how many findings would open and at what severity. Below it:
- Funnel: how many assets are In scope, how many pass the ALL and ANY groups, and how many are Matched.
- Per condition: how many assets in scope pass each condition alone, with the most selective one marked.
- Against open findings (flag) or Against current approvals (approve), when you edit a published policy: how the draft differs from the published version, such as how many findings are already open and how many would close.
- Matched sample: a sample of the assets that match, each linked to its page.
When you select Publish policy, a confirmation shows the scope, outcome, conditions and match count. Select Keep editing to go back, or confirm to publish. Octic then re-evaluates your estate; trust states and findings update when the run finishes.
Open the policy from the Custom tab or the Manage view, then select Edit in the builder. Change any step and select Save and re-evaluate. Each save makes a new version of the policy.
To delete it, open it in the builder and select Delete, then Delete policy. Octic stops evaluating it, and assets it matched may change state.
To stop a policy without deleting it, switch it off. See Manage policies.
Last updated
Was this page helpful?


