Coordinator Enforcer Plugin (Legacy)
Coordinator Enforcer: Automatically block direct work tools in main sessions (superseded by role-enforcer)
Coordinator Enforcer Plugin (Legacy)
⚠️ Superseded by Role Enforcer. The Role Enforcer provides everything the Coordinator Enforcer does, plus manager-tier enforcement, file-path aware blocking, and context bloat warnings. New setups should use
role-enforcerinstead. See the migration guide.
Code = Law. The coordinator does ZERO implementation work.
The Coordinator Enforcer plugin automatically blocks direct work tools (Edit, Write, exec) in main coordinator sessions, ensuring the main agent delegates all implementation to sub-agents via sessions_spawn.
Philosophy
The coordinator model keeps the main agent lean and focused:
| Role | Responsibility |
|---|---|
| Coordinator | Plans, researches, delegates, monitors |
| Sub-agents | Do the actual implementation work |
Benefits of enforcement:
- Keeps coordinator context clean
- Sub-agents have fresh context = better work
- Auditable task history
- Coordinator can monitor multiple parallel tasks
- No "just this once" temptation
Installation
- Copy the plugin to your Reeve plugins location:
# User plugins (recommended)
cp -r extensions/coordinator-enforcer ~/.reeve/plugins/
# Or system-wide
cp -r extensions/coordinator-enforcer /path/to/reeve/extensions/- Enable in
reeve.json:
{
"plugins": {
"coordinator-enforcer": {
"enabled": true
}
}
}- Restart Reeve gateway
Configuration
Minimal Config
{
"plugins": {
"coordinator-enforcer": {
"enabled": true,
"logBlocks": true
}
}
}Full Config
{
"plugins": {
"coordinator-enforcer": {
"enabled": true,
"blockMessage": "Coordinator cannot do direct work. Use sessions_spawn instead.",
"mainSessionPatterns": ["^agent:main:main$", "^main$"],
"blockedTools": ["Edit", "Write", "exec"],
"allowedTools": [
"Read", "memory_search", "memory_get",
"sessions_spawn", "sessions_list", "sessions_poll",
"web_search", "web_fetch", "browser",
"image", "tts", "message", "nodes", "canvas", "process"
],
"strictMode": false,
"logBlocks": true,
"execBlockPatterns": [
"^git\\s+", "^npm\\s+", "^pnpm\\s+", "^yarn\\s+",
"^rm\\s+", "^mv\\s+", "^cp\\s+"
],
"execAllowPatterns": [
"^ls\\s+", "^cat\\s+", "^head\\s+", "^tail\\s+",
"^grep\\s+", "^find\\s+", "^pwd$", "^echo\\s+"
]
}
}
}Options Reference
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable enforcement |
blockMessage | string | "Coordinator cannot..." | Message shown when blocked |
mainSessionPatterns | string[] | ["^agent:main:main$", "^main$"] | Regex patterns for main sessions |
blockedTools | string[] | ["Edit", "Write", "exec"] | Tools to block |
allowedTools | string[] | (see above) | Tools explicitly allowed |
strictMode | boolean | false | Block ALL except allowedTools |
logBlocks | boolean | true | Log blocked attempts |
execBlockPatterns | string[] | (see above) | Exec commands to block |
execAllowPatterns | string[] | (see above) | Exec commands to allow |
How It Works
Session Detection
The plugin identifies main coordinator sessions via regex patterns:
^agent:main:main$— Standard main agent session^main$— Alternative main session key
Sub-agent sessions are NEVER blocked. Sessions containing :subagent: are automatically excluded from enforcement.
Tool Blocking Logic
Tool call arrives
↓
Is this a main coordinator session?
├── No → Allow (sub-agents can do anything)
└── Yes → Check tool
├── Edit/Write → BLOCKED
└── exec → Check command patterns
├── Matches allowPattern → Allow
├── Matches blockPattern → BLOCKED
└── No match → AllowSmart Exec Handling
Not all shell commands are equal. The plugin allows read-only commands while blocking modifications:
Allowed by default:
ls,cat,head,tail(reading)grep,find,which(searching)pwd,date,whoami(info)
Blocked by default:
git(version control)npm,pnpm,yarn,cargo(package managers)rm,mv,cp(file operations)python *.py,node *.js(script execution)
Error Messages
When blocked, the agent receives helpful guidance:
Coordinator cannot do direct work. Use sessions_spawn instead.
Blocked tool: Edit
Session: agent:main:main
To edit a file, spawn a sub-agent:
sessions_spawn(task="Edit file X to do Y", label="edit-task")Gateway API
Check Status
reeve gateway call coordinator-enforcer.statusReturns:
{
"ok": true,
"enabled": true,
"strictMode": false,
"stats": {
"blockedCalls": 42,
"allowedCalls": 1337,
"lastBlockedTool": "Edit",
"blocksByTool": { "Edit": 30, "exec": 12 }
}
}Check Session
reeve gateway call coordinator-enforcer.check-session \
'{"sessionKey": "agent:main:main"}'Simulate Tool Call
reeve gateway call coordinator-enforcer.simulate '{
"sessionKey": "agent:main:main",
"toolName": "exec",
"command": "git status"
}'Reset Stats
reeve gateway call coordinator-enforcer.reset-statsExamples
Wrong: Coordinator doing direct work
# Main session tries to edit - BLOCKED!
Edit(path="file.py", oldText="x", newText="y")
# Error: Coordinator cannot do direct work...Right: Coordinator delegates
# Main session delegates - ALLOWED!
sessions_spawn(
task="Change x to y in file.py",
label="fix-typo"
)
# Returns: spawned subagent IDStrict Mode
For maximum enforcement, enable strict mode:
{
"plugins": {
"coordinator-enforcer": {
"enabled": true,
"strictMode": true,
"allowedTools": [
"Read",
"memory_search",
"sessions_spawn",
"sessions_list",
"sessions_poll",
"web_search"
]
}
}
}In strict mode, ONLY tools in allowedTools are permitted—everything else is blocked.
Troubleshooting
Plugin not blocking?
- Check
enabled: truein config - Verify session key matches
mainSessionPatterns - Check logs:
grep "coordinator-enforcer" ~/.reeve/logs/gateway.log
Need to allow specific exec commands?
Add patterns to execAllowPatterns:
{
"execAllowPatterns": [
"^ls\\s+",
"^reeve\\s+",
"^my-safe-script$"
]
}Sub-agents being blocked?
Sub-agent sessions (containing :subagent:) are automatically excluded. If issues persist, check your session key patterns.
Need to disable temporarily?
{
"plugins": {
"coordinator-enforcer": {
"enabled": false
}
}
}Or call the gateway:
reeve gateway call coordinator-enforcer.disableIntegration with Operating Model
This plugin codifies the principles in:
- Coordinator Model — Philosophy
- Spawning Sub-Agents — How to delegate properly
- Pipeline V3 — Advanced orchestration
- Pipeline V3 Tools — CLI tools for pipelines
Using with Pipeline V3
The coordinator-enforcer works seamlessly with Pipeline V3 tools:
# The pipeline spawns sub-agents for all work
# Main session stays clean, enforcer never triggered
./bin/run-pipeline-v3.py --spec docs/plan.md --repo ./app
# Audit tools also spawn sub-agents for fixes
./bin/run-audit-v3.py --repo ./app
# Logic audit verifies via sub-agents
./bin/run-logic-audit-v3.py --frontend ./frontend --backend ./backendThe pipeline tools use ReeveLLMCaller which spawns sessions with IDs like pipeline-Architect-1, which are automatically excluded from enforcement (not main sessions).
See Also
- Multi-Agent Routing — Agent isolation
- Plugin Development — Creating custom plugins
- Pipeline V3 Tools — Tool reference