Guardrails
Write rules that a snapshot must meet before it deploys, scope them to the places they protect, and use the production branch rule and its one-time bypass.
A guardrail is a rule your organization sets about what may reach a place: "production takes snapshots only from main", "nothing deploys during a freeze". It protects people from a mistake that a code review cannot catch, such as a branch that was never reviewed reaching production. A guardrail can only add requirements. It never removes one that another guardrail or a pipeline stage asks for, so the order rules are evaluated in never matters. Guardrails explains the model, and Exceptions and bypass below is how to get around one on purpose.
Open Guardrails in the sidebar. The page has the tabs Rules, Freezes (Freezes), Exceptions (Exceptions) and Evaluator.
What a guardrail governs
Guardrails are enforced for snapshots that arrive from git, for promotions, hotfixes and releases, and for a held snapshot when it is released. Each guardrail names the actions it governs. A restore meets only the guardrails that name it, and a freeze holds one only if it says so, because a restore is how an incident ends (Guardrails for restores). Two sections of the editor are not wired to the server (What the editor shows but does not save), and the rollback fast path relaxes nothing yet. The Evaluator tab asks the same engine, with the same rules, that a deploy asks.
How a decision is made
When a snapshot is about to deploy, Wardn collects every guardrail that applies to that deployment, checks each requirement, and reaches one of four outcomes:
| Outcome | Meaning |
|---|---|
| Allowed | Every requirement holds. The snapshot goes to the cluster. |
| Needs | Something can still satisfy it, such as an approval. |
| Wait | A fact Wardn needs is unknown right now, so it cannot judge. Nothing is refused: the deploy is tried again, and the reason names the missing fact. Wardn treats "unknown" as "not yet", never as "yes". |
| Blocked | A requirement does not hold. The snapshot is stored, shown as held by the guardrail and not applied. |
The decision, the rule versions it used and the facts it read are stored and linked from Activity (guardrail.blocked, guardrail.branch_blocked). The message names the guardrail and the requirement: Guardrail "Org freezes" holds this snapshot: No deploys during freezes. Drift snapshots are exempt: they record what a cluster runs, and nothing deploys them.
Pushing again renders a new snapshot, which is judged afresh. A snapshot held for approvals opens an approval request instead of waiting for a new push, and a bypass lets one snapshot through.
The Rules list
Each row shows the guardrail's name, Applies to (a tag per condition, or Everything), Covers (how many deployments, apps and clusters it reaches, after exceptions), the owner and the mode. Tiles count Owned by my team, Enforced, Warn only, Relaxes and With exceptions. Open a row with Open.
Write a guardrail
On Guardrails › Rules, choose New guardrail. Give it a name (up to 80 characters) in the title and pick the owner team in the header chip. Only the owner team (or the Owner of the organization, for a guardrail with no team) adds exceptions to it.
Under Applies to, add conditions. Each is a row of Field, Operator and Value, and all of them must hold. The coverage chips under the table ("41 deployments, 7 apps, 5 clusters") update as you edit, and say how many deployments exceptions leave out.
Under Requires, choose Add requirement and pick a type. Numbers take the strictest value when several guardrails ask.
Under Mode, choose Enforce, Warn only or Off.
Choose Create guardrail. Every later save is Save version N, and History lists the versions.
Start in Warn only. A warn-only guardrail records what it would have held ("Would have blocked 2 this month" in the list) and holds nothing, so you can see its reach before you enforce it.
Scope
A scope is a list of conditions, all of which must hold. The value of environment, app, team and pipeline is chosen by name in the editor and saved by id, so renaming something does not change what a guardrail covers.
| Field | Value | Operators |
|---|---|---|
class | An environment class, such as production | is, is_not, matches (a glob) |
environment | An environment | is, is_not |
cluster_label | key=value, such as region=eu | is, is_not |
app | An app | is, is_not |
team | A team | is, is_not |
pipeline | A pipeline | is, is_not |
An empty scope applies to everything. A scope row that points at something you cannot read shows A place you can't see.
Requirements
| Requirement | Settings | What it does |
|---|---|---|
protected_branch | A branch, or empty for the branch the git host protects | Holds a snapshot made from any other branch. |
no_freeze | none | Holds while a freeze covers the deployment. |
person_only | when: freeze or always | Holds when the requester is an agent, during a freeze or always. |
agent_autonomy | level: propose, act_with_approval or act | Holds when an agent acts with more autonomy than the level. Agents propose and a person releases; see Agents. |
approval | count 1 to 10, humanOnly | Holds until that many approvals are given on the snapshot's approval request. The requester's own approval never counts. |
group_approval | group: security or compliance, humanOnly | Holds until someone in the team called Security or Compliance approves. |
different_approver | none | The approver cannot be the person who asked. |
change_ticket | system: servicenow or jira | Holds until the attached change is approved in your change system. A system that cannot be read holds it as unknown. |
drift_revert | afterSeconds, 60 seconds to 7 days | Stored. To revert drift on a deployment, set its drift policy. |
rollback_fast_path | none | Only in a relaxing guardrail, below. |
previously_live, max_age (days, 1 to 3650), no_critical_vulns, approval_unless_incident (count, 1 to 10) | The requirements a restore meets; see Guardrails for restores. |
A requirement that needs a fact Wardn cannot read yet holds every deploy in the guardrail's scope until it can, because unknown is never a pass. An enforced guardrail that asks for approvals holds a deploy until the approvals are given; an enforced one that asks for no_critical_vulns holds every restore, because nothing scans snapshots yet. Use Warn only to try one.
Modes
| Mode | Effect |
|---|---|
| Enforce | A requirement that does not hold holds the snapshot. |
| Warn only | Records noted and holds nothing. |
| Off | The guardrail is skipped. |
Relaxing guardrails
A guardrail of kind relax, shown with a Relaxes tag, holds one requirement, rollback_fast_path: rolling back to a snapshot that already ran healthy on the same deployment skips approvals, tickets and second people. It narrows only those requirements, never the branch or freeze rules. Its condition, that the snapshot ran healthy on this deployment before, reads deployment history that Wardn does not record yet. The fact reads as unknown, so a relaxing guardrail relaxes nothing today and the other rules are judged as usual. This is the one requirement in this page that is still Preview.
What the editor shows but does not save
Two sections of the editor are not wired to the server. Who can bypass (the table of who may override the guardrail) is drawn from sample data and saves nothing: who may bypass is decided by the release:bypass duty, below, and not by a table. Holds on these paths (the switches for ad hoc promotions, agent actions and so on) is fixed: a guardrail holds on every path, and no switch turns one off. Treat the section as an explanation of the design.
The production protected-branch rule
Two guardrails exist in every organization from the start. Both are Default tags in the list: you can change their mode, owner and requirements, but you cannot rename or archive them.
| Built-in | Applies to | Requires |
|---|---|---|
| Protected branch for production | class is production | The snapshot comes from the protected branch. |
| Org freezes | Everything | No deploys during freezes. |
Protected branch for production applies to every environment whose class is production. It passes when the snapshot came from the branch named in the requirement or, if none is named, from a branch the git host reported as protected when the snapshot was made. For a repository that is not on GitHub the host cannot report this, so name a branch with the environment's branch guard below. The editor's requirement row has no setting for the branch.
A snapshot from another branch is blocked: stored, written to Activity as guardrail.branch_blocked and not applied. The check runs on a push, on a promotion into the environment, and when a held snapshot is released. Open its deployment's Snapshots tab to see it.
To use a different branch for one environment, set the environment's branch guard:
api "$WARDN_API_URL/api/v1/environments/$ENVIRONMENT_ID/branch-guard"
api -X PUT "$WARDN_API_URL/api/v1/environments/$ENVIRONMENT_ID/branch-guard" \
-d '{"enforced": true, "protectedBranch": "release"}'isDefault in the answer is true when nobody set it and the class decides. Setting it makes a rule of its own for that environment, and the built-in rule leaves the environment out. Changing it needs environment:manage. The web app has no field for it; the Protected branch for production guardrail is the screen to change the rule for all of production.
One-time bypass
A person with release:bypass can let one snapshot through the guardrails that hold it, once, with a reason. It is for the night the checkout is down and the fix is on a feature branch. A bypass is of one snapshot on one deployment, and the next snapshot meets the guardrails again.
api -X POST "$WARDN_API_URL/api/v1/deployments/$DEPLOYMENT_ID/snapshots/$SNAPSHOT_ID/bypass" \
-d '{"reason": "hotfix for the checkout outage"}'bypassSnapshot takes a reason of 1 to 1000 characters and answers with the snapshot, now on its way to the cluster. Activity records the person, the reason and the rules skipped as guardrail.bypassed.
- Which rules it skips. With no
ruleIds, a bypass skips every rule that holds the snapshot: the protected-branch rule, a freeze, a missing approval or a change ticket. NameruleIds(theruleIdon each rule line of a bypass request or an approval request) to skip only those; each must be holding the snapshot now (409 bypass.rule_not_holding), and a rule you did not name still holds it. A bypass that skips some rules and not others leaves the snapshot held. - When it is refused. A snapshot that nothing holds answers
409 guardrail.not_blocked. A snapshot that a guardrail cannot judge yet answers the waiting error, because a fact that is unknown holds nothing to bypass. A snapshot already bypassed answers409 bypass.already_granted. A snapshot also held for review must be released first (409 guardrail.held). - Agents never bypass. A bypass needs a person.
- A hotfix can break glass. A hotfix with the break-glass route records the same one-time bypass of whatever holds its snapshot, and needs
release:bypasstoo.
Someone without the duty asks for a bypass instead. requestSnapshotBypass (POST .../snapshots/{snapshotId}/bypass-requests, release:raise) takes the same body, and one request is open per snapshot. Someone who holds the duty at that deployment gets 409 bypass.use_direct and bypasses directly. The request appears in the web app under Approvals › Bypass requests, where a person who holds the duty and did not ask chooses Approve bypass or Deny, or with the API decideBypassRequest (POST /bypass-requests/{bypassRequestId}/decisions, {"decision": "grant"} or "decline" with a note). Granting lets the snapshot through once and records both people. If a newer snapshot has arrived, the request answers 409 approval.snapshot_changed. GET /bypass-requests lists them (state: open, granted, declined, superseded). Approvals covers approval requests, delegation and notifications.
The deployment's Snapshots tab has no bypass button. Ask for or grant a bypass through Approvals › Bypass requests, and bypass directly through the API.
release:bypass is a duty: the Admin role does not hold it, and a delegation of the approval duty does not pass it on. Grant it, on the environment, to the people who may break glass. See Roles and grants.
Exceptions and bypass
They answer different questions, and the words are not interchangeable.
| Exception | Bypass | |
|---|---|---|
| What it is | A standing carve-out: "this guardrail does not apply to this app, cluster, environment or deployment." | A one-time override of one blocked snapshot. |
| Lasts | Until an end date, or for good with a review date. | That snapshot only. |
| Who | The owner team of the guardrail (exception:manage). | A person with release:bypass, or someone who asks and a holder grants. |
| Recorded | Activity, and listed on Exceptions. | Activity, with the reason and the rules skipped. |
Use an exception when the rule is wrong for a place. Use a bypass when the rule is right and you have a reason to pass it once. A restore has its own bypass and break-glass, described below. Exceptions has the steps.
The Evaluator
The Evaluator tab answers "could this snapshot go to this environment now, and if not, why". Pick an app's deployment, an action, who asks and when, and Check. It runs the same decision enforcement runs and stores nothing.
The snapshot it judges is the one that would be promoted: the newest the stage before this one qualified, or, for a deployment whose stage has nothing qualified yet or that comes from no earlier stage, the newest available. The Result line names it (its commit), and the Snapshot picker above the verdict lets you judge another. Each rule that applies shows its verdict, grouped under Before entering, Approvals and Timing, and who set it ("Payments delivery › prod stage" for a pipeline stage). Hover the info mark beside a rule for the facts it read. Ways through says what would unblock it and whether the requester can, and For this actor says what they may do. A fact that cannot be read is shown as unknown and holds the answer at wait, and an approval nobody has given yet reads as Needed. For a freeze, Ways through lists the rows of the freeze's Who can bypass table that say bypass; the table only informs this screen, and whether someone can bypass is the release:bypass duty. Test rules on an environment or a pipeline opens it with the context filled in.
Where guardrails show up
- An environment's Guardrails tab lists every guardrail that reaches it: the Matched by conditions, how much of the environment each Covers, Exceptions here, owner and mode. Also applies: org-wide lists those with no scope. Active, recurring and planned freezes are listed beneath.
- A pipeline's Guardrails that will also apply lists the guardrails that reach its stages' environments.
Organization time zone
Freezes and windows set to "the organization's time zone" use it. It is UTC until you change it:
api "$WARDN_API_URL/api/v1/policy-settings"
api -X PUT "$WARDN_API_URL/api/v1/policy-settings" -d '{"timeZone": "Europe/Berlin"}'Changing it needs org:manage. The web app has no screen for it yet.
What a guardrail governs
The editor's Governs section has a switch for each action a guardrail can check, and the API takes them as actions:
| Action | What it covers | API |
|---|---|---|
| Releases | Promotions, hotfixes, ad hoc promotions and deploys | release |
| Rollbacks | Going back to the snapshot that ran before | rollback |
| Restores | Bringing back an older snapshot | restore |
| Emergency apply | Applying a change directly when a deployment can't sync | emergency_apply |
A guardrail saved before it named any actions governs releases and rollbacks, so none starts to hold restores on its own.
Which actions a requirement holds
The For column of Requires shows, for each requirement, which of the governed actions it holds. It is what the server evaluates, not a separate setting:
- The restore requirements (
previously_live,max_age,no_critical_vulns,approval_unless_incident) hold restores only. They read facts only a restore has, such as where the snapshot ran before, so a guardrail that governs releases and restores is not held on them for a release. Add requirement offers them once Restores is on, and the server refuses one on a guardrail that does not govern restores (400 guardrail.restore_requirement). - Every other requirement holds each governed action. An approval requirement on a guardrail that governs releases, rollbacks and restores holds all three.
- A drift revert holds no action: it reverts drift on the deployment. The rollback fast path relaxes rollbacks.
A restore is the way back from a bad deploy, so it meets only what you choose:
- A guardrail holds a restore only if Restore is under Governs.
- A freeze holds a restore only if you tick Also hold restores on it. The built-in Org freezes guardrail governs every action, and each freeze then decides for itself.
- Production-protecting rules written for releases, such as the protected-branch rule, do not apply to a restore unless they name it.
The requirements written for restores are previously_live, max_age, no_critical_vulns and approval_unless_incident, and the restore dialog lists each with where it comes from and whether it is met. Guardrails for restores has the sample rules, how a hold becomes an approval request, and how to get past one.
Restore bypass and incident break-glass
Two ways past a guardrail that holds a restore, both with restore:bypass on the deployment and a reason, both recorded in Activity:
| Bypass | Break-glass | |
|---|---|---|
| Needs | restore:bypass and a reason | restore:bypass, a reason and an open Sev 1 or Sev 2 incident linked to the restore (incidentId, an id or INC-12) |
| Skips | Every blocking finding, the guardrails that hold the restore and the preflight checks (a missing image, a missing secret) | Only the guardrails that hold the restore. If a preflight check also blocks, break-glass does not apply and the bypass is needed |
| Recorded | deployment.restore with the reason | deployment.restore marked breakGlass with the incident, and a restore.break_glass event to the notification routes |
A Sev 3 incident, a closed one or one that does not exist is not enough (409 restore.break_glass_refused). Restores are never throttled by quotas. A restore is a different path from the release bypass above, so release:bypass does not allow it and restore:bypass does not lift a release. For how an incident links to a restore, see Incidents.
Permissions
| Action | Permission |
|---|---|
| See guardrails, exceptions and freezes | guardrail:read (anyone who reads part of the organization) |
| Create, save, archive a guardrail; create or change a freeze; preview coverage | guardrail:manage |
| Add, change, review or end an exception | exception:manage on the guardrail's owner team |
| See an environment's guardrails | environment:read |
| Bypass the guardrails that hold a snapshot, once; grant or decline a bypass request | release:bypass |
| Ask for a bypass | release:raise |
| Restore past a guardrail, with or without an incident | restore:bypass |
| Change the organization time zone | org:manage |
Next
Exceptions
Excuse one place from a guardrail, with an end or a review date.
Freezes
Hold deploys for a period or on a schedule.
Restore and rollback
Guardrails for restores, bypass and incident break-glass.
Held snapshots
Release or discard a snapshot a guard is holding.
Related: Approvals, Releases, Guardrails concept, Environments, Restore and rollback.
Stage rules
What a stage asks of a snapshot before it enters, what it must show before the next stage accepts it, and how a promotion spreads across the stage's deployments.
Exceptions
Excuse one app, cluster, environment or deployment from a guardrail, with an end date or a review date, and keep the list honest.