Governing LLM Agents: COC-IA

The agents we built at GreenWeb diagnose customers' problems on shared hosting servers — servers that hold other people's sites on the same machine. That single fact shaped the entire research agenda of the COC-IA paper: when your agent's playground is somebody else's production box, capability is not the scarce resource. Control is.

The intuition to unlearn is that an agent fails when it lacks access or lacks context. In practice, our failure modes ran the other way. An agent with broad tool access and a long context window could, in one unlucky chain of steps, read a neighbor tenant's data, restart the wrong service, or "fix" a customer's issue by changing someone else's configuration. None of these require malice or even a strange prompt — just an ordinary reasoning mistake, executed with privileges nobody had reviewed.

Context operational control

COC-IA — Context Operational Control — flips the default. Instead of granting the agent the world and hoping the prompt keeps it polite, the protocol defines, per action, which context the agent is allowed to touch: which files, which services, which tenants, which of its own memory. The governance layer sits between the agent and its MCP tools, so every tool call carries an explicitly scoped context envelope. Scope violations are not prompt-injection surprises; they are protocol errors, the same category as a bad API call.

Scoping per action, rather than per session, turned out to be the crucial granularity. A session-level grant is a one-time decision made before anyone knows what the problem is. An action-level grant can follow the diagnosis: while the agent is only reading logs, its write surface is zero; the moment it proposes a change, the envelope tightens to exactly the service it can justify.

Diagram of COC-IA Context Operational Control between an LLM agent and MCP server tools.
Figure 1 — Context Operational Control (COC-IA) sits between the LLM agent and MCP tools, scoping each action's context envelope and routing high-risk writes through a risk-aware RL checkpoint.

The risk-aware action policy

Control layers can strangle an agent until it is useless — that's the obvious failure of any governance design, and probably the reason most production agents still run loose. Our second component is a reinforcement-learned, risk-aware action policy that decides how aggressively the agent should proceed: full autonomy for low-risk, reversible steps; human-in-the-loop checkpoints for actions whose failure modes are expensive. The policy learns the trade-off from run data instead of from a hand-written sensitivity table, because our first hand-written table was wrong in both directions — too permissive on storage operations and too timid on DNS ones.

On top of the protocol we extended the agent with multimodal capture — the agent's own screenshots and terminal states become part of the auditable record — which made the governance layer's job tractable: you cannot bound what an agent did if you cannot reconstruct what it saw.

Did it work?

The operational outcome, per the paper and the deployment: technicians' debugging time went down, and the dangerous-tail incidents — the ones that page someone at night — became structurally impossible rather than merely rare. That distinction is the one I'd defend in any argument about agent safety: "we monitored it closely" and "the action was unreachable" are different universes of assurance. COC-IA was presented at the First National Conference of the Iranian Artificial Intelligence Association in October 2026; the proceedings DOI will be linked from the publications page once indexed.

Why I think governance is a research problem, not a compliance one

Most writing about agent safety treats control as paperwork: define a policy, audit against it, hope. Working inside an SRE department teaches the opposite — governance is a live systems problem with latency budgets, failure modes, and a learning component, and it rewards the same rigor we apply to models. The action policy is literally RL. The protocol has invariants worth verifying. None of this is paperwork.