Guardrails

Rules that decide whether a snapshot may go somewhere, with exceptions, one-time bypasses and freezes.

A guardrail is a rule about where a snapshot may go and what must be true first. "Production takes snapshots only from a protected branch" is a guardrail. So is "no deploys during a freeze". Guardrails are how a platform team makes the safe thing the default without standing in every deploy.

The protected-branch rule for production is described in Environments. Requirements that need approvals, a change ticket or a second person hold a snapshot until they are given; What is built lists the few parts that are not yet wired.

The mental model

 a snapshot is about to go to a deployment
        │
        ▼
 for each guardrail:  does it apply here?   (its scope)
                          │ yes
                          ▼
                      are its requirements met?
        ┌─────────────────┼─────────────────────┐
     allowed         needs / waits           blocked
                     (a person can add        (recorded in
                      what is missing)         Activity)

Every deploy, promotion and release is checked this way, and so is a restore, but only by the guardrails that say they govern restores. The result is stored with the rules and facts it was judged by, so Activity can show why a snapshot was stopped.

Anatomy of a guardrail

PartMeaning
Applies toThe scope: conditions that must all hold, each on a field (class, environment, cluster label, app, team, pipeline) with an operator and a value. No conditions means everything.
RequiresWhat must be true for a snapshot to go ahead: an approval, a group approval, a person rather than an agent, a limit on an agent's autonomy, a protected branch, no active freeze, a change ticket, a different approver from the requester, a drift revert, or a rollback fast path.
ModeEnforce holds and blocks. Warn only records what it would have blocked and holds nothing. Off does nothing.
GovernsThe actions it applies to: release, restore, rollback or emergency apply. A guardrail that never named any governs release and rollback, so a restore, which is how an incident ends, is held only by a guardrail written for it.
OwnerThe team that owns the guardrail, or the organization. Only the owner manages its exceptions.
VersionEach save is a new version. A stored decision names the exact version it used.

A guardrail can be of two kinds. A rule adds requirements. A relaxing guardrail, such as a rollback fast path, narrows only the requirements for approval, a ticket or a second person, under a condition.

Two properties that matter

  • Rules only add. A guardrail can add a requirement and never remove one. Two guardrails that both apply both have to be met, and numeric requirements take the strictest value. There is no way to weaken a rule by adding another, so the effect of adding a guardrail is always at least as safe.
  • Unknown facts wait. If Wardn cannot tell whether a requirement holds, such as when a fact source is down, the change waits and is retried; Activity shows which fact is missing. It is never allowed on a guess and never blocked permanently on one.

The outcomes, from least to most restrictive, are allowed, needs (a person can still approve or attach what is missing), wait and blocked.

Built-in guardrails

Two exist in every organization once you open Guardrails. Their mode, owner and requirements can change; they cannot be renamed or archived.

NameDoes
Protected branch for productionEnvironments of class production take snapshots only from a protected branch.
Org freezesNo deploys while a freeze covers the deployment.

An environment's own branch setting becomes a rule of its own and takes that environment out of the built-in rule.

Exceptions: a standing carve-out

An exception says "this guardrail does not apply to this place". It narrows where the guardrail applies; it does not remove the guardrail or change what it requires.

PartMeaning
TargetAn app, cluster, environment or deployment.
ReasonWhy, in words.
LastsAn end date, or permanent.
Review dateWhen someone must look at it again. With no end date, a review is set six months out.
Added byRecorded with the exception.

An exception with an end date stops applying on that date by itself. Only the guardrail's owning team can add one, which is why a platform team can keep a rule that application teams cannot loosen. An exception that is past its review date shows as Review overdue, and ended exceptions stay in the list.

Use an exception when the rule is wrong for a place for a long time, for example a sandbox environment that does not need an approval.

Bypass: a one-time override

A bypass lets one blocked snapshot through on one deployment, once, with a reason. It changes no rule and leaves no standing difference. It is for the night the checkout is down and the fix is on a feature branch.

ExceptionBypass
What it isA standing carve-out from a guardrailA one-time override of one release
ScopeA place, for as long as it lastsOne snapshot on one deployment
ReviewHas a review dateRecorded once, with its reason
WhoThe guardrail's owning team (exception:manage)Someone holding the bypass duty (release:bypass), or someone who asks and a holder grants
RecordedActivity, with who added itActivity, as guardrail.bypassed, with the reason and the rules skipped

A bypass skips the rules that hold the snapshot: the protected-branch rule, a freeze, an approval or a ticket. It can name only some of them, and a rule it does not name still holds the snapshot. People without the duty ask for a bypass and a holder, who is never the person who asked, grants or declines it. Agents never bypass. See One-time bypass and Releases and approvals.

A restore has its own override. Someone with restore:bypass restores past a hold with a reason. With an open Sev 1 or 2 incident linked, that is break-glass: it goes past only the guardrails, is marked in Activity with the incident, and the notification routes are told. See Restore and rollback.

release:bypass and restore:bypass are duties. An Admin does not hold them unless designated, and covering a duty with a delegation applies to approving, not to bypass. See the access model.

Freezes

A freeze holds deployments for a period. It is a window of "no changes", such as the end of a quarter, or every Friday from 14:00.

SettingMeaning
CoversThe same scope rows as a guardrail: which deployments the freeze holds.
WhenOne time (start and end) or Recurring. A recurring freeze repeats weekly on the weekday of its start, between the two times.
Time zoneUTC, each cluster's local time, or a named zone. Daylight saving time is handled.
Releases already rollingPause or let them finish. Recorded; a release's later steps wait while the freeze covers them, and nothing pauses a wave in progress.
Also hold restoresOff by default. A freeze holds releases; a restore goes ahead during it unless this is on.
Who can bypassRecorded on the freeze and shown in the Evaluator. Who may bypass is the release:bypass duty.
NotifyRecorded; nothing is sent.

A freeze is read by the built-in Org freezes guardrail, so an exception to that guardrail excuses a place from every freeze.

What is built

PartState
Guardrails with scope, requirements, modes, versions and the actions they governBuilt.
Protected branch, no active freezeEnforced at deploy, promote and release.
Approvals, group approvals, a different approver and a change ticketBuilt: a held snapshot opens an approval request, and the guardrail lets it through once they are given.
Exceptions with end and review datesBuilt.
One-time bypass, bypass requests and who decides themBuilt, with the web screens under Approvals and the API for the direct bypass.
Freezes, one-time and recurringBuilt; they hold deployments, and restores only if the freeze says so.
Restore guardrails, restore bypass and incident break-glassBuilt.
Evaluator (explain why a snapshot is stopped)Built; it asks the same engine as a deploy.
Rollback fast path (a relaxing guardrail)Preview: it reads deployment history that is not recorded yet, so it relaxes nothing.
Freeze Who can bypass and Notify, a guardrail's Who can bypass table, pausing a wave already rolling outRecorded or drawn only; nothing acts on them.

Guides that use this

Next

On this page