Building a 24/7 Multi-Agent Software Delivery System: Architecture, Protocols, and Governance

    This article explains how to move from a single AI coding assistant to a 24/7 multi-agent delivery system. It covers a layered architecture that separates the entry, orchestration, agent runtime, messaging, storage, tool gateway, sandbox, and observability layers; role design in which each agent owns one responsibility; a collaboration protocol built on task state machines, structured message envelopes, idempotency, retries, and human approval gates; scheduling, budgets, leases, checkpoints, and degradation strategies for unattended operation; least-privilege tool access and sandbox boundaries; a worked example of a competitor price-monitoring system; observability metrics and quality gates; and common anti-patterns to avoid when rolling out autonomous agent workflows.

    24/7 Multi-Agent Automated Development: From a Single Assistant to a Delivery System

    1. From a Single Agent Assistant to a Multi-Agent Delivery System

    A single-agent setup works well for Q&A, draft generation, and lightweight tasks. Once it enters a real software delivery pipeline, three bottlenecks appear: long task chains, many distinct role responsibilities, and context that easily contaminates itself. When one agent does market research, writes the PRD, designs the architecture, writes code, tests, and releases, it tends to lose constraints inside a long context, and it becomes hard to audit or roll back any individual step.

    The core idea of a multi-agent automated development system is not to stack more model calls. It is to decompose “requirement to delivery” into a set of orchestrable, communicating, observable roles, and to let each role complete a specialized task in its own isolated context. The orchestrator decomposes the goal, assigns work, aggregates artifacts, and handles exceptions. The specialized agents collaborate through structured messages and ultimately produce runnable software. The system can keep running overnight, on holidays, and in unattended windows, but it must be paired with budget controls, permission boundaries, quality gates, and human approval so that “autonomy” does not turn into “loss of control.”

    A typical goal looks like this: a user submits a requirement through an enterprise chat channel or a task intake form; the system automatically completes market research, the PRD, architecture design, development, testing, release preparation, and runtime monitoring, and notifies the owner at key checkpoints. For a price-monitoring system, this can extend into a closed loop of scheduled collection, anomaly detection, alerting, and report export.

    2. Overall Architecture: Separate the Orchestration Layer, Runtime, and Tooling

    To keep the system extensible, use a layered architecture instead of packing all logic into one agent prompt.

    1. Entry layer: Accepts natural-language requirements, form-based tasks, or scheduled events. It only performs identity verification, task registration, and parameter normalization; it does not execute business logic.
    2. Orchestration layer: Maintains the task state machine and owns decomposition, routing, dependency management, retries, timeouts, human approval, and result aggregation. This is the system’s control plane and should be independent of any specific agent implementation.
    3. Agent runtime: Each agent has its own context, role description, tool permissions, and output contract. The runtime loads role configuration, restricts which tools can be called, and records messages and artifacts.
    4. Message bus: Carries task messages, state events, and result notifications between agents. A message should include a task identifier, sender, receiver, context summary, artifact references, and a deadline.
    5. State and artifact storage: Persists task state, message history, code artifacts, test reports, and approval records. Artifacts are passed by versioned reference rather than by embedding large content in messages.
    6. Tool gateway: Uniformly wraps capabilities such as code generation, code retrieval, test execution, file read/write, and notification delivery, and enforces permission checks, rate limiting, and auditing.
    7. Execution sandbox: Code execution, dependency installation, and testing run in an isolated environment with restricted network access, filesystem scope, and resource quotas.
    8. Observability and governance: Logging, metrics, tracing, cost accounting, quality gates, and security auditing span the entire pipeline.

    The key benefit of this layering: agents can be swapped while orchestration logic stays stable, tool permissions can be narrowed, and every step can be audited and reproduced.

    3. Role Design: Make Each Agent Own Exactly One Thing

    More roles is not automatically better. Set clear boundaries along the delivery chain. A practical development “legion” can include:

    • Orchestrator agent: Receives the goal, generates the task graph, dispatches work, aggregates results, and resolves conflicts. It does not write code; it maintains the plan and state.
    • Research agent: Collects competitors, user needs, constraints, and risks, and outputs a structured research summary.
    • Product agent: Turns requirements into a PRD with explicit scope, priorities, acceptance criteria, and edge cases.
    • Architecture agent: Designs module boundaries, data flow, storage, alerting paths, and non-functional requirements based on the PRD.
    • Engineering lead agent: Breaks the architecture into development tasks, decides whether to call a local AI coding tool or a code generation service, reviews development output, and triggers rework when needed.
    • Development agent: Writes code, comments, and unit tests according to the task contract, modifying only files within its authorized scope.
    • Test agent: Generates test cases from the acceptance criteria, runs them, and produces defect reports with reproduction steps.
    • Release and operations agent: Produces release checklists, monitoring rules, and alerting policies, but any production change must go through human approval.
    • Notification agent: Sends key status updates, exceptions, and delivery summaries to enterprise chat channels or a ticketing system.

    Every agent must have an isolated context and must not share the full message history. The recommended pattern is “task contract + artifact references + necessary summary”: the upstream writes requirements, constraints, acceptance criteria, and artifact locations into the contract, and the downstream reads only the parts relevant to its own task. This reduces context contamination and lowers call cost.

    4. Collaboration Protocol: State Machine, Message Envelope, and Idempotency

    The most common failure modes in multi-agent collaboration are duplicate execution, lost messages, and inconsistent state. The fix is to engineer the protocol rather than rely on natural-language agreements.

    4.1 Task State Machine

    Each task has at least these states: pending scheduling, running, awaiting approval, awaiting dependencies, succeeded, failed, cancelled, and timed out. Transitions are controlled centrally by the orchestrator; agents may only report events and cannot modify global state directly.

    4.2 Message Envelope

    Messages should use a structured envelope containing the task identifier, parent task, sender, receiver, message type, context summary, artifact references, deadline, retry count, and trace identifier. Example pseudocode:

    1. Message envelope:
    2. task_id: unique task identifier
    3. parent_id: parent task identifier
    4. from: sender role
    5. to: receiver role
    6. type: dispatch | progress | result | exception | approval_request
    7. summary: required context summary
    8. artifacts: list of artifact references
    9. deadline: deadline
    10. retry: current retry count
    11. trace_id: trace identifier

    4.3 Idempotency and Retries

    The same task may be redelivered after a timeout, so before executing, an agent should check whether the task identifier and input summary have already been processed. Side-effecting operations such as writing files, sending notifications, and creating tickets must carry an idempotency key. Retries should use backoff with a maximum attempt count; messages exceeding the threshold go to a dead-letter queue for the orchestrator or a human to handle.

    4.4 Human Approval Gates

    Human approval should be mandatory for: production environment changes, privilege escalation, large-scale collection of external data, processing of data involving privacy, calls that exceed budget, and repeated quality gate failures. Approval does not interrupt automation; it brings high-risk actions inside a controlled boundary.

    5. Running 24/7: Scheduling, Budgets, and Failure Recovery

    Continuous operation is not about “letting agents run forever.” It is about keeping the system controllable while nobody is watching.

    • Event and schedule dual triggers: Requirement submissions, code changes, and alert events can trigger immediate tasks; inspections, reports, and price collection can be driven by scheduled triggers.
    • Leases and heartbeats: Long-running tasks use a lease; the executor reports heartbeats periodically. When the orchestrator sees an expired lease, it reassigns the task so nothing stays stuck permanently.
    • Budgets and rate limits: Set per-task limits on call counts, execution duration, and concurrency to prevent runaway conversations or abnormal retry loops from consuming resources.
    • Checkpoints and recovery: Save artifacts and state after each stage completes, and resume from the most recent checkpoint on failure instead of rerunning the whole pipeline.
    • Degradation strategy: When the model service is unavailable, fall back to rule-based templates or hand off to a human; when the notification channel is unavailable, write to a pending-send queue and retry.

    Simplified orchestrator pseudocode:

    1. function run_task(task):
    2. state = load_state(task.id)
    3. if state == SUCCESS or state == CANCELLED:
    4. return state
    5. plan = orchestrator.plan(task)
    6. for node in plan.nodes:
    7. if not dependencies_ready(node):
    8. continue
    9. if node.risk_level >= APPROVAL_THRESHOLD:
    10. request_human_approval(node)
    11. continue
    12. result = dispatch_with_retry(node)
    13. save_artifact(node, result)
    14. return summarize(plan)

    6. Tool Invocation and Security Boundaries

    The more capable an agent is, the more it needs least privilege. The tool gateway should grant permissions per role: the research agent can only read public sources and write research reports; the development agent can only modify a designated code directory; the test agent can only read code and execute tests; the release agent cannot operate production directly and can only generate change requests.

    The execution sandbox should restrict network access, filesystem scope, and resource quotas. Generated code must not go straight to production; it must pass static checks, unit tests, integration tests, and human approval. Every tool invocation record should include the caller, a parameter summary, result status, and elapsed time, so auditing and troubleshooting are possible.

    7. Example: Agent Collaboration in an E-Commerce Competitor Price Monitor

    For a price-monitoring system, the goal can be stated as: periodically collect competitor prices, original prices, discounts, and stock status; provide trend charts with anomaly markers; send alerts through enterprise chat channels when prices are low, fluctuate sharply, or items go out of stock; and support spreadsheet export.

    The research agent outputs the competitor scope and field definitions. The product agent defines collection frequency, alert thresholds, report dimensions, and acceptance criteria. The architecture agent designs the collector, cleaning module, storage, rule engine, alerting service, and reporting service. The engineering lead agent splits work into collection, rules, notification, and reporting tasks. Development agents implement the modules. The test agent validates threshold boundaries, duplicate-alert suppression, and export completeness. The operations agent configures monitoring metrics and alerting policies.

    The rule engine can be expressed as pseudocode:

    1. function evaluate(price_record, history):
    2. if price_record.stock == 0:
    3. return alert("out_of_stock")
    4. if price_record.price <= price_record.target_low:
    5. return alert("low_price")
    6. baseline = median(history.last_7_days)
    7. if abs(price_record.price - baseline) / baseline >= 0.2:
    8. return alert("sharp_fluctuation")
    9. return no_alert()

    The value of this example is that it covers scheduled tasks, data collection, rule evaluation, notification, and report export, which makes it a good validation scenario for a multi-agent automated development system. In production, however, you still need to handle scraping compliance, collection rate limits, data quality validation, and alert storm suppression.

    8. Observability and Quality Gates

    A multi-agent system must be observable; otherwise you cannot determine “which role made which decision in which context.” Recommended records: task state transitions, message send/receive, tool invocations, artifact versions, test results, approval records, and cost accounting. Key metrics include task success rate, average delivery time, rework rate, human intervention rate, alert false-positive rate, and resource consumption per task.

    Quality gates should include at minimum: completeness check of acceptance criteria, architecture design review, code static analysis, unit test pass rate, integration test results, sensitive-information scanning, and a release checklist. When a gate fails, the orchestrator should automatically create a rework task rather than letting the development agent loop indefinitely.

    9. Rollout Advice and Common Anti-Patterns

    Start with low-risk, verifiable scenarios such as report generation, inspection scripts, test case augmentation, and internal tooling, then expand gradually to the full delivery chain. Do not begin by letting multiple agents converse freely; first define task contracts, message formats, and the state machine, then add more roles.

    Common anti-patterns include: all agents sharing one long context, which causes information contamination; no idempotency keys, leading to duplicate notifications or duplicate file writes; granting production permissions directly to the development agent; no budget limits, so abnormal loops consume resources; recording only final results and not intermediate decisions; and equating “automated” with “no approval.” The safer approach: automate repetitive work, keep high-risk decisions with humans, and use observability data to continuously improve role division and gate rules.

    Conclusion

    The essence of a 24/7 multi-agent automated development system is to decompose the software delivery process into an orchestrable task network, assign specialized responsibilities to professional agents with isolated contexts, and keep the system controllable through a message bus, state machine, sandbox, permissions, and approval mechanisms. It does not replace an engineering team; it frees the team from repetitive coordination and low-value handoffs, making the flow between requirements, design, development, testing, and operations more automated and auditable. With clear boundaries, a rigorous protocol, and solid governance, multi-agent collaboration can move from a demo to a sustainable production practice.