How do you stop a coding agent contradicting team decisions?
Check each action before it runs. Wayform’s guard compares a coding agent’s proposed edit or shell command with your team’s recorded decisions. If the action contradicts one, the decision comes back to a person, with who made it and when, before the action goes ahead. Only an explicit human confirmation lets an exception through.
Instruction files tell an agent what to do. They can’t stop it when it drifts halfway through a long task.
How it works in Wayform
- Before a mutating action. On edits, writes, and shell commands in Claude Code, Cursor, and Codex, the guard retrieves the decisions that could apply, including any standing rule that names the file being changed.
- A model judges the conflict. Most actions pass quietly. A likely contradiction becomes a prompt or an approval card.
- A person decides. Keep the decision, change the action, or allow an exception: for that decision, for that person, for a short window. Where it applies, Narrow scopes the exception to the current branch.
- Builds add policy. In app builds, Wayform denies writes to protected paths and outside the build’s worktree, even in Auto mode, before the agent’s own reviewer sees anything.
What each client shows
| Client | Guarded actions | On a contradiction |
|---|---|---|
| Claude Code | Edit, Write, Bash |
A native permission prompt |
| Cursor | Shell, Write, StrReplace, Edit, Delete |
Blocked; the agent asks you to confirm |
| Codex | Bash, apply_patch |
Blocked; the agent asks you to confirm |
The limits, honestly
- The guard is a useful check, not exhaustive enforcement. It can miss a conflict or flag one that doesn’t apply.
- It is not a security sandbox. Hooks fail open when the service is unreachable, so silence doesn’t prove an action was checked.
- A reviewer, whether the agent’s or the guard’s, is not a security boundary.
When you don’t need it
If your rules are mechanical (formatting, lint, types), enforce them with CI and linters. The guard is for decisions that a linter can’t express, like “no second datastore” or “invitations reuse GitHub identity”.
Go further
- Decisions & shared context: recording, superseding, and exceptions.
- Agent orchestration: approvals and Auto mode.
- Your data & access.
Questions
Which coding agents does the guard work with?
Claude Code (Edit, Write, Bash), Cursor (Shell, Write, StrReplace, Edit, Delete), and Codex (Bash, apply_patch).
How do I allow an exception?
Confirm it when the guard asks. The exception covers that decision, for you, for a short window. Where it applies, Narrow limits it to the current branch.
Is the guard a security sandbox?
No. It checks actions against team decisions and can miss a conflict. Hooks fail open when the service is unreachable. In app builds, Wayform also denies writes to protected paths and outside the build’s worktree.
Should I use the guard instead of linters?
No. Keep mechanical rules in CI and linters. The guard is for decisions a linter can’t express, like “no second datastore”.