Two Control Philosophies for Coding Agents: Architecture and Engineering Practices
This article compares two architectural philosophies for AI coding agents: externally orchestrated control and model-driven autonomy. It explains how the allocation of control shapes an agent's capabilities, contrasts fixed role separation with dynamic subagent generation, and outlines engineering practices such as permission layering, structured context contracts, human approval gates, observability, and rollback mechanisms to combine the strengths of both approaches.
Two Control Philosophies for Coding Agents: Architecture and Engineering Practices
1. Start With the Problem: Control Allocation Defines an Agent’s Capability Boundary
In engineering practice, differences in how coding tools perform often come not from the strength of the underlying model, but from how the system allocates control. Two common approaches in the industry can be abstracted as follows: one is “humans manage the AI,” keeping decision authority in an external framework and with the user; the other is “the AI manages itself,” handing the goal to the model and letting it decide when to think and when to act. The former can be called an externally orchestrated control architecture, and the latter a model-driven autonomous orchestration architecture.
The core idea of externally orchestrated control is that the large model only provides code generation and explanation capabilities, while a separate, auditable, and replaceable scheduling system sits around it. The scheduling layer handles state machine progression, role constraints, failure retries, and termination conditions, leaving the model no room to exceed its authority. Autonomous orchestration is equivalent to fitting the “brain” directly with “hands and feet”: the system keeps only a main agent and a fixed set of tools, with no independent external scheduler, and behavior is decided by the model in real time.
The trade-off between the two is clear: controllability and predictability versus flexibility and adaptability to long-tail problems.
2. Externally Orchestrated Control: Fixed Role Separation and Lightweight Subagents
2.1 Enforced Separation of Read and Write Permissions
The most representative design splits “thinking” and “doing” into two independent processes:
- Planning role: read-only permissions, responsible for reading code, locating call chains, and producing a refactoring plan and acceptance criteria; it cannot modify any file.
- Execution role: write and command execution permissions only, strictly changing code and running tests according to the plan, with no authority to change the plan on its own.
The two roles exchange information through the file system or structured artifacts (such as plan documents, task lists, and change records), and the user can intervene, veto, or revise at any point. This “two-person review” structure naturally suppresses the model’s tendency to “guess and modify as it goes” when information is insufficient.
A schematic representation of the role constraints can be expressed as:
roles:planner:permissions: [read, search]outputs: [plan.md, acceptance.md]builder:permissions: [read, write, exec]inputs: [plan.md, acceptance.md]constraint: "must not modify plan.md"handoff: filesystemhuman_gate: [plan_approved, diff_reviewed]
2.2 Benefits and Costs of Predefined Roles
All roles are statically defined before startup and cannot be generated at runtime. The benefit is a compressed behavior space, easy-to-audit least privilege, and short paths for problem localization; the cost is insufficient expressiveness for heterogeneous tasks that span languages and frameworks, requiring people to add roles or adjust the workflow.
2.3 The Right Way to Use Lightweight Subagents
When parallel exploration is needed, the scheduling layer can derive restricted subagents, for example to handle dependency mapping, test completion, or documentation generation. Subagents have independent contexts and a narrower toolset, and their results are aggregated back into the main flow. The key constraint is that subagents must not have write permissions or directly trigger irreversible operations.
3. Model-Driven Autonomous Orchestration: Single Agent by Default, Dynamic Generation
3.1 A Single Main Agent by Default
In normal operation, this appears as one general-purpose agent that plans, executes, and verifies on its own. The chain is short and the response is fast, making it suitable for medium-sized tasks with clear boundaries.
3.2 On-Demand Dynamic Subagent Generation
For complex tasks, the model can write code to create dedicated subagents, each with an independent context and tool permissions, avoiding pollution of the main context by large volumes of retrieval results.
3.3 Dynamic Workflow Orchestration
Going further, the model can define how subagents collaborate: a serial pipeline, parallel fan-out, or voting across multiple proposals. Since there are no predefined roles, the structure is entirely tailored to the current task. The benefit is strong adaptability to long-tail problems; the risk is that redundant hierarchies may be generated, adding context and call overhead and reducing behavioral predictability.
4. Engineering Implementation: Combining the Strengths of Both
- Permission layering: read/write separation as the baseline, with any autonomous orchestration confined to a least-privilege sandbox and implicit privilege escalation prohibited.
- Context contracts: roles exchange only structured artifacts (plans, diffs, test reports) to avoid semantic drift caused by free text.
- Human-in-the-loop gates: mandatory human confirmation points at plan approval, change review, and before release.
- Observability: uniformly record decision rationale, tool call sequences, and token consumption to enable replay and cost attribution.
- Termination and rollback: preset maximum iteration counts, failure thresholds, and version rollback strategies to prevent infinite loops.
- Elastic infrastructure: use container platforms to isolate execution environments, object storage to hold artifacts, logging services and monitoring alerts for auditing and anomaly detection, and message queues to decouple root tasks from subtasks.
5. Conclusion
The two approaches are not a matter of better or worse, but of where the control points sit. Scenarios with high task standardization and strong compliance requirements suit externally orchestrated control; exploratory scenarios with varied problem shapes can introduce controlled dynamic orchestration. A more robust practice is a hybrid: fixed roles and permission isolation hold the baseline, the model is allowed to derive and orchestrate autonomously within a controlled scope, and observability and rollback mechanisms keep the risk contained.
