Back to Research

Teach AI Coding With Guardrails

A practical team rollout plan for Cursor users: rules, MCP boundaries, workshops, and review guardrails for agentic coding.

Close of a Stormy Day, landscape painting by George Inness (1881).
Rogier MullerJune 30, 20269 min read

To train a software team on AI coding tools safely, start with the workflow: narrow scopes, shared repo rules, tool boundaries, and mandatory review before merge. Do not begin with a feature tour; begin with one realistic task where the agent can help and the human still owns the change.

AI coding governance is the set of team rules, tool limits, review gates, and training habits that make coding agents useful without letting them drift outside engineering control. For Cursor, Anysphere's AI code editor, this means teaching Agent usage alongside cursor rules, MCP boundaries, and reviewable IDE workflows, not as a separate side quest.

Make the agentic workflow visible

Treat agentic coding as a team operating model, not a private productivity trick. A developer should be able to explain what the agent was asked to do, what files it touched, what tools it used, and what evidence proves the change works.

That is why tools like DoorDash OSS's Agentic Orchestrator, a terminal UI for long-running coding agents, are interesting as of June 2026. They point at the same need many teams now have: when agents run for longer than a quick autocomplete, the work needs a dashboard, a boundary, and a review path.

The trap is confusing visibility with safety. A TUI can show many agents working, but it cannot decide whether a migration is allowed, whether customer data can be queried, or whether a generated test is meaningful. Those decisions belong in team policy and review guardrails.

A good first rule is simple: agents may propose changes, but humans own intent, secrets, data access, and merge decisions. That sentence sounds boring. It saves real pain.

Put repo rules where agents will read them

Cursor users should start with a small .cursor/rules/agent-safety.mdc file and a repo-level AGENTS.md. The Cursor rule tells Cursor Agent how to behave in the IDE; AGENTS.md gives cross-tool instructions that can also help teams using other coding agents.

For Claude Code, Anthropic's coding agent, keep durable project context in CLAUDE.md and reserve prompts for task-specific instructions. For OpenAI Codex, OpenAI's coding agent, use the official setup patterns for the environment your team actually runs. The point is not to make every tool identical; it is to make the team's boundaries consistent.

A useful AGENTS.md boundary is concrete:

The agent may edit files under src/checkout/** and tests/checkout/**. It must not edit infra/**, db/migrations/**, or packages/auth/** without an approved plan in the pull request description.

That beats a vague rule like be careful with production code. Agents do better with borders than vibes.

The trap is writing a huge policy file that nobody maintains. Keep global rules short, then add nested rules near risky areas like billing, auth, data export, and migrations. Local scope beats one giant root document.

Run the first rollout in one repository

Use ai coding training for teams as a practice loop, not a lecture. Pick one service, one safe backlog item, and one review checklist. Then have engineers run the workflow in pairs so habits become shared language.

Prerequisites before step 1:

  • One repository with passing tests and a known owner.
  • Cursor Agent enabled for the pilot group.
  • A repo owner who can approve rule changes.
  • A short list of off-limits paths, data sources, and MCP tools.
  • One issue that can be completed without touching secrets, payments, auth, or production infrastructure.

Step 1: name the boundary. Write the paths, commands, and tools the agent may use. Put this in .cursor/rules/agent-safety.mdc and mirror the cross-tool parts in AGENTS.md.

Step 2: teach the task shape. Ask every participant to start with a plan, not a diff. The plan should name files, tests, risks, and rollback notes before the agent edits code.

Step 3: limit tool access. Give read-only MCP access by default. Add write-capable MCP servers only when a team can explain who approves the action, where it is logged, and how it can be reversed.

Step 4: review the transcript and the diff. The reviewer should check both what changed and how the agent got there. Pair this with Review Rules for AI Coding Agents if your team is formalizing AI review gates.

Step 5: verify with a boring proof. The rollout works when a new engineer can complete the pilot issue, produce a small pull request, pass the checklist, and explain the agent's boundaries without help.

Hands-on ai coding workshops work best when the exercise is real but low blast radius. A contrived demo teaches commands. A real bug fix teaches judgment.

Bound MCP and skills before scaling

Model Context Protocol, or MCP, is an integration layer that lets AI tools connect to systems such as GitHub, Slack, databases, ticket trackers, design files, and internal knowledge bases. It is powerful because it brings context to the agent. It is risky for the same reason.

Start with read-only MCP servers for search, docs, and issue context. Require approval for tools that write comments, create branches, mutate tickets, query customer data, or run deployment actions.

Reusable team skills should follow the same pattern. A skill for writing a migration plan, triaging flaky tests, or preparing a release note should include inputs, allowed commands, output format, and review checks. If the skill can change production behavior, it needs a human approval point.

The trap is giving every agent every integration because setup is easier. Easy setup becomes hard governance later. Add tools slowly, and remove tools that do not show up in successful reviewed work.

For a broader map of this training lane, keep the team anchored in the related training topic. It is easier to improve one operating model than to clean up five private ones.

Copy the team rollout plan

Paste this into your pilot repo and edit the names. Keep it short enough that people will actually read it during a pull request.

# AI coding rollout plan

## Pilot scope

Repo: checkout-service
Team owner: Payments Platform
Pilot window: two weeks
Allowed task types: tests, small bug fixes, internal refactors
Blocked task types: auth, secrets, production infra, payment capture, data deletion

## Cursor rule stub

File: .cursor/rules/agent-safety.mdc

- Start every agent task with a plan that names files, tests, risks, and rollback notes.
- Ask before editing files outside the current issue scope.
- Do not edit infra, auth, secrets, migrations, or generated lockfiles without explicit approval.
- Prefer small diffs. Stop after one coherent change.
- Run the narrowest relevant test first, then the broader suite if the change still looks valid.
- Summarize tool use and unresolved uncertainty in the pull request description.

## AGENTS.md boundary

- Agents may edit src/checkout/** and tests/checkout/**.
- Agents may read docs/** and ADRs for context.
- Agents must not write to infra/**, packages/auth/**, db/migrations/**, or scripts/deploy/**.
- Agents must not use write-capable MCP tools unless the reviewer approved the action in the issue.
- Humans own merge decisions, production risk, and customer-data access.

## CLAUDE.md note for teams using Claude Code

- Keep durable architecture constraints here.
- Do not store secrets or one-off task prompts here.
- Link to the same AGENTS.md boundaries used by the rest of the repo.

## Custom subagent note

Name: test-maintainer
Purpose: propose focused test updates for checkout behavior.
Allowed files: tests/checkout/** only.
Required output: changed tests, command run, failure before, pass after, remaining risk.

## Review checklist

- The pull request explains the human intent.
- The agent plan matches the final diff.
- Touched files are inside the allowed scope.
- MCP or external tool use is listed.
- Tests were run and the output is included.
- Risky areas were not edited, or approval is linked.
- The reviewer can explain the change without trusting the agent transcript.

## Verification

A new pilot participant can complete one safe issue, open a small PR, pass this checklist, and name one thing the agent was not allowed to do.

Common questions

  • How do we train software teams on AI coding tools safely?

    Start with one repo, one low-risk task type, one shared rule file, and one review checklist. The practical answer to how to train software teams on AI coding tools safely is to practice the full loop: plan, bounded agent work, tests, transcript review, and human merge ownership.

  • Should every team use the same AGENTS.md?

    No, use the same structure but different local rules. A platform repo, a billing service, and a mobile app have different risk surfaces; each should define allowed paths, blocked paths, test commands, and approval points. Shared templates help, but nested repo instructions keep the agent close to the code it is changing.

  • How strict should MCP boundaries be at the start?

    Start stricter than feels convenient. Read-only MCP access is usually enough for early agentic coding training, because the agent mostly needs context from issues, docs, and code search. Add write tools only after the team has logs, ownership, and a rollback story for each action.

  • Is a long-running agent orchestrator safe for production work?

    Not by itself. An orchestrator can make long-running coding agents easier to watch, pause, and compare, but production safety still comes from scoped permissions, tests, human review, and release controls. Use orchestration to improve visibility, not to skip engineering judgment.

  • What should engineering leaders measure after the workshop?

    Measure reviewed outcomes, not agent activity. Useful signals include pull request size, review rework, test pass rate, policy violations, and whether engineers can explain the agent boundary. Developer productivity improves when the workflow produces smaller, clearer changes, not when agents simply generate more code.

Further reading

Start with one safe loop

Pick one repo this week and add the rule stub, the AGENTS.md boundary, and the review checklist. Then run one real issue through the loop before you invite the whole team in.

One methodology lens

One useful way to read this through our methodology is the Plan step: delegate first-pass decomposition and dependency mapping, review the sequencing and assumptions, and keep ownership of scope and priorities. If that split is still fuzzy, the workflow usually is too.

Related training topics

Related research

Continue through the research archive

Ready to start?

Transform how your team builds software.

Get in touch