← Notes·Sub-Agent Control Patterns
Dojo Note · Beta

Implementation Takeaways

FikAi ·

What to Change in Your Architecture (Now)

  • Kill autonomous sub-agents in prod. If any agent can loop freely, you’re accepting exponential failure. Replace with Kernel-controlled orchestration immediately.
  • Default to max_turns=1. Centralize control first. Only reintroduce autonomy where you can prove it’s safe.
  • Make the Kernel a controller, not a planner. One decision per turn. No long plans, no strategies—just the next action.
  • Persist state every turn. Checkpoint after every Kernel cycle so failures are replayable and repairable.

How to Safely Reintroduce Autonomy

  • Use bounded leases (N ≤ 5). Grant limited autonomy only for tasks fully inside a specialist’s skill domain (e.g., fixing syntax).
  • Add deterministic yield checks in code. Do not let the LLM decide when to escalate. Auth, infra, and spec errors must hard-yield on turn 1.
  • Record and compress trajectories. Keep sub-agent loops observable without flooding the Kernel context.

Enforce Cognitive Boundaries

  • Define Role Contracts per agent. Explicitly specify:
    • Epistemic domain (what it knows)
    • Authorized tools (what it can do)
    • Mandatory yield conditions
  • Enforce contracts architecturally. Don’t “forbid” tools—don’t inject them at all.
  • One epistemic task per agent. Never mix research + coding + execution in one invocation.

Manage Information Flow

  • Never pass critical facts via raw context. Use structured storage (KV store / blackboard) for APIs, credentials, schemas.
  • Assume cross-agent recall is ~40%. If it matters, persist it outside the prompt.
  • Type agent outputs. Replace string parsing with structured signals for routing and repair.

Gotchas & Tradeoffs

  • More calls ≠ more cost. Controlled loops reduce token burn from runaway failures.
  • Partial success is the silent killer. Always add semantic validation, not just exit codes.
  • Architecture beats prompts. If reliability is bad, don’t tune prompts—fix boundaries.

Bottom line: Treat LLMs like unreliable components in a control system. Bound them, observe them every turn, and never let cognition leak across roles.


Implementation Takeaways — FikAi notebook for Sub-Agent Control Patterns.