Skip to content
mentoor

Topic 4 of 4 · 4 min read

Features that do not port between coding agents

Goal: Identify which safety controls a team loses when an engineer switches agents and decide how to restore them.

Instructions are advice and travel easily; controls are enforcement and mostly do not, so switching agents can silently remove the guardrails your team relies on.

Check yourself · 1 of 3

Which of these is enforcement rather than advice?

Choose one answer

Why it matters

A line in AGENTS.md saying "never run rm -rf" is a request. A permission rule that blocks the command is a lock. Models drop instructions, so teams put the important limits in locks. Those locks live in one tool's settings. When an engineer moves to another agent, the request travels with the repository but the lock stays behind.

What differs by tool

  • Hooks: scripts that run before or after a tool call and can block it. Claude Code documents a hooks system. Other agents may have a different one, a partial one, or none.
  • Permission rules: allow, ask and deny lists for commands and file paths. Names, syntax and defaults differ.
  • Approval modes: how often the agent asks before acting, and whether it can run with no prompts at all.
  • Subagents and custom agents: separate agents with their own tools and context. The definition files are not shared between tools.
  • Sandboxing: whether commands run in an isolated environment, and what network access they get.

How to find the gap

  1. List the controls you rely on today, one per row: the secret-file deny rule, the format-on-save hook, the approval prompt for deploy commands.
  2. Add a column for each agent your team might use.
  3. For each cell, read that agent's docs and write: equivalent exists, partial, or none.
  4. Every "partial" or "none" in a row you depend on is a risk to name.

How to restore the control

Move the control to a layer that does not depend on the agent:

  • Git hooks and CI checks that run whatever tool made the change.
  • Branch protection, required review and secret scanning on the repository.
  • Scoped credentials, so the agent cannot reach production even if told to.
  • A short team rule: an agent may be used only if the table shows its controls.

Before and after

Before: a Claude Code hook blocks edits to migrations/. A Cursor user edits a migration and nobody notices.

After: a CI check fails any pull request that changes migrations/ without the schema-reviewed label. The control now holds for every agent.

What goes wrong

  • Treating an instruction as a control. The agent may skip it.
  • Assuming the same name means the same behaviour. A "deny" rule in two tools can match differently.
  • Moving credentials with the engineer. The new agent inherits full shell access.

Examples

The hook that stayed behind

A team blocks reads of .env with a Claude Code hook. A new hire uses another agent with no such hook and no deny rule. The agent opens .env to debug a connection. The fix is scoped dev credentials and a secret scanner in CI, so the control no longer depends on the agent.

A small control table

Control Agent 1 Agent 2
Block .env reads deny rule none
Ask before deploy approval prompt partial
Block migrations/ edits hook none

The two "none" cells need a CI check or a credential change.

Key points

  • Instructions travel between agents, but hooks, permission rules and approval modes are per tool.
  • A rule in AGENTS.md is a request, and a permission rule or hook is enforcement.
  • Build a table of the controls you rely on against each agent, and mark equivalent, partial or none.
  • Restore lost controls in agent-independent layers: CI, git hooks, branch protection and scoped credentials.
  • Do not assume the same control name means the same matching behaviour in a different tool.

Common mistakes

  • Writing a safety limit as an instruction and calling it a control.
  • Assuming a new agent has the permission rules of the old one.
  • Checking features by name instead of reading how each tool matches paths and commands.
  • Fixing the gap by trust alone, with no check outside the agent.

Check yourself · 2 of 3

An engineer switches to a new coding agent. What is the biggest risk to check first?

Choose one answer

Check yourself · 3 of 3

A control exists only as a hook in one agent. What is the most robust way to keep it for all agents?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic