How to govern AI coding agents in your company

· 3 min read

AI coding agents no longer just suggest a line: they read the repository, run commands and write whole features. That is a real gain for your teams, and a new risk for your company. Here are five rules that let you keep the gain and control the risk.

Your developers already use AI

In most software teams, the question is no longer whether to use AI, but how. Developers install an assistant on their own, connect it to company code, and work faster. Management usually learns about it later, with three questions nobody can answer: which code was sent where, which commands were run, and what the AI actually brought.

Banning the tools rarely works: people use them anyway, out of sight. The better answer is to give them a framework where AI is allowed, useful and visible.

1. Give each agent a precise job

An agent with a vague instruction on a whole repository will do vague things. Give it a user story, with its acceptance criteria, and the instructions your company writes for that kind of work: your stack, your conventions, what it must never touch.

Separate the roles. Some agents write code; others interview people and write the documents (needs, specification, architecture). For a bigger user story, a lead agent can split the work between several agents and check the result.

2. Run agents in a sandbox, not on the developer’s computer

An agent runs commands. On a developer’s computer, it can read their SSH keys, their other projects and their browser’s files, and send them anywhere. One malicious instruction hidden in a dependency’s README is enough.

Run agents in an isolated container that only contains the project, and that can only reach the websites you allow:

  • the project it works on, and nothing else;
  • the AI model it needs to think, and the package registries you approve;
  • no access to the developer’s files and keys, nor to the rest of the internet;
  • no right to push code by itself: it commits, a person reviews and pushes.

3. Keep secrets away from AI by default

Passwords, API keys and client credentials should never sit in files an agent can read. Store them encrypted, give them only to the people who need them, after approval, and keep them away from AI unless a manager decides otherwise for a specific project.

When a secret does appear in a conversation, mask it in every record. The audit log should say who read which secret, never show its value.

4. Review an agent’s work like anyone’s

Nothing an agent writes should reach main without a human review. The simplest rule is also the strongest: agents work on a branch, a person opens a pull request, a team lead reviews and merges. Protect main so nobody, human or agent, can skip that step.

This keeps quality where it was, and makes AI an extra developer on the team rather than a shortcut around your process.

5. Keep a record of every conversation

When a client or an auditor asks how a change was made, you should be able to show it: which user story, which agent, which conversation, who reviewed and who approved. Keep every conversation with the AI on record, secrets masked, next to the commits it produced.

The same record answers the other question management asks: what does AI bring? Count the agent runs per project, the user stories done with AI, and compare.

How Kwan applies these rules

Kwan was built around these five rules. Managers write the company’s AI assistants once, choose which ones each project may use, and decide whether agents must run in the sandbox. Kwan Code then starts the sandbox by itself; developers have nothing to configure. Secrets are encrypted and kept from AI, reviews are GitHub pull requests mirrored in Kwan, and every conversation with Claude is on record.

See the details on the security page, or try the demo.

See Kwan on your own projects

Explore a demo company, read-only, then we set up a trial company for your team.