π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
ADR-374 β SubagentPermissionDelegate: Workspace-Scoped Privilege Delegation for Swarm Agents
Status: Proposed
Authors: claude (dream-cycle agent, 2026-07-24)
Related: Dream Cycle 2026-07-24, arXiv 2606.31174 (ClawArena-Team)
Context
The ClawArena-Team benchmark (arXiv 2606.31174, 2026) evaluated 41 subagent orchestration scenarios across 258 rounds and found:
- No tested LLM model exceeded 50% workspace-permission precision when acting as team lead
- The primary management bottleneck for LLM-orchestrated swarms is privilege granting, not perception or reasoning
- API cost and management quality are decoupled β 100Γ cost span yields <4Γ quality span
Ruflo's current swarm init spawns subagents with no formal permission delegation protocol. Each agent inherits the full capability set of the invoking session. This is equivalent to running all swarm workers as root β it violates least-privilege, makes audit trails impossible, and is the exact failure mode ClawArena-Team identifies as the bottleneck.
Decision
Add a SubagentPermissionDelegate protocol to swarm init that:
- Assigns each spawned agent a workspace-scoped capability token derived from the swarm topology and the agent's declared role
- Enforces the token at the hook layer (
pre-task,pre-edit) before any file system or MCP tool access - Generates an audit trail of permission grants/denials per swarm run in
.swarm/permission-audit.jsonl
Token Shape (minimal)
interface SubagentCapabilityToken {
agentId: string;
swarmId: string;
role: AgentRole; // 'coder' | 'reviewer' | 'tester' | ...
allowedPaths: string[]; // glob patterns, e.g. ['src/**', 'tests/**']
allowedTools: string[]; // e.g. ['Read', 'Edit', 'Bash']
denyTools: string[]; // e.g. ['git push', 'npm publish']
expiresAt: number; // epoch ms
}
Integration Points
swarm init --with-permissionsflag enables the protocol (opt-in initially)@claude-flow/security'sInputValidatorvalidates token at hook boundaries@claude-flow/hookspre-taskhook enforces allowedTools check- Default role-to-permission maps ship in
config/swarm-permission-defaults.json
Consequences
Positive:
- Closes the #1 ClawArena-Team bottleneck for Ruflo swarms
- Enables auditable, reproducible swarm runs
- Path to >50% workspace-permission precision on ClawArena-style eval
Negative:
- Adds configuration overhead for swarm setup
- Default permission maps will be wrong for some workflows; users must tune
- Breaking change if
--with-permissionsbecomes default in a future minor release
Neutral:
- Scope: this is a protocol + hook integration; no changes to existing agent types or MCP tools
- Does NOT require consensus changes (raft stays unchanged)
Alternatives Considered
- Full sandbox isolation per agent (Docker/E2B per agent): Too expensive (~200-500ms setup per agent, disk cost); ruled out for standard swarms. Reserved for
isolation: 'worktree'mode already implemented. - No change: Status quo permits swarms to work but leaves ClawArena-level precision gap unaddressed.
Implementation Notes
no ADRclassification does NOT apply: this is an architectural protocol change, not a parameter tweak- First milestone: permission-audit.jsonl with read-only enforcement (allowedPaths)
- Second milestone: tool-level enforcement (allowedTools/denyTools)
- Benchmark target: measure against ClawArena-Team criteria after implementation