The policy your AI can't see
Originally published at ilkka.pro.
AI can draft an excellent migration plan from Jira, Confluence, Git and Slack, and still get it wrong, because the rule that matters lives in an SRE’s head. Here’s how to close that gap.
Picture a data center migration. The organization is well documented by most standards: years of Jira tickets, design pages in Confluence, runbooks and code in Git, and every decision argued out somewhere in Slack. You point an AI assistant at all of it and ask for a migration plan and a runbook.
What comes back is genuinely good. It sequences the services correctly, accounts for the event streams between them, adds verification steps and a rollback path. The plan’s data migration looked like this: freeze the source, dump the in-flight data, and restore it in the new data center before cutover.
It was a sensible plan. Draining the queues was the usual approach, but here it could take far longer than the cutover window allowed. With the source frozen, a dump-and-restore looked faster and just as safe.
SRE rejected it in thirty seconds. Not because of the copy itself: an automated migration that moved the data without anyone running scripts by hand would have been fine. What they wouldn’t accept was an SRE running dump and restore scripts manually in the middle of a cutover, under time pressure, where one wrong input can’t be taken back. With no automated migration ready, the answer was to drain the queues, even if it was slow. A longer cutover was a cost they could plan for. A custom copy of production messages wasn’t a risk they would take.
The plan wasn’t wrong given what the AI could see. It was wrong given what it couldn’t.
Abundant context, missing constraints
Most organizations have far more context than they realize, and AI tools are now very good at using it. But look at what that context actually describes. Tickets describe work to be done. Design documents describe what we intend to build. Code describes what we built. Slack describes how we argued about it.
Very little of it describes what we are not allowed to do. The rules that shape how work actually happens in production tend to live somewhere else:
in the heads of the people who operate the systems;
in a postmortem from three years ago that everyone on the team remembers and nobody links to;
in a private SRE channel the planning tools were never given access to;
implicitly, in pipeline configuration and access controls, enforced but never explained.
“No hand-run scripts during a cutover: automate it or drain it.” “No schema changes outside the change window.” “Cutovers need a named SRE on the bridge.” “Nothing touches the shared message broker without a capacity review.” These are some of the most important facts about how an organization runs, and they are often the least written down.
Why it’s worse than a bad plan
When an AI doesn’t know a constraint, it doesn’t stop and ask. It fills the gap with the most reasonable default it has seen. In an engineering organization, the most common default in the written record is the developer’s: if something needs fixing, write a script and run it.
That produces a plan that is not the best plan, and not the second-best plan either. It is a plan built on a false premise. Migration steps depend on each other, so a single invalid assumption rarely means editing one line. Switching from “dump and restore” to “drain” wasn’t a one-line edit. It meant fixing the consumer performance first, a new timeline, and a different rollback plan. One invalid assumption, and the plan started over. You are back at the start, except now with a confident, polished document that made everyone feel further along than they were.
Polish is part of the problem. A well-structured plan invites review of its details: is step seven in the right order, is the verification query correct. Fewer people step back and ask whether the whole approach is allowed.
Two mindsets, one plan
There is a human side to this as well. Developers and SREs play different roles, and they are rewarded for different things. Developers are measured on change: shipping features, fixing problems quickly, automating the tedious parts. SREs are measured on stability: limiting blast radius, keeping changes repeatable, auditable and reversible.
Both mindsets are right, and a good migration needs both. But they don’t always align, and a rule like “no hand-run scripts during a cutover” can look like bureaucracy from the development side. From the operations side it is how you know exactly what changed, who changed it, and how to undo it at three in the morning.
That caution is earned. Google’s Site Reliability Engineering book notes that roughly 70% of outages are caused by changes to a live system. Some of the best-known incidents started with a capable engineer doing something reasonable by hand in production: GitLab’s 2017 data loss came from a directory deleted on the wrong production host, and Amazon’s 2017 S3 outage began with a single mistyped input to a command run from an established playbook. Both started the same way my plan would have: a person running a command by hand, on production, under pressure.
An AI that works from a company’s written record inherits the mindset that wrote most of it. In most engineering organizations, that is the developers. The operational view is underrepresented, not because it matters less, but because it is passed on in conversation and code review rather than written down.
What actually helps
None of these require a better model. Anthropic describes the discipline as context engineering: what a model can see shapes its output as much as what you ask it. Here that means making the invisible rules visible, and putting them where both people and AI will find them.
1. Write constraints down as constraints
Policies hidden inside long pages are easy to miss, for people and for models. Give each team that operates production a short, declarative list of its rules, each with the reason behind it, kept in Git next to the code and owned by that team:
Production operating policies (owned by SRE) - No manual scripts during a cutover. Data moves either by an automated, rehearsed migration or by draining. Why: hand-run steps under time pressure are where outages start. - Production scripts outside a cutover need a change ticket. The “why” matters. A model that knows the reason can propose an alternative that respects it, instead of just avoiding the forbidden word.
2. Make the constraints part of the default context
A policy document nobody loads is just another page. Wire it into the tools: repository instruction files that AI assistants read automatically, such as AGENTS.md or Claude Code’s CLAUDE.md (Claude Code prefers CLAUDE.md if both exist), and shared, reusable prompts or skills for recurring tasks like “plan a migration” or “write a runbook” that pull in the operating policies before they plan anything. The goal is that nobody has to remember to paste the rules in.
3. Make the AI state its assumptions first
Some constraints will always be missing, so design for the gaps. Ask for an explicit list of assumptions and open questions before the plan itself: Are manual changes in production allowed? Is there a change window? Who approves a cutover? Which teams own the systems involved? Then have the owning teams answer them. A wrong assumption caught on page one costs a conversation. Caught in review, it costs the plan.
4. Review the approach before the details
Bring SRE in at the outline stage, not at the finished runbook. A one-page approach is cheap to change and easy to judge against operational rules. Once a detailed, polished runbook exists, everyone, including the reviewers, is reluctant to throw it away.
5. Turn every rejection into documentation
The fastest way to surface tacit rules is to notice when they are enforced. Every time a plan is rejected for a reason that wasn’t written anywhere, capture it as one line and a “why” in the policy file. Mine incident reviews and postmortems the same way. Within a few months the list covers most of what matters, and it keeps improving on its own.
6. Enforce the hardest rules in tooling
Documentation can be skipped; guardrails can’t. If production access only works through the pipeline, if admission policies reject changes that break the rules, and if staging enforces the same restrictions as production, then any plan that violates them fails early and loudly during rehearsal, not during the cutover. In Kubernetes, tools like Open Policy Agent Gatekeeper turn such rules into policy as code. It is also how Amazon responded after the S3 outage: rather than relying on people to type more carefully, they changed the tool so it could no longer remove too much capacity too quickly.
7. Add an automated policy review
Before a human reviews the plan, run a second pass whose only job is to read it against the operating policies and flag every step that may violate one. It won’t catch everything, but it catches the obvious mismatches, so human reviewers can spend their attention on judgment instead of rule-checking.
The real fix is organizational
In the story at the start, the AI did its job well. It produced the best plan the available context allowed. The failure was that the context described how the organization builds software, not how it runs it.
AI makes that gap visible faster and more expensively than before, which is a useful kind of pressure. Writing down how production really works, and why, doesn’t only produce better AI plans. It gives every new engineer the same head start, and it lets developers and SREs argue about the rules in the open instead of discovering them in review. DORA’s research has long shown that organizations where information flows freely perform better. AI just raises the stakes.
原文:https://www.a8q9.cn/en/article/the-policy-your-ai-can-t-see-922341.html