Tons of new funtionality in Massdriver! We're demoing a new feature everday until Christmas.
Check out the advent calendar hereHow to Enforce a Change Freeze for Infrastructure Deployments
Change freezes for peak season, holidays, and weekends usually live in a calendar invite and a CI date check. How to enforce deploy freeze windows on every path to production, with exemptions and an emergency lift.
It's December. Somewhere in your company there's a calendar invite titled "CODE FREEZE" that starts on the 18th, and an email from a VP that says "no production changes unless it's an emergency." Retail teams do it for Black Friday. Finance teams do it at quarter close. Plenty of teams do it every weekend, because nobody wants to page the one person who understands the database at 9 p.m. on a Saturday.
A change freeze is a reasonable policy. The problem is that most of them are enforced by everyone reading their email.
How teams enforce change freezes today
The honor system. Announce it and trust people. This works until a contractor who wasn't on the email ships a "small" Terraform change on December 23rd.
A date check in the pipeline. A CI step that fails when the date falls inside the freeze. This is the most common one, and it has the most interesting ways to fail:
- It only protects that pipeline. Someone with the CLI and credentials, a different repository's pipeline, or the cloud console goes right around it.
- The dates are hardcoded, so changing the freeze means merging a change to the pipeline. During the freeze.
- The emergency bypass is commenting out the check, which leaves no record and sometimes doesn't get uncommented.
- Every repository has its own copy, and the copies disagree about time zones.
Pulling permissions by hand. Someone edits IAM or the CI role on Friday afternoon and puts it back Monday morning. When they forget to put it back, Monday is a fun day too.
All three bolt the freeze onto one path to production. If you have more than one path (and you do: people, CI, scripts, and now coding agents), the freeze has a gap for each path it doesn't cover.
What a change freeze should block
A good freeze is narrow. It stops infrastructure from changing in the places you care about, and it leaves everything else alone:
- Block deploys and decommissions on production, or on whatever you match. Planning and proposing should keep working, so the team can keep working and queue up changes for after the window.
- Exempt the people who must act, such as the on-call SRE group.
- Apply to every requester the same way: the UI, the CLI, the API, CI service accounts, and agents.
- Start and end on time, in the right time zone, without anyone editing a pipeline.
- Allow an emergency lift that is deliberate and visible.
The only place that covers every path is the permission check itself. If the system that executes deployments refuses the request, it doesn't matter which tool sent it.
Freeze windows as deny policies
In Massdriver, every deployment goes through one access check. Groups have policies, and a DENY policy wins over any allow. freeze-guard, one of the Massdriver automations, uses that. When a window starts, it adds a DENY policy for the deployment actions to every custom group that is not exempt. When the window ends, it deletes those policies.
A window is weekly, such as every night after hours, or a fixed range, such as a holiday:
timezone: America/Los_Angeles
exempt_groups: [Platform Engineering]
slack:
channel: '#changes'
windows:
- name: after-hours
match:
md-environment: prod
weekly:
- from: Mon 17:00
to: Tue 08:00
- from: Tue 17:00
to: Wed 08:00
- from: Wed 17:00
to: Thu 08:00
- from: Thu 17:00
to: Fri 08:00
- from: Fri 17:00
to: Sat 08:00
- from: Sat 17:00
to: Sun 08:00
- from: Sun 17:00
to: Mon 08:00
- name: holiday
match:
md-project: [visits, care]
exempt_groups: [Production Deployers]
actions: [instance:deploy]
from: 2026-12-24
to: 2026-12-26 12:00
- name: billing-quarter-close
timezone: America/New_York
actions: [instance:deploy, environment:deploy]
match:
md-project: billing
from: 2026-12-31T00:00:00Z
to: 2027-01-02T00:00:00Z
A window's own timezone replaces the top-level one, and a time with an offset, such as the Z in billing-quarter-close, keeps its own offset. A window's match becomes the policy's conditions, so md-environment: prod freezes production and leaves dev and staging open. Without match, the window freezes everything. The top-level exempt_groups apply to every window, and a window's own exempt_groups add to them.
By default a window denies the four actions that change infrastructure:
| Action | Blocks |
|---|---|
instance:deploy | Deploying an instance, and approving or rejecting a proposed deployment |
instance:decommission | Decommissioning an instance |
environment:deploy | Deploying every instance of an environment |
environment:decommission | Decommissioning every instance of an environment |
instance:propose, instance:plan, and instance:configure stay allowed. During a freeze, people can still configure instances, run plans, and propose deployments. The proposals wait until the window ends, and a member of a frozen group cannot approve one until then.
Who is frozen
A freeze built on access policies treats some people and accounts differently from a CI date check.
- Deny wins. A person in an exempt group who is also in a frozen group is denied. Put the people who must deploy during a freeze only in exempt groups.
- Service accounts are frozen like people. A CI service account in a frozen group cannot deploy during the window. The same goes for an agent that works as a frozen person or service account. If a pipeline must deploy during a freeze, put its service account in an exempt group.
- The built-in Administrators group is never frozen. Massdriver does not allow policies on it. An administrator who is also in a frozen custom group is still denied, because deny wins.
- A running deployment is not frozen. Massdriver authorizes the provisioner by tenancy, not by group policies, so a deployment that already started can still report status and write its state.
Deployments that already started
Massdriver checks the deployment actions once, when the request arrives. When a window starts:
- A running deployment runs to its end.
- A deployment that is
PENDINGbehind another one, or anAPPROVEDproposal that waits, starts when the instance is free. - An environment deploy that is in progress continues through its remaining instances in dependency order.
- A
PROPOSEDdeployment waits. Nobody in a frozen group can approve or reject it until the window ends.
If you need to stop one of these, abort it in Massdriver. freeze-guard blocks new requests. It never aborts work.
Emergency lift
Production will break during a freeze at least once. When it does, set FREEZE_ADMIN_TOKEN and lift the window:
curl -X POST -H "Authorization: Bearer $FREEZE_ADMIN_TOKEN" \
"https://freeze-guard.example.com/freeze/lift?window=after-hours"
{ "until": "2026-12-02T01:00:00Z", "window": "after-hours" }
freeze-guard deletes the window's policies and does not create them again until the window's next start. The response above is a lift of the after-hours window on the night of Monday, November 30, so until is the next evening, Tuesday at 17:00 Los Angeles time. Anyone with the token can lift a freeze, so keep it with the people who can approve an emergency change.
With Slack set up, every start, end, and lift is announced:
Freeze window "after-hours" started. Denied environment:decommission, environment:deploy, instance:decommission, instance:deploy where md-environment is prod.
Frozen groups: Clinical, Developers, Patient Experience, Revenue.
Exempt groups: Platform Engineering.
Freeze window "after-hours" lifted until 2026-12-01 17:00 PST. Removed its deny policies.
It puts itself back
freeze-guard reconciles when it starts, every minute, and after each group.created, group.updated, and group.deleted event. A group created during a window gets its policy on the next reconcile. If someone deletes a freeze policy during the window, freeze-guard creates it again. It never changes or deletes a policy that it didn't create.
The service account needs organization:manageGroups, which can also change group membership, so keep its token secret.
Anyone with that permission can move people into an exempt group, and freeze-guard does not undo membership changes, so give it only to the service account and to the people who may end a freeze.
Set it up
Deploy the massdriver-freeze-guard bundle (Kubernetes) or massdriver-freeze-guard-ecs (Amazon ECS with Fargate). The event destination is optional. Without it, the reconcile runs every minute anyway. With it, a new group is frozen within seconds:
mass event destination create \
--name freeze-guard \
--url https://freeze-guard.example.com/hooks/massdriver \
--event-type group.created \
--event-type group.updated \
--event-type group.deleted
Mount a STATE_DIR so lifts survive a restart, and run one replica. Policies change within a minute of a window's start or end.
The freeze-guard docs have the full config reference. The automations docs cover the rest of the automations, and Run Automations shows how to deploy them.


