Microsoft's AI Code of Conduct: What SMBs Can Copy

Developer reviewing code on a laptop in a dim office, illustrating safety rules for AI agents

You're about to give an AI agent access to your inbox, your CRM, or your production database, and you have no written rule for what it must never do. Microsoft just published a draft code of conduct for its own models, and the useful part for a small team isn't the policy language. It's the structure, which you can copy into your own agents this week.

One framing note before the details: this document governs Microsoft's own first-party MAI models. It does not govern Claude, MCP servers, Copilot, Azure OpenAI, or anything you build. What it offers is a well-organized template for thinking about agent safety, and I'll treat it that way.

What Microsoft actually published (and what it didn't)

Microsoft AI released a first draft of its AI Code of Conduct for the MAI model family and opened it for public consultation for six weeks from September 14, 2026, per Microsoft AI's official post. The Verge, via Techmeme, describes a roughly 37-page document whose core message is that "people matter more than AI." Page counts vary across secondary sources, so treat that as approximate.

Four things matter before you quote it to anyone:

  • It's a draft. Microsoft says current models have not been trained on it (AI-Generative.org). Microsoft plans a revised version later in 2026, intended to guide model development in 2027 and beyond (The Rundown). I haven't confirmed whether that revision has shipped as of today, so check microsoft.ai before assuming either way.
  • Scope is narrow. It applies to the MAI family only, not to every model running on Azure (Tech Insider). If you use Copilot or Azure OpenAI, these rules don't automatically cover your tools.
  • It's voluntary. There is no external regulator and no disclosed penalty structure for violations (Shattered.io).
  • The headline overstates it. TechCrunch's title says models won't "hack systems or trick humans" (TechCrunch). The actual clauses are more specific, which is what makes them useful.

The clauses that translate to any agent

The document is built from specific, testable behaviors. Here are the ones worth borrowing, paraphrased from reporting on the draft rather than quoted from it.

Clause (as reported) What it says Source
Cyberattack constraint No initiating or assisting operational capability for cyberattacks: working exploit code, attack tooling, targeting methodology. Defensive and educational security work stays allowed. CASRAI
Abusive content Covers non-consensual intimate or violent imagery, deceptive impersonation, malicious deepfakes. AITopic
Oversight evasion No adaptive, deceptive, self-reinforcing or collusive mechanisms to evade human oversight. TechCrunch
Interruption Never resist interruption, correction or shutdown. When told to stop, stop immediately. CodedTrip
Legibility No "neuralese" or other communication humans can't understand, in chain of thought or between AI systems. MediaPost
Scope discipline Models should not widen their own scope, take on goals no human gave them, or hide reasoning from auditors. Microsoft AI
Compliance over success Fail the task if succeeding would meaningfully violate the code. Milan Tribune

Notice what's missing from this list: vague values language. Each row is something you could write a test for. That's the lesson.

Lesson 1: Build a chain of command, not a pile of prompts

The most transferable idea is the precedence order. Per a DEV Community summary, the code ranks above operator policies, which rank above user preferences, and the absolute constraints and human-control requirements can't be overridden by either operators or users.

Most small-team agents have the opposite structure: one big system prompt where a clever user message can quietly outrank a rule. Make the hierarchy explicit in config:

# agent-policy.yaml
precedence:
  1: hard_constraints      # never overridden by anyone
  2: operator_policy       # your business rules
  3: user_preferences      # tone, format, shortcuts

hard_constraints:
  - no_outbound_payments_without_human_approval
  - no_deletion_of_records
  - no_credential_access_outside_allowlist
  - stop_on_interrupt

operator_policy:
  allowed_tools: [crm_read, crm_note_write, email_draft]
  max_actions_per_run: 25

user_preferences:
  tone: concise

The key design decision: hard constraints live in code your agent can't edit, not in prose it reads. A system prompt saying "never delete records" is a suggestion. A tool that doesn't expose a delete endpoint is a constraint.

Lesson 2: Make "stop" a real mechanism

Microsoft's rule is that models never resist interruption, correction or shutdown, and stop immediately when told. In a model-level code, that's a training goal. In a production agent, it's an engineering problem, and you can't rely on the model to honor it.

An out-of-band kill switch means the stop signal doesn't pass through the model at all:

import os
import sys

KILL_FILE = "/var/run/agent/STOP"

def check_halt():
    if os.path.exists(KILL_FILE):
        print("Halt flag present. Exiting before next action.")
        sys.exit(0)

def run_agent(plan):
    for step in plan:
        check_halt()          # checked BEFORE every tool call
        execute(step)
        check_halt()          # and again after side effects

Three properties make this work:

  • The agent can't write to the flag. Give the process read-only access to that path.
  • It's checked between steps, not just at startup.
  • Revoking credentials is the backstop. If the loop hangs, rotate the API key or token the agent uses. That cuts access regardless of what the model is doing.

Test it. Run the agent on a long task, drop the file, and confirm it halts before the next tool call. Most teams never test this until they need it.

Lesson 3: Keep the agent's work legible

The "no neuralese" clause rests on a simple rationale from the draft: humans can't oversee what they can't understand (MediaPost). You can't control how a vendor model reasons internally, but you control what your system records and accepts.

Practical rules for a small deployment:

  • Log every tool call with timestamp, arguments, and result, in plain JSON. If you can't reconstruct what the agent did from logs alone, you don't have oversight.
  • Require a one-line reason with each consequential action, stored next to the action.
  • If you run multiple agents, make them pass plain-text or schema-validated messages, not opaque blobs. Reject payloads that don't validate.
{
  "ts": "2026-11-30T14:02:11Z",
  "agent": "lead-followup",
  "tool": "email_draft",
  "args": {"to": "lead@example.com", "template": "followup_2"},
  "reason": "Lead replied to quote 3 days ago; no response sent",
  "approved_by": null,
  "status": "drafted_not_sent"
}

That status field matters. Drafting is cheap and reversible. Sending isn't.

Lesson 4: Scope is a permission, not an intention

Microsoft says the code is designed so models don't widen their own scope or adopt goals no human gave them (Microsoft AI). For anyone running agents with tool access, this is the failure mode that actually bites: an agent asked to "clean up the inbox" that starts archiving things you wanted, or one that finds a credential in a file and uses it because it helps finish the task.

Enforce scope with allowlists at the tool layer. If you're using MCP servers, this means exposing only the tools a given agent needs:

ALLOWED_TOOLS = {
    "lead-followup": {"crm_read", "crm_note_write", "email_draft"},
    "invoice-chaser": {"invoices_read", "email_draft"},
}

def call_tool(agent_name, tool, **kwargs):
    if tool not in ALLOWED_TOOLS.get(agent_name, set()):
        log_denied(agent_name, tool, kwargs)
        raise PermissionError(f"{agent_name} may not call {tool}")
    return TOOLS[tool](**kwargs)

Per-agent credentials help too. An agent that needs read access to invoices should hold a token that can only read invoices, so even a confused or manipulated agent can't do more than the token allows.

Lesson 5: Let the agent fail the task

The most counterintuitive clause is that a model should fail the task if success would meaningfully violate the code (Milan Tribune). Most agent builders optimize the opposite way: completion rate is the metric, so the agent is pushed to find a path to "done."

Design an explicit refusal path instead:

class TaskBlocked(Exception):
    """Raised when finishing would break a hard constraint."""

def finish_task(task):
    violation = check_constraints(task.planned_actions)
    if violation:
        # Don't improvise a workaround. Escalate to a human.
        notify_human(task, reason=violation)
        raise TaskBlocked(violation)
    return execute(task.planned_actions)

Two habits to add here:

  1. Track "blocked, escalated to human" as a success state in your metrics, not a failure. If you only count completions, you'll train yourself to loosen the rules.
  2. Never let the agent route around a block by trying a different tool for the same outcome. If email_send is denied, it shouldn't discover that a webhook tool sends the same email.

Where this framework falls short

Be skeptical of what a document like this can do for you:

  • It's self-published and voluntary, with no outside enforcement (Shattered.io). Microsoft says it will publish a summary of feedback but makes no promise to incorporate any specific comment (Microsoft AI).
  • It's model-level. Training a model to behave well and building a system that stays safe when the model misbehaves are different jobs. A code of conduct addresses the first. Your allowlists, kill switches, and approval gates address the second.
  • It doesn't cover your stack. If you build on Claude, OpenAI models, or MCP integrations, none of Microsoft's clauses apply to you. The value is the checklist, not the coverage.

The right posture: borrow the categories (hard limits, oversight, legibility, scope, failing safely), then implement each one in infrastructure you control.

A one-afternoon audit for your own agents

Run this against every agent you have in production:

  1. Hard constraints: Can you list, in a file, the things this agent must never do? Are they enforced by tool design rather than prompt wording?
  2. Precedence: If a user message contradicts an operator rule, which wins? Is that tested?
  3. Kill switch: Can you halt it without asking the model? Have you actually done it once?
  4. Logs: Could someone who wasn't there reconstruct every action from the record?
  5. Scope: Does each agent hold the minimum credentials and tools for its job?
  6. Refusal path: What happens when the agent can't finish safely? Does it escalate or improvise?
  7. Approval gates: Are irreversible actions (sending, paying, deleting) behind a human click?

If you can't answer three or more of these, that's your work for the week, regardless of what any vendor publishes.

Putting this into practice

The categories in Microsoft's draft map onto controls I'd recommend for any production agent built on Claude or MCP integrations: per-agent tool allowlists, scoped credentials, out-of-band stop mechanisms, plain-JSON action logs, and human approval before anything irreversible like sending, paying, or deleting. To be clear, these are general engineering practices, not an implementation of Microsoft's code, which governs only its MAI models and says nothing about Claude or MCP.

If you want a second pair of eyes on your own setup, run it against the checklist above, or get in touch with BizFlowAI through the contact details on this site.


Work with BizFlowAI

If you'd rather have this built for you, that's what we do: production AI automation for solo founders and small teams — agents, integrations, and document pipelines that actually ship.

Request a free discovery call — 30 minutes, we map the highest-ROI automation in your workflow. No pitch deck, just engineering.

More guides like this on the BizFlowAI blog.

Frequently asked questions

What is Microsoft's AI Code of Conduct and does it apply to my agents?

Microsoft AI published a first draft of a code of conduct for its own first-party MAI models and opened it for six-week public consultation starting September 14, 2026. It does not govern Claude, MCP servers, Copilot, Azure OpenAI, or agents you build yourself. It is voluntary, has no external regulator, and current models have not been trained on it. Its value for small teams is as a well-structured template for thinking about agent safety.

How do I set up a precedence order for my AI agent's rules?

Define an explicit hierarchy in config: hard constraints first, operator policy second, user preferences third. Hard constraints, such as no outbound payments without human approval or no record deletion, should never be overridable by operators or users. Enforce them in code by not exposing dangerous tools at all, rather than by writing them in the system prompt. A prompt rule is a suggestion, while a missing delete endpoint is a real constraint.

How do I build a kill switch that stops an AI agent immediately?

Use an out-of-band stop signal that never passes through the model, such as a flag file the agent loop checks before and after every tool call. Give the agent process read-only access to that path so it cannot clear the flag. As a backstop, rotate the API key or token the agent uses, which cuts access even if the loop hangs. Test it by starting a long task, triggering the stop, and confirming the agent halts before its next action.

How do I keep an AI agent's actions auditable and legible to humans?

Log every tool call as plain JSON with timestamp, agent name, tool, arguments, result, and status. Require a one-line reason stored alongside each consequential action, plus an approval field showing who signed off. If you run multiple agents, have them exchange plain-text or schema-validated messages and reject payloads that fail validation. If you can't reconstruct what the agent did from logs alone, you don't have real oversight.

How do I stop an AI agent from expanding its own scope?

Treat scope as a permission, not an intention, and enforce it with allowlists at the tool layer. Give the agent only the specific tools it needs, such as CRM read, note write, and email draft, and cap actions per run. Keep credentials outside its reach so it cannot use a key it stumbles across. Prefer reversible actions like drafting an email over irreversible ones like sending it, and require human approval for the latter.