# How we manage our device fleet with Git, Fleet and AI agents

> In 2026 we moved our Macs to a self-hosted Fleet server, put every setting in Git and let AI agents do most of the writing. Here is the setup, the rules we gave the agents, and the things that broke.

Canonical: https://short.inc/blog/it-operations/how-we-manage-our-fleet-with-ai

Published: NOV 11 2026
Tags: ai, agents, mdm, fleet, gitops, security

Every company with laptops has the same boring problem. The devices have to be encrypted, patched and set up the same way, and nobody wants to do that by hand. I certainly don't.

In 2026 we moved our device management to [Fleet](https://fleetdm.com), an open source device management platform, and we host it ourselves. The whole configuration went into Git. Then we let AI coding agents write most of it.

Yes, I let an AI near the system that can lock all of us out of our laptops. I'll explain where the agents are allowed to act and where they're not. I'll also tell you what broke, because that's the useful part of any post like this.

## The setup

Fleet runs as a small container stack on our own server. A Git repository is the single source of truth. One command applies the repository to the server: it pulls the secrets from our password manager, generates the configuration files and hands them to Fleet's GitOps tool. CI runs the same apply when we tag a release, and once every night. A pull request only gets a dry run.

> If a setting is not in the repository, the next apply removes it.

That's strict, and that's why we like it. Nobody can click a change into the admin panel and forget about it. Me included.

## We don't write the config files

Fleet wants one YAML file per team, plus a default file. With many teams those files get long and they're almost identical. Editing them by hand is how mistakes get in.

So a generator script writes them, from two small sources. One is a short list of constants: the teams, the baseline profiles, the minimum OS version. The other is a plain Markdown table that says which software goes to which team, and whether it installs silently or shows up in self service. Every generated file starts with a header telling you not to edit it.

If a team needs a new app, we change one row in that table. A person can review a one line diff. Nobody can review eighteen files of YAML. People say they do. They don't.

## What it manages

Configuration profiles are the biggest part: disk encryption with key escrow, the firewall, Gatekeeper, passcode and screen lock rules, Wi-Fi, privacy grants, software update settings. A new Mac enrolls on its own, and the user signs in with the company account. Software comes from the App Store, from our own packages, as a mandatory install or through a self service catalogue.

Then there are policies. Is the OS up to date? Is there enough disk space? Was this Mac restarted in the last week? When a policy fails, a script fixes it or asks the user nicely. For OS updates, one command sets the minimum version and a deadline. A patch gets a short deadline and a major release gets a long one.

Three other repositories feed into this one. The first builds signed packages for about 126 apps every night. Another holds the first boot setup for a new Mac. The last one is our own self service app.

## Two small workers

Two serverless workers sit next to Fleet.

The first is a router. A new Mac lands in a holding team with almost no access. The worker reads the user's group from our identity provider and moves the Mac to the matching team. We gave the groups the same names as the teams, so there's no mapping table to keep up to date.

The second is a relay. It turns Fleet events into tickets in our task tracker: a serious vulnerability, a host that went quiet, a policy that keeps failing. It also removes duplicates and filters by severity. You'll see why further down.

## Where the AI comes in

The repository started in May 2026. Since the first feature commit, more than four out of every five commits were written together with an AI agent.

Don't get me wrong. That number is only possible because of the rules we wrote first. Device management is not a web page. One wrong setting and people can't open their laptops on Monday morning. So the repository tells the agent, in writing, what it may never do.

> The agent never sends a command to a device and never runs a script on one. It gives the command to a person.

These two lines are copied from its rules file:

> Never push, tag, release, or deploy without the user's go for that action.

> Build only from `approved` entries. Unanswered means out of scope: record a Q-, never invent a value, a requirement or a behaviour.

It's also not allowed to regenerate or apply the configuration unless a person asks. The rule right next to that one says what to do instead: put the change in the generator.

| The agent does | A person does |
| --- | --- |
| Reads the code and the ledger | Decides what the fleet should do |
| Writes the generator change, the profile, the script | Reviews the diff |
| Writes the tests and the commit message | Runs the apply |
| Proposes changes to settled rules, and waits | Sends any command to a real device |

So the agent writes and a person pulls the trigger. Everything the agent writes goes through Git, which means we can review it and we can revert it.

The repository uses our [Agentic Code Setup](/blog/agentic-engineering/the-agentic-code-setup-skill): a short rules file, a vocabulary, and a ledger of decisions and patterns with evidence for each entry. When we ran its backfill here for the first time, the agents found eight places where our documents and our code disagreed. Two of those were real problems we hadn't noticed. Ouch.

## What broke

I'm not going to pretend this went smoothly. Every time something broke, we wrote the incident and the lesson into the commit message and into the ledger, so the next session starts with the lesson already loaded. Here are the ones I remember best.

Someone edited a generated file by hand, and the next run overwrote it. That's how "the change goes in the generator, always" became decision number one.

An app changed its package name. Its mandatory install policy dropped out and nothing warned us. The generator now complains when a policy has no matching app.

Our weekly restart reminder nagged people exactly once and then went silent. It turns out Fleet runs a policy's script only at the moment the policy goes from pass to fail. Know exactly when your automation triggers. We didn't.

The printer check passed when it should have failed. It was happy with a printer that the Mac had found on the network by itself. We test the pass condition against the lazy case now.

One event per vulnerability filled our task tracker in a single day. That's the reason the relay filters by real severity and removes duplicates before anything becomes a ticket.

A weekly update removed the old server version before the new image had finished downloading. The download failed and the server stayed down overnight. Now it pulls first, checks health, and rolls back if something is off. Major versions wait for a person.

And CI ran out of minutes. We moved to our own runner and we apply only on a release tag.

Go through those again. An agent going rogue didn't cause a single one of them. They're ordinary infrastructure surprises, the kind we would have hit with or without AI. What changed is what happens afterwards. The lesson goes into the ledger once, and after that every session starts from it, whether a person or an agent is doing the work.

## If you want to try this

Generate the configuration. Let people and agents edit a small source file, and review small diffs.

Write the "never" list before the agent writes a single line. Then keep a person on every action that reaches a real device. You can revert a Git change. You can't revert a wiped laptop.

When something breaks, record it as a rule and write the reason next to it. A rule without a reason gets "improved" away by the next person who reads it, or the next agent.

Today one person runs our fleet in a few hours a week, and we can look up why every setting is the way it is. I'm still a little surprised that it works this well.

If you want help with a setup like this, or with AI agents in your own operations, [get in touch](/contact).
