AI code governance
AI code governance in loop engineering
Most of the code in a modern repo is now written by an agent, reviewed by a person who didn’t write it, and merged under time pressure. The review step was designed for a world where a human typed every line. It no longer fits.
Loop engineering is the practice that grew up around this. AI code governance is what keeps it from producing code nobody can stand behind.
What loop engineering is
Loop engineering is the work of designing and running the cycle an AI coding agent goes through: prompt, generate, check, fix, repeat. The engineer’s job moves from writing code to shaping that cycle. Which rules the agent gets. Which checks run before a change is accepted. What gets recorded when it is.
The loop runs in Cursor, Claude Code, Windsurf, Lovable, Replit and wherever else an agent can edit files and open pull requests. Every one of those surfaces is a place where code enters your repo without a person reading it first.
What AI code governance means
AI code governance is the set of standards, checks and records that decide whether AI-generated code is fit to ship, and that prove the decision was made.
It answers 4 questions:
What standards does this code have to meet?
Was it checked against them before it was accepted?
What was the result, and was anything fixed?
Can I show that record to an auditor, a customer or a security team 6 months from now?
Code review alone doesn’t answer them. A reviewer can approve a change and leave no trace of what was checked. A model can review its own output and give a different opinion on the second run.
Key aspects
Governance inside the loop, not after it
A check that runs the day after the merge is a report. A check that runs while the agent is still editing is a control. The agent gets the finding, fixes it, and the corrected code is what reaches the pull request.
Deterministic checks
The same code against the same rule has to give the same verdict every time. That’s what makes a result defensible. An LLM asked to review a file will give a good answer, then a slightly different one, then a third. You can’t build a compliance record on that.
A standard the whole organization shares
Skills files and rules files in each developer’s IDE are useful, and they drift. Governance needs a single set of rulesets that every agent, every developer and every pipeline checks against, owned centrally.
An external record
Every check, every finding and every fix registered outside the agent’s context, with which client called it and when. The agent’s chat history is not an audit trail.
Coverage of the stacks you actually run
JavaScript, TypeScript, Python, PHP, the frameworks on top of them, the prompts that drive the agent. Governance that covers one language is a gap, not a policy.
Why it matters
Three things have changed at once.
Volume
An agent can produce a week of code in an afternoon. Review capacity hasn’t grown to match, so more changes ship with less scrutiny.
Accountability
When an agent introduces a SQL injection or leaks a secret, the person who accepted the change is still responsible. “The model wrote it” is not a defense a CISO or a regulator accepts.
Compliance
ISO 27001, SOC 2 and the EU AI Act all expect evidence that code was checked against a defined standard. Agent-generated code without a record of checks is a finding waiting to happen.
The cost of getting this right is small. A check that runs in the loop takes seconds. The cost of getting it wrong is a production incident traced back to code that nobody reviewed and nobody can explain.
How Norma runs the loop

Norma sits inside the loop as an MCP server. The agent fetches the rulesets for the repo’s stack before it writes, runs a Livecheck on what it wrote, applies the fixes, and registers the outcome in an audit trail that lives outside the agent. Same code, same rule, same verdict, every run.
Set it up in your agent

MCP clients
Cursor, Claude, Claude Code, Windsurf, Lovable, Replit and Codex. The endpoint is api.qualityclouds.ai/mcp with OAuth; your client opens the sign-in for you, no API key to manage.
Claude Code
Cursor and other clients that use an mcp.json
Inside Claude, Norma is also in the connectors directory; search for it there and connect in two clicks. Or install through Smithery.
Then link a repo and let the agent work
GitHub
Install the Norma GitHub App. It checks every pull request when it opens and posts the findings as a review comment, covering the code that never passes through an agent loop: contractors, teams that haven’t adopted MCP, agents nobody told you about. It asks for one permission, read and write on pull requests, so it can read the change and post the comment. It cannot push code or merge.
VS Code
Install Norma: AI Code Governance from the Marketplace, also on Open VSX for Cursor and VSCodium. Livecheck runs on the active file, findings land in the Problems panel, and Fix with AI hands the finding to your editor’s AI chat.
Questions about governing code generation
Can I govern what an agent generates, or only what it has already written?
Both, and the first is where the gain is. Give the agent the rulesets for the repo’s stack before it starts, so it writes to the standard. Then check the output before the change is accepted. Norma exposes rulesets through MCP so the agent reads them at the start of the loop and checks against them at the end.
My LLM already has my skills and rules files. Isn’t that governance?
It’s the first half. Skills and rules files tell the model what the standard is, and they work well for that. They don’t tell you whether the output met it. The model reads the rule, writes the code, and nothing checks the result against the rule or writes that result down. Governance needs the check and the record on top of the instructions. Keep your skills files; add a deterministic check that verifies the output against the same standard.
My LLM already does the code review. Why add another check?
Because the review is the model grading its own work, and the grade changes between runs. Ask it twice and you get two opinions. A deterministic check gives the same verdict every time, and it’s recorded outside the agent’s session. The LLM review is still useful for judgment calls; the check is what you can show to an auditor.
Where in the loop should the check run?
Before the pull request is opened. At that point the agent can still fix the finding and the corrected code is what reaches review. A check at merge time is late; a check after merge is a report.
How do I stop rules drifting between developers?
Keep the rulesets in one place and have every agent fetch them, rather than copying rules files into each IDE. Local skills and rules files are fine as a supplement; they shouldn’t be the source of truth.
Does governance slow the agent down?
A Livecheck on a file takes seconds. The agent applies fixes in the same loop, so the time is recovered at review, where a human would otherwise have to find and explain the same problem.
What counts as an audit trail for AI-generated code?
A record, held outside the agent’s session, of which code was checked, against which rules, with what result, what was fixed, and which client made the call. Chat history and commit messages don’t meet that bar.
Does it cover prompts as well as code?
It should. Prompts and agent instructions decide what gets generated, so they need standards too. Norma includes a ruleset for prompts alongside the code rulesets.
What if my stack isn’t supported?
Norma detects the stack automatically and today covers JavaScript, TypeScript, Python, PHP and frameworks including React, Node, Vite, FastAPI, SQLAlchemy, Supabase and Adobe Magento, with more in development. If yours isn’t listed, talk to us about what’s next.
Try Norma free
The free tier is permanent, with 1 certificate per month. It’s freemium, not a trial that expires. Sign up, connect your agent, and it checks its own code from the next prompt onward. Onboarding includes a read-only demo repository that doesn’t use your scan quota, so you can watch a full run before pointing Norma at real code.