Eight Design Axioms Distilled from the Source Code of Mainstream Agent Frameworks

    As AI agent frameworks rapidly evolve, their implementation details vary widely, yet strong architectures tend to follow similar underlying principles. By studying the source code of several widely used agent frameworks, this article distills a set of broadly applicable design axioms. These axioms are framework-agnostic and answer the most fundamental questions in agent harness architecture: How should subtasks be abstracted? How should external capabilities be integrated? And should the core control loop be kept in-house or handed off?

    Eight Design Axioms Distilled from the Source Code of Mainstream Agent Frameworks

    As AI agent programming tools evolve rapidly, different frameworks differ greatly in implementation details, but strong architectures tend to follow similar underlying principles. By reading the source code of several widely adopted technical approaches, you can distill a set of universally applicable design axioms. These axioms are not tied to any specific product. Instead, they answer the most fundamental questions in agent harness architecture: How should subtasks be abstracted? How should external capabilities be plugged in? And should the core control loop be kept in-house or handed over?

    The Core Insight: Treat “Ours” and “Theirs” as the Same Class of Thing

    A notable architectural pattern exists across mainstream agent frameworks: the named backend registry.

    Take a typical subtask management module as an example. In-process subtask spawning and forking, out-of-process protocol-based agents, and various third-party coding agents are all registered as “providers” into the same registry. The delegation tool does not care what the backend actually is; it routes purely by name.

    This design means the framework, at the architectural level, treats its own subagents and external tools as one abstraction. An external command-line agent, once wrapped by an adapter layer, is indistinguishable from a natively spawned subtask in terms of scheduling.

    1. // Illustrative code: a unified backend registration abstraction
    2. interface SubagentBackend {
    3. name: string; // Unique name in the registry
    4. start(task: TaskSpec): Session; // Start a session
    5. send(session: Session, msg: Message): void;
    6. await(session: Session): Result; // Wait for completion and collect the result
    7. }
    8. class SubagentManager {
    9. private registry = new Map<string, SubagentBackend>();
    10. register(backend: SubagentBackend) {
    11. this.registry.set(backend.name, backend);
    12. }
    13. async delegate(backendName: string, task: TaskSpec) {
    14. const backend = this.registry.get(backendName);
    15. if (!backend) throw new Error(`backend ${backendName} not found`);
    16. const session = backend.start(task);
    17. return backend.await(session);
    18. }
    19. }

    From this pattern, the following eight design axioms can be distilled.

    Axiom 1: Subtasks Must Be Addressable, Not One-Shot Calls

    One-shot calls (call and return) cannot support multi-agent collaboration. Subtasks should be session-based: they have a lifecycle, can continuously send and receive messages, and can be interrupted and reaped. Every backend in the registry implements the same session interface rather than exposing only a run() function. Addressability is the prerequisite for routing, monitoring, and error recovery.

    Axiom 2: The Registry Is the Gateway to the Ecosystem

    The point of a named registry is decoupling. Orchestration logic depends only on a “name → capability” mapping, not on concrete implementations. Adding a new backend—whether in-process or an external process—requires only implementing the interface and registering it, with no changes to the delegation tool itself. This is the same philosophy behind plugin systems: the framework defines the contract, and the ecosystem provides implementations.

    Axiom 3: External Tools and Native Subtasks Must Be Isomorphic at the Scheduling Layer

    Many frameworks treat external tools as second-class citizens, handling them with special-case branching logic. Mature designs do the opposite: an adapter layer translates an external process’s standard input/output, state signals, and exit semantics into a session protocol identical to that of native subtasks. Once isomorphic, load balancing, concurrency control, and timeout policies can be applied uniformly.

    Axiom 4: The Delegation Tool Only Routes; It Does Not Implement

    The delegation logic should be strictly limited to: parsing the target name, looking up the registry, forwarding the task, and waiting for the result. Any special handling for specific backends belongs in the backend adapter layer. Separating routing from implementation keeps the framework’s core loop stable—adding a new backend introduces no regression risk.

    Axiom 5: The Abstraction Layer Must Cover Failure Semantics

    Anyone can write the happy path; real differences emerge in failure handling. A qualified session abstraction must answer: How is a crashed backend process detected? Should a timed-out task be retried or escalated? How are partial results returned? Every backend in the registry must declare its own failure semantics, and the framework applies unified degradation and recovery strategies based on those declarations.

    Axiom 6: The Process Boundary Is the Trust Boundary

    In-process subtasks share memory and credentials, while out-of-process backends require explicit context passing. When designing the protocol, frameworks should assume external backends are untrusted by default: minimize the context handed down, isolate credentials, and audit inputs and outputs. This axiom is especially critical in enterprise scenarios—for example, when combining cloud object storage, logging services, and monitoring/alerting for task auditing.

    Axiom 7: Protocol over Implementation

    Out-of-process collaboration depends on the protocol, not the SDK. Once a protocol is stable, tools implemented in any language can integrate; an SDK is merely a convenience wrapper around the protocol. Design the message formats, session state machines, and error code systems first, then write the client libraries. Protocol first, so the ecosystem can grow across languages.

    Axiom 8: Daring to Hand Over the Core Loop Is the Mark of Maturity

    The final and most important axiom: whether a framework is mature can be judged by whether it dares to hand its most core loop to external agents.

    Many frameworks treat the “reason—call tool—observe” main loop as their most closely guarded secret, wrapping it in layers and allowing no external participation. The architecturally more confident approach is to acknowledge that external agents can also execute this loop, with the framework stepping back into the roles of orchestrator and arbiter. This redefines the framework’s self-positioning from “I am the only brain” to “I am the best command system.” The former fears being replaced; the latter does not fear comparison.

    This openness creates a positive architectural feedback loop: the registry mechanism enables external integration, the unified abstraction guarantees integration quality, and protocolization lowers integration costs. Ultimately, the framework’s competitiveness rests on orchestration capability, observability, and engineering stability—the parts that are genuinely hard to replicate.

    Conclusion

    The eight axioms boil down to one sentence: use a registry to unify heterogeneous backends, use protocols to dissolve process boundaries, and use openness to build ecosystem momentum. For teams designing or evaluating agent frameworks, these axioms serve as a checklist: Are your subtasks addressable? Does your delegation logic only route? Are your failure semantics complete? And the most critical question of all—do you dare to hand over your core loop?