DEV Community

Cover image for Where should the rules live?
MEHO
MEHO

Posted on

Where should the rules live?

A note from the MEHO lab. First published in our LinkedIn newsletter, From the lab.

Most conversations about AI agents and security begin with the model: which one, and where it runs. Those are fair questions, and we will come back to them. But there is one question that decides everything else about agents on infrastructure, and most teams answer it by default rather than by choice. The question is where the rules should live.

Three words that get mixed up

When people say "governance" about AI agents, they usually mean three different things at once, and it helps to pull them apart. Governance, in the plain sense, is your organisation deciding the rules: who may do what, and who approves. Enforcement is something making sure those rules hold, on every single action, not on average. And the record is proof of what was actually done, by whom, and on whose approval. The first of these stays with you, whatever tools you use. This note is about the other two, because that is where most agent deployments quietly go wrong.

The usual way: rules around the agent

Nearly every approach today enforces the rules on the agent side, in the sandbox around the agent. Two methods dominate. Heuristics are fixed rules in the harness that block or question risky commands. A supervisor agent is a second model that checks each step of the first. Both help, and both share one weakness: they sit next to the agent, so they depend on the harness and on the setup of every user's machine.

That weakness is not theoretical. The "s1ngularity" attack on the Nx package last year did nothing more clever than run the AI command-line tools on developer machines with their safety prompts turned off, then go looking for secrets; Wiz counted more than 2,000 leaked [1]. A supervisor model is a model too, so the same hidden text that tricks the first can trick the second. And because every team and every laptop needs its own setup, nobody sees the whole picture. The record suffers in the same way: when each harness keeps its own logs, there is no single proof of what was done.

Look at where the boundary sits in the usual picture. The sandbox, the heuristics and the supervisor are all drawn around the agent. Another agent, with a different model or harness, and a person at a console go straight to the same systems.

Flipped: rules in front of the infrastructure

The alternative is to move the enforcement and the record away from the agent, to the one place every action must pass: in front of the infrastructure. This is not a new idea. We already control how people and applications reach our systems, with a jump host, an API gateway, a privileged access tool. Nobody logs into a production server from a laptop with a personal password, and it took the industry a couple of decades and a fair number of incidents to arrive there. Agents simply get the same treatment.

In the flipped picture, every agent, whatever model or harness it uses, and every person, from the command line or a console, takes the same single path to the systems. The login, the rules, the approval and the audit record live on that path. They do not rely on the agent being well behaved, the plugin being honest or the laptop being configured correctly. A tricked agent or a bad plugin still meets the same rules, because the rules were never inside the agent. The sandbox is still there in the drawing, but drawn with a dashed line, because nothing depends on it any more.

It helps to follow one action through. Say an agent decides a VM snapshot should be deleted. The request first hits the login: who is asking, a person, an agent acting for a person, or an automated service? Then the rules: deleting a snapshot cannot be undone, so it is classed as destructive, and destructive operations wait for a person every time. The request is parked, and a record is written that it was parked. A person sees a preview of exactly what would be deleted and on which system, and confirms with a passkey touch, so a real human has to be present. Only then does the platform fetch the credential and call vCenter, and only after the audit record is committed does the operation report success. Four checks, one path, and at no point did the agent hold a password or decide its own permissions.

The one condition

This holds only if the path is the only path. The moment an agent is given its own credential for a system, it can go around the gate, and everything on the gate becomes decorative. That is the whole design in one sentence, and it is why in our lab the agent never holds a backend credential at all. The platform fetches it at the time of the call, under the identity of the operator the agent is acting for, and the agent only ever sees the result of the operation.

In practice that means two front doors and no side entrance. Agents come in over MCP, the standard way an agent calls tools. People come in over the REST API, which the command line and the web console use. Both doors lead to the same checks, and there is no third way in that skips them. The platform keeps no user database of its own; everyone, human or agent, logs in through the company's identity provider, and the passwords of the systems live in a secret store that the agent never reads.

Two things that follow

Two consequences of one path are easy to miss, and both turned out to matter as much as the safety argument. The first is that the same rules apply to everyone, agent or human, so there is no separate and weaker rulebook for the thing that works fastest. The second is that everyone who works on the same system sees the same knowledge and the same record of what was done. That sounds like an audit feature. In practice it is what stops a team from learning about a re-cabled host half a day late.

So far this is the idea. In the coming notes we will show how it looks in practice.

If your agents touch infrastructure today, where do the rules live: around the agent, or in front of the systems? Reply or comment; we read everything.


[1] Wiz, "s1ngularity's aftermath" (2025). https://www.wiz.io/blog/s1ngularitys-aftermath

MEHO is open source under Apache 2.0. If this was useful, a star on GitHub helps more people find it.

Top comments (0)