betaFeedback

WorksComputer Science

AECP: Artifact-Exclusive Communication Protocol for Multi-Agent Code Generation

Abstract

As AI agents increasingly tackle complex repository-level coding tasks, distributing work across multiple agents is a natural way to scale beyond the capabilities of a single agent. To coordinate their interdependent work, these agents share findings and agree on interfaces between modules. However, exchanged information often serves only as context, leaving individual agents to interpret it and incorporate it into subsequent work. Consequently, shared findings may go unused and deviations from interface agreements may go undetected, undermining the reliability and efficiency of collaboration. This motivates moving part of the coordination responsibility from individual agents to the execution harness. To make shared information actionable during execution, we introduce the Artifact-Exclusive Communication Protocol (AECP). AECP requires agents to communicate exclusively through structured artifacts and specifies how the harness processes them. The harness supplies findings when agents access relevant code, screens implementations for mismatches with recorded interface commitments, and requires affected agents to revisit revised agreements. These coordination steps become part of harness execution rather than actions that agents must initiate from prior messages. Across Doc2Repo, NL2Repo, and CodeProjectEval, using closed- and open-source models including Opus-4.8 and DeepSeek-V4-Flash, AECP improves average test pass rate by 28.2% and reduces average wall time by 16.5% relative to an agent team using free-form inter-agent messages. Artifact-exclusive communication also blocks the relay of malicious instructions between agents, reducing how often they reach other agents from 95% to 0% and how often those agents act on them from 40% to 0%.

Introduction

LLM-based coding agents ([41, 38]) increasingly tackle software engineering tasks ranging from localized bug fixes to repository-level development ([18, 12, 10]). As these tasks grow in scope, single agents face a greater context burden and longer completion times. Decomposing and assigning subtasks to multiple agents can reduce this burden and enable parallel execution ([46, 5 a] (OpenAI 2026)). This division of work, however, leaves knowledge and implementation decisions distributed across separate agent contexts, even though the subtasks remain interdependent. Agents therefore need to share knowledge and align implementation decisions to avoid duplicated exploration and incompatible implementations ([9, 20]).

Existing multi-agent coding systems coordinate either centrally, where a main agent or a predefined role sequence assigns bounded subtasks and integrates the results ([15, 31, 46, 5, 13, 7] (OpenAI 2026)), or among peers, where teammates own separate workstreams and communicate directly ([37, 1]). In both cases, an agent decides what to do with exchanged information: the coordinator reads returned summaries, and teammates read each other’s messages. Using shared findings and checking implementations against agreed interfaces are therefore left to agents. As illustrated in Figure 1 (a), a shared finding may be overlooked when an agent writes related code, or an implementation may depart from an agreed interface without the mismatch being detected. Khatua et al. [20] observe that agents spend up to a fifth of their steps communicating, yet communication does not improve overall task success. Their failure analysis identifies difficulties in integrating communicated information and honoring commitments, while broader analyses also report ignored peer messages and missing or incomplete verification ([9]). These findings highlight a gap between exchanging information and reliably using it to guide and check subsequent implementation.

Figure 1. Multi-agent coordination and development overhead. (a) Agents interpret exchanged messages and decide how to act on them; shared plans and agreements may be followed, deviated from, or ignored. (b) AECP requires exchanges to pass through structured artifacts, enabling the execution harness to guide agents with shared knowledge and check implementations against recorded agreements. (c) Token and interaction-turn distributions for the natural-language communication baseline across 104 NL2Repo tasks, estimated from LLM-labeled trajectories (Appendix § 13).

To bridge this gap, the execution harness can participate directly in coordination, using exchanged information to guide and check agents’ work. We introduce the Artifact-Exclusive Communication Protocol (AECP), in which agents communicate exclusively through structured artifacts. Every coordination exchange is thus mediated by the execution harness. As shown in Figure 1 (b), guiding agents with shared findings and checking their implementations against agreements become actions that the harness carries out under the protocol’s rules, reducing reliance on agents to initiate them from prior messages.

To identify where such coordination support could reduce development overhead, we analyze multi-agent coding trajectories across all tasks in NL2Repo ([12]). As shown in Figure 1 (c), repeated exploration accounts for 26.8% of token usage, while rework caused by incompatible decisions at module boundaries accounts for another 22.2%. These observations motivate two complementary forms of support: knowledge reuse across subtasks and consistency checks between interdependent implementations. AECP provides a Knowledge Artifact through which agents record findings for the harness to supply during subsequent work, helping other agents build on prior exploration. A Contract Artifact records interface agreements with conditions that the harness can check against implementations, helping detect incompatibilities during development.

We evaluate AECP on repository construction, where agents build a repository from documentation or natural-language requirements in an empty workspace, using Doc2Repo ([10]), CodeProjectEval ([47]), and NL2Repo ([12]). Averaged across models and benchmarks, AECP improves test pass rate by 10.6% over a single agent, and by 28.2% and 8.5% over agent teams that use free-form messages ([37]) or centralized integration ([13]), while reducing wall time by 16.5% and 24.9% relative to these teams. Artifact-exclusive communication also blocks the relay of malicious instructions from a compromised agent, reducing how often they reach other agents from 95% to 0% and how often they are acted on from 40% to 0%.

Background and Related Work

Multi-agent Coding Systems

Coding agents extend the reason–act–observe loop ([42]) to repository navigation, file editing, code execution, and testing ([41]). Within this loop, the LLM selects actions, while the surrounding software layer, or harness, executes them, returns observations, and manages workspaces and execution state. Growing context and sequential execution costs motivate distributing work across agents, either by delegating subtasks from a main agent ([5, 46, 13, 7] (OpenAI 2026)) or by forming teams whose members coordinate among themselves ([31, 15, 1]); Appendix § 7 describes both patterns. In both cases, what agents exchange passes through the harness, and keeping the work coherent depends on what is done with it afterwards.

Coordination Challenges

Agents that work with separate contexts face coordination challenges [20, 9]. CooperBench [20] identifies three recurring causes of coordination failure: (i) expectation failures, where an agent does not incorporate a partner’s communicated plans or changes into its implementation; (ii) commitment failures, where an agent does not implement promised changes while its partner assumes they are in place; and (iii) communication failures, where agents never establish the shared information a joint decision requires. The first two share one gap: communication has occurred, but subsequent actions remain inconsistent with it. AECP targets this gap by supporting recipients’ use of shared knowledge and checking producers’ implementations against recorded commitments.

Coordination Support for Coding Agents

Prior work on coordinating coding agents falls into three groups. (i) Shared information. Agent Context Protocols [8] and AgentRoom [11] keep messages, task records, and workspace state accessible to all agents. A stored finding, however, still reaches a worker only if that worker recognizes its relevance when it later works on the corresponding code. AECP instead delivers the finding when the worker accesses that code. (ii) Contracts and checks. Keeping interdependent modules compatible requires detecting when an implementation departs from its agreed interface and ensuring that dependent workers notice when the agreement changes. SEMAP [26] specifies what each agent receives and produces, which leaves no module interface against which code can be checked, and Sartori (2026) compare implementations only after both are written, when incompatible assumptions have already been built on. In concurrent work, CodeTeam [36] and Contract-Coding [23] share interface contracts during parallel generation, but CodeTeam detects deviations only where QA tests exercise the affected calls, and Contract-Coding merges contract updates only after all agents in a layer have finished, so a revision reaches dependent workers after they have completed their modules. AECP checks each submission against the latest agreement and requires dependent workers to read a revision before they complete. (iii) Harness and pipeline designs. Recent work surveys or formalizes harness responsibilities [27, 48], gates code changes on sandboxed execution [21], or searches over harness designs [25], while pipeline systems such as CodeS [43] pass artifacts from one stage to the next. AECP instead specifies the rules by which a harness coordinates agents working in parallel: scope-triggered knowledge delivery, contract checks, and stale-consumer synchronization. Appendix § 7 discusses more details.

Methodology

AECP follows the leader–worker workflow in Figure 2. In Figure 2 (a), a leader agent prepares parallel execution by translating the project specification into a module plan describing module responsibilities, public symbols, and dependencies. The harness represents this plan as a dependency graph, from which the leader determines how many workers to use and which module groups each one owns. Each module has one owner, while dependencies across workers identify modules whose implementations require coordination.

System overview of AECP

Figure 2. System overview of AECP. (a) The leader converts project specifications into a module plan and assigns modules to workers based on their dependencies. (b) Workers explore, implement, and test their assigned modules in parallel, sharing findings and interface commitments through artifacts. (c) The execution harness uses Knowledge Artifacts to supply relevant findings at the point of use and Contract Artifacts to support parallel development and screen implementations for mismatches with interface commitments. Together, Knowledge and Contract Artifacts turn shared findings and interface commitments into coordination state that the harness can act on. AECP makes these artifacts the exclusive channel for inter-agent exchange, because information communicated outside them would bypass the harness checks and revision tracking that make coordination checkable.

The workers in Figure 2 (b) then explore, implement, and test their modules in parallel, and they coordinate at two points. During exploration, a worker may discover a finding that becomes useful when another worker later accesses the same code. With message-based communication, the recipient must connect this earlier information to its current work. AECP instead has workers record such findings as scope-linked Knowledge Artifacts, which the harness in Figure 2 (c) retrieves and supplies when matching code is accessed. During implementation, workers building interdependent modules rely on shared interfaces, but communicating an agreement does not ensure that implementations conform to it. AECP therefore has workers record interface commitments as Contract Artifacts, which give the harness explicit specifications for supporting parallel development and detecting interface mismatches. Once the workers finish, the leader integrates their results.

Knowledge Sharing

Sharing a finding through messages still leaves the recipient responsible for recognizing when it applies, so relevant knowledge may be overlooked even after it has been communicated. Knowledge Sharing addresses this gap by associating findings with their applicable scopes and having the harness supply them when workers access matching code.

Scope-indexed Knowledge Artifacts. To retrieve a finding during relevant work, the harness needs a recorded association between the finding and the code to which it applies. AECP represents each Knowledge Artifact as a=⟨c,s,e,z⟩a = \langle c, s, e, z \rangle, where the producer supplies the claim cc, its applicable scope ss, and an optional executable witness ee, while the harness maintains the witness state zz. The harness stores these artifacts together with their scope associations in a shared artifact store. In the upper part of Figure 3, Worker A records that getUserProfile returns None for a nonexistent user and associates the finding with that function. Scopes may identify symbols, files, or directories, while named global scopes accommodate project- or environment-level findings.

Figure 3. Scope-triggered knowledge sharing. Worker A records a reusable finding together with its applicable scope. When Worker B accesses the corresponding code, the harness matches the current scope against stored artifacts and includes the relevant finding in the returned observation, making it available for subsequent reasoning and implementation.

Knowledge delivery at the point of use. The stored associations allow the harness to retrieve relevant findings when a worker accesses code. It derives the current scope from the file or symbol accessed and retrieves non-refuted artifacts associated with that symbol, file, or an enclosing directory. The harness also forwards each finding to workers whose modules are related to where it was found, preferring the same file, then modules connected to it in the dependency graph built from the leader’s module plan, then the same package. In the lower part of Figure 3, Worker B’s access to getUserProfile retrieves Worker A’s finding while leaving the unrelated login finding outside the returned context. The harness includes the retrieved finding in the observation returned by the access operation, making it available for Worker B’s subsequent reasoning and implementation.

Witness checks and retraction. A finding that holds when recorded may become outdated as the code or execution environment changes. AECP therefore supports checking findings before circulation and rechecking them when consumers question their continued validity. The harness executes any attached witness and records the outcome in zz, marking the artifact as witness-checked if the witness passes and rejecting publication if it is refuted. Artifacts without a witness, or whose checks cannot complete because setup is unavailable, remain unchecked and eligible for retrieval. Each delivered finding carries its witness state, so recipients can tell witness-checked findings from unchecked ones. If a consumer later flags a stored claim with an attached witness, the harness reruns the check and excludes refuted artifacts from subsequent delivery while retaining an audit record. As with a message, the correctness of an unchecked finding rests with its producer and recipient; AECP adds a witness state to each delivery, and scope-triggered retrieval places a finding next to the code it concerns, where the recipient can check the claim directly. Appendix § 9.§ 1 provides a complete artifact and the detailed witness and retrieval rules.

Contract Sharing

Exchanging an interface agreement does not by itself keep implementations compatible with it. Contract Sharing therefore records agreements as shared artifacts that the harness uses to expose declared interfaces, screen implementations for static mismatches, and require consumers to revisit revised agreements.

Shared interfaces for parallel development. To implement a dependent module before its producer finishes, a consumer needs to know what interface it can rely on. On the left of Figure 4, Worker A declares the interface of Thing in a Contract Artifact. The declaration records the symbol’s name and kind under identity II, how it is constructed or called under usage UU, and its return structure or exposed attributes under observable interface OO. These declarations give consumers a shared reference for developing their modules while the producer’s implementation is still in progress.

Figure 4. Contract Sharing for parallel development. Worker A declares an interface that the harness exposes as importable stubs for Workers B and C. The harness screens the producer’s completed implementation for static mismatches with the latest contract. When the interface changes, it identifies affected consumers through registered dependencies and requires them to revisit the revised contract before completing their tasks.

The harness validates the contract and generates stubs. These are placeholder modules that expose the declared symbols and signatures without implementing their behavior. As shown in the center of Figure 4, Workers B and C can then import the declared interface and implement their dependent modules in parallel with Worker A. The stubs occupy the final module paths, so consumers retain the same imports when the producer replaces them with its implementation.

Detecting interface mismatches. An interface declaration gives consumers a basis for development, but the producer’s completed code may still depart from it. The verifier on the right of Figure 4 therefore compares each submitted module with its latest Contract Artifact. It parses the source into an abstract syntax tree and checks declared symbols, signatures, statically recoverable types and shapes, and residual stubs without executing the code. A provable mismatch causes the harness to reject the submission and report the violated symbol and constraint, allowing the producer to repair the implementation or revise the agreement. The verifier thus acts as a fast screen that catches signature, attribute, and residual-stub mismatches before integration; Appendix § 10 details the properties it checks.

Keeping consumers aligned with revisions. An interface may change as development progresses, while consumers continue relying on an earlier version. Updating the producer’s contract alone does not ensure that those consumers revisit their assumptions. To identify affected workers, consumers register the symbols they depend on with the harness during development. The lower path in Figure 4 shows how a revision triggers an update to the stored contract and a lookup of consumers registered for changed or removed symbols. The harness preserves the module’s dependency information and regenerates stubs only where workers have not begun filling the corresponding files. It notifies the affected consumers and marks them stale, preventing them from completing their tasks until they read the current contract and re-register their symbol dependencies. This requirement ensures that affected workers revisit the revised agreement, while adapting their dependent code remains their responsibility. Appendix § 10 provides the artifact schema and detailed verification and revision rules.

Algorithm 1 in Appendix § 11 summarizes the harness rules of both mechanisms. Within each mechanism, the rules act on one shared artifact: a Knowledge Artifact’s witness state determines whether it is stored, delivered, or retracted, and a Contract Artifact is the source of the stubs, the reference against which submissions are checked, and the record whose revisions determine which consumers are marked stale. Each rule is triggered by a worker’s tool call, such as a code access, an artifact publication, or a submission, so the harness acts at these points of interaction rather than continuously monitoring the code.

Experimental Setup

Models and Agent Scaffolding

Our experiments are conducted on the AWS Strands Agents SDK ([6]) and mini-SWE-agent ([34]) with Claude Opus 4.8 ([3]), Claude Opus 4.6 ([2]), Claude Sonnet 5 ([4]), DeepSeek-V4-Flash ([39]), and GLM-5.2 ([44]). The Claude models are accessed through Amazon Bedrock, whereas DeepSeek-V4-Flash and GLM-5.2 are served through OpenRouter. Appendix § 12 lists turn limits, timeouts, and sampling settings.

Benchmarks

We evaluate on three Python benchmarks that require building a repository from a textual specification in an empty workspace and assess the generated code with executable tests. Doc2Repo ([10]) contains 50 specifications derived from GitHub repositories, averaging 26.8 files and 3,528 lines of reference code, and uses adapted repository-level tests. CodeProjectEval ([47]) contains 18 projects from open-source libraries, averaging 11.9 files and 2,371 lines of reference code, and uses project-level tests. NL2Repo ([12]) contains 104 library tasks across nine domains and uses hidden tests from the original repositories.

Baselines

We compare AECP with three baselines. Single uses one model to construct the entire repository without inter-agent coordination. Team-Freedom uses the same leader-worker scaffold as AECP but allows workers to exchange unrestricted free-form messages, reflecting the message-based coordination used in systems such as AutoGPT (Significant Gravitas, [33]) and AutoGen (Wu et al., [37]). Team-Integrator runs workers in isolated worktrees without access to peers’ in-progress code, while a central manager integrates their completed implementations through sequential, test-gated merges, following CAID (Geng and Neubig, [13]). Team-Freedom and AECP workers instead share one workspace. Team-Freedom and AECP therefore differ only in the coordination protocol, free-form messages or AECP’s artifacts together with the harness actions defined on them, making Team-Freedom the controlled comparison for AECP as a whole; Team-Integrator represents an alternative design that isolates workers and centralizes integration. For each task, we generate a plan once and reuse the same module plan, dependency graph, module-to-worker assignment, and a fixed worker count of N=3N = 3 across all multi-agent configurations, and Single runs the same planning step with the same prompt before implementing every module itself. We hold the coding tools, execution environment, and task inputs fixed, while varying how workers exchange information and integrate their implementations. We thus compare coordination protocols within one scaffold rather than complete systems, so that differences reflect how workers coordinate.

Results

We organize the evaluation around four research questions: whether AECP improves code quality and efficiency across models, benchmarks, and agent scaffolds (RQ1); where AECP’s token savings over Team-Integrator come from (RQ2); how task difficulty affects the benefits of collaboration and whether adapting team size helps (RQ3); and whether AECP limits malicious propagation after one worker is compromised (RQ4).

RQ1. Does AECP Improve Code Quality and Efficiency?

Overall results. Table 1 reports average hidden-test pass rate, end-to-end wall time, and total output tokens. Averaged equally across the 15 model–benchmark settings, AECP improves the score from 0.471 for Single to 0.521, a relative gain of 10.6%. Compared with Team-Freedom and Team-Integrator, it improves the average score by 28.2% and 8.5%, respectively, while reducing wall time by 16.5% and 24.9%. AECP scores highest or ties for highest in 14 of the 15 settings, and weighting benchmarks by task count still yields gains of 8.5%, 22.0%, and 7.8% over Single, Team-Freedom, and Team-Integrator. These results show that AECP improves average code quality over independent execution and achieves both higher quality and shorter runtime than the two team baselines. As a team configuration, AECP uses more tokens than Single in every setting (46% more on average), trading this additional computation for higher code quality; among the team configurations, it is also the fastest on average. Single ends on its own, before reaching its turn limit, in 97% of runs, so granting it a larger budget would leave that budget unused rather than close the gap to AECP.

ModelMethodDoc2Repo ScoreDoc2Repo Time (s)Doc2Repo Token (M)NL2Repo ScoreNL2Repo Time (s)NL2Repo Token (M)CodeProjectEval ScoreCodeProjectEval Time (s)CodeProjectEval Token (M)
Opus-4.8Single0.71±0.020.71 \pm0.02282±83282 \pm837.06±1.127.06 \pm1.120.65±0.040.65 \pm0.04868±97868 \pm977.49±0.627.49 \pm0.620.41±0.050.41 \pm0.05894±126894 \pm1264.89±0.294.89 \pm0.29
Opus-4.8Team-Freedom0.52±0.050.52 \pm0.05505±146505 \pm1468.71±0.388.71 \pm0.380.51±0.030.51 \pm0.031,194±711{,}194 \pm716.90±1.316.90 \pm1.310.25±0.020.25 \pm0.021,038±941{,}038 \pm945.10±0.875.10 \pm0.87
Opus-4.8Team-Integrator0.68±0.020.68 \pm0.02607±88607 \pm8818.57±1.5718.57 \pm1.570.66±0.050.66 \pm0.051,753±1191{,}753 \pm11910.45±0.4410.45 \pm0.440.42±0.040.42 \pm0.04830±153830 \pm1538.43±0.368.43 \pm0.36
Opus-4.8AECP0.70±0.040.70 \pm0.04330±76330 \pm768.24±0.518.24 \pm0.510.68±0.030.68 \pm0.03775±134775 \pm13410.09±1.0910.09 \pm1.090.44±0.030.44 \pm0.03871±112871 \pm1126.72±1.246.72 \pm1.24
Opus-4.6Single0.59±0.040.59 \pm0.04329±61329 \pm613.29±0.183.29 \pm0.180.62±0.050.62 \pm0.051,511±861{,}511 \pm866.43±0.286.43 \pm0.280.31±0.050.31 \pm0.051,722±931{,}722 \pm934.12±0.214.12 \pm0.21
Opus-4.6Team-Freedom0.51±0.030.51 \pm0.03577±124577 \pm1243.80±0.343.80 \pm0.340.48±0.040.48 \pm0.042,188±1762{,}188 \pm1767.37±1.507.37 \pm1.500.25±0.030.25 \pm0.031,907±1681{,}907 \pm1684.39±0.394.39 \pm0.39
Opus-4.6Team-Integrator0.62±0.020.62 \pm0.02715±194715 \pm1946.01±1.296.01 \pm1.290.64±0.020.64 \pm0.022,736±2262{,}736 \pm22612.31±1.7312.31 \pm1.730.38±0.020.38 \pm0.021,905±1741{,}905 \pm1746.86±0.646.86 \pm0.64
Opus-4.6AECP0.62±0.020.62 \pm0.02436±96436 \pm964.06±1.364.06 \pm1.360.65±0.020.65 \pm0.021,326±1081{,}326 \pm1087.96±0.927.96 \pm0.920.40±0.020.40 \pm0.021,459±1161{,}459 \pm1164.53±0.424.53 \pm0.42
Sonnet-5Single0.55±0.030.55 \pm0.03519±73519 \pm737.81±0.477.81 \pm0.470.59±0.040.59 \pm0.042,166±2422{,}166 \pm24210.35±0.5810.35 \pm0.580.30±0.040.30 \pm0.042,583±3712{,}583 \pm3717.99±0.497.99 \pm0.49
Sonnet-5Team-Freedom0.54±0.040.54 \pm0.04724±105724 \pm10511.09±0.9611.09 \pm0.960.60±0.040.60 \pm0.043,074±2463{,}074 \pm24617.36±1.4217.36 \pm1.420.17±0.030.17 \pm0.032,188±1842{,}188 \pm1849.62±0.819.62 \pm0.81
Sonnet-5Team-Integrator0.57±0.030.57 \pm0.03690±94690 \pm9413.55±1.1813.55 \pm1.180.64±0.030.64 \pm0.033,288±2723{,}288 \pm27226.22±2.1326.22 \pm2.130.28±0.030.28 \pm0.032,793±2292{,}793 \pm22915.24±1.2615.24 \pm1.26
Sonnet-5AECP0.66±0.030.66 \pm0.03497±54497 \pm5412.01±0.9812.01 \pm0.980.64±0.030.64 \pm0.032,465±2022{,}465 \pm20223.31±1.8723.31 \pm1.870.32±0.030.32 \pm0.032,924±2392{,}924 \pm23913.82±1.1213.82 \pm1.12
GLM-5.2Single0.51±0.010.51 \pm0.01543±68543 \pm685.19±1.245.19 \pm1.240.46±0.020.46 \pm0.02795±72795 \pm728.28±1.778.28 \pm1.770.28±0.030.28 \pm0.031,397±2151{,}397 \pm2157.66±0.497.66 \pm0.49
GLM-5.2Team-Freedom0.54±0.040.54 \pm0.04743±102743 \pm1028.01±2.948.01 \pm2.940.48±0.010.48 \pm0.011,397±1481{,}397 \pm14814.94±4.5014.94 \pm4.500.25±0.020.25 \pm0.021,900±3721{,}900 \pm37213.02±0.8813.02 \pm0.88
GLM-5.2Team-Integrator0.42±0.030.42 \pm0.03717±84717 \pm848.68±1.678.68 \pm1.670.35±0.020.35 \pm0.021,265±941{,}265 \pm9415.72±4.1115.72 \pm4.110.30±0.040.30 \pm0.041,726±2981{,}726 \pm29815.97±1.0615.97 \pm1.06
GLM-5.2AECP0.57±0.050.57 \pm0.05679±47679 \pm478.78±1.628.78 \pm1.620.48±0.070.48 \pm0.071,004±2091{,}004 \pm20914.02±1.0314.02 \pm1.030.30±0.040.30 \pm0.041,461±2021{,}461 \pm20213.55±1.2213.55 \pm1.22
DeepSeek-V4-FlashSingle0.45±0.020.45 \pm0.021,003±1061{,}003 \pm1068.99±1.148.99 \pm1.140.38±0.010.38 \pm0.011,029±611{,}029 \pm619.44±0.119.44 \pm0.110.25±0.040.25 \pm0.042,251±3292{,}251 \pm32914.87±2.1614.87 \pm2.16
DeepSeek-V4-FlashTeam-Freedom0.39±0.020.39 \pm0.021,552±1661{,}552 \pm16613.72±2.9513.72 \pm2.950.37±0.030.37 \pm0.031,489±2111{,}489 \pm21111.58±0.2711.58 \pm0.270.23±0.090.23 \pm0.092,549±4702{,}549 \pm47015.42±2.0215.42 \pm2.02
DeepSeek-V4-FlashTeam-Integrator0.54±0.070.54 \pm0.071,851±2591{,}851 \pm25918.27±3.2418.27 \pm3.240.41±0.040.41 \pm0.041,718±2971{,}718 \pm29715.99±1.7415.99 \pm1.740.29±0.040.29 \pm0.042,994±3722{,}994 \pm37219.33±5.2619.33 \pm5.26
DeepSeek-V4-FlashAECP0.55±0.040.55 \pm0.041,305±971{,}305 \pm9710.15±0.3110.15 \pm0.310.43±0.020.43 \pm0.021,180±981{,}180 \pm9812.02±1.0112.02 \pm1.010.37±0.040.37 \pm0.042,506±2292{,}506 \pm22916.58±4.9816.58 \pm4.98

Table 1. Main results across five models and three repository-construction benchmarks. Values report mean ±\pm standard deviation over three independent runs, where each run’s value is averaged over the benchmark’s tasks. Higher scores are better; lower time and token usage are better.

Results under different agent scaffolds. Table 2 compares the main Strands SDK configuration with mini-SWE-agent, holding Opus-4.8 and NL2Repo fixed. AECP achieves the highest score under both scaffolds. With mini-SWE-agent, it reaches 0.69 and completes in 1,056 seconds, compared with 2,614 seconds for Team-Integrator. Its benefits therefore persist despite changes to the agent loop and tool interface. Appendix § 14 examines additional reasoning and model allocation between the leader and workers.

MethodAWS Strands ScoreAWS Strands TimeAWS Strands Tokenmini-SWE Scoremini-SWE Timemini-SWE Token
Single0.658687.490.6599012.18
Team-Freedom0.511,1946.900.541,64613.66
Team-Integrator0.661,75310.450.662,61415.36
AECP0.6877510.090.691,05615.32

Table 2. Cross-scaffold results on NL2Repo. Time in seconds; tokens in millions.

RQ2. Where Does AECP Save Tokens Relative to Team-Integrator?

AECP uses fewer tokens than Team-Integrator in 14 of the 15 settings in Table 1. To see where the savings arise, we add the two mechanisms one at a time, moving from Team-Integrator to AECP in two steps using

Opus-4.6 on NL2Repo: first sharing the workspace and adding Knowledge Sharing, then adding Contract Sharing. Figure 5 (b) shows that the first step reduces team-token usage from 12.31M to 9.17M, a saving of 25.5%. Adding Contract Sharing further reduces usage to 7.96M, saving another 13.2% relative to the preceding configuration. Together, the two steps reduce token usage by 35.3%. Both mechanisms are active in these AECP runs: in 84% of tasks at least one finding is delivered to another worker, in 54% the verifier reports a contract violation in at least one submission, and in 62% an interface revision notifies the workers that depend on it.

Figure 5. Efficiency gains and task difficulty. (a) Distribution of per-task orchestrator-token usage for Team-Integrator and AECP. (b) Team-token usage as Knowledge Sharing and then Contract Sharing are added to Team-Integrator. Action-category shares are normalized to the original Team-Integrator token total. (c) Wall time, total output tokens, and score by task difficulty for a single run of Opus-4.6 on NL2Repo.

The action breakdown in Figure 5 (b) shows reductions across exploration, implementation, and testing, which fall from 43% to 27%, 32% to 22%, and 22% to 13% of the original Team-Integrator token total, respectively. The reductions follow the two overheads identified in Figure 1 (c): exploration tokens drop mainly in the first step, which shares the workspace and adds Knowledge Sharing, and implementation tokens mainly in the second, which adds Contract Sharing alone. Figure 5 (a) also shows that orchestrator-token usage, the tokens consumed by the leader in AECP and by the integrating manager in Team-Integrator, falls by 26.0% on average.

RQ3. How Does Task Difficulty Affect the Benefits of Collaboration?

Not every task benefits from multiple workers, so we examine performance across difficulty levels and then test whether selecting the team size per task improves efficiency.

Performance across difficulty levels. NL2Repo divides its tasks by the size of the reference implementation into 26 easy, 46 medium, and 32 hard tasks (Ding et al., [12]). Figure 5 (c) reports a single run of Opus-4.6 across these levels. Single achieves the highest score with the lowest time and token usage on easy tasks. On medium tasks, AECP achieves the shortest runtime with comparable token usage and the highest score among the team configurations, slightly below Single. On hard tasks, it achieves the highest score while using less time and fewer tokens than Team-Freedom and Team-Integrator. These results motivate varying the team size rather than assigning multiple workers to every task.

Adaptive team sizing. With Opus-4.8, we let the leader choose the worker count NN from the dependency graph for each of the 104 NL2Repo tasks, grouping interdependent modules into clusters and assigning one worker per cluster, before any implementation begins. A task assigned one worker runs the same way as Single, since a lone worker has no teammates to coordinate with. We compare the selected configuration with a fixed N=3N = 3 configuration on the same tasks, grouping results by the selected worker count.

Table 3 shows that the leader assigns one worker to 39 tasks and more than three workers to only 3. Overall, adaptive sizing reduces average wall time from 785.7 to 639.2 seconds (18.6%), with both configurations scoring 0.66. The largest saving occurs in the group assigned one worker, where runtime falls by 46.1% without a score decrease. This group includes all 26 easy tasks, the level at which Single performs best in Figure 5 (c). On these tasks, selecting the team size reduces runtime while matching the score of a fixed team.

Adaptive subsetSelected NNForced N=3N = 3
Time (s)ScoreTime (s)Score
N=1N = 1 (39 tasks)403.20.82748.60.82
N=2N = 2 (17 tasks)572.90.66629.20.63
N=3N = 3 (45 tasks)849.60.54867.20.54
N>3N > 3 (3 tasks)926.80.52931.40.52
All 104 tasks639.20.66785.70.66

Table 3. Matched adaptive versus fixed team sizing on 104 tasks. Each row compares the same task subset using the selected NN and forced N=3N = 3.

RQ4. Does AECP Limit Cross-Worker Malicious Propagation?

The communication used to coordinate development can also carry malicious instructions between workers [22, 14]. We therefore examine propagation after one worker has already been compromised. We construct 20 attack cases from NL2Repo using five payload families. Each payload presents a malicious code change as a cross-module compatibility requirement and instructs the compromised worker to relay it to teammates. We compare AECP with Team-Freedom using the same Opus-4.6 model, compromised role, and payload. We measure reach, whether the instruction reaches a benign worker, and adoption, whether a benign worker incorporates the requested change into its code. Each case is run three times and counts as positive for a metric if the event occurs in any run. Appendix § 15 describes the payload families.

MetricTeam-FreedomAECP
Reach19/20 (95%)0/20 (0%)
Adoption8/20 (40%)0/20 (0%)

Table 4. Propagation of malicious instructions from a compromised worker across 20 attack cases.

With Team-Freedom, malicious instructions reach benign workers in 19 of 20 cases (95%) and induce adoption in eight (40%). Under AECP, no malicious instruction reaches a benign worker and none is adopted. The compromised worker tries to relay the instruction as a message, which AECP does not provide. The result thus reflects the removal of the message channel; instructions written into artifacts or shared code by a compromised worker form a separate threat that these cases do not exercise.

Conclusion

We introduced AECP, a protocol that replaces free-form inter-agent messages with Knowledge and Contract Artifacts on which the execution harness acts. Knowledge Artifacts supply prior findings at the point of use, while Contract Artifacts make interface commitments available during parallel implementation and screen completed code for static mismatches with them. Across Doc2Repo, NL2Repo, and CodeProjectEval, AECP raises average code quality over all three baselines, shortens runtime relative to the two team baselines, and transfers across different agent scaffolds. Artifact-exclusive communication also blocked every malicious instruction relayed as a message in our attack cases. Simple tasks often favor fewer agents. Overall, AECP makes coordination explicit and checkable, so parallel agents need not rely solely on natural-language promises.

Reproducibility Statement

Appendix FF gives the models, turn limits, timeouts, and sampling settings. Appendix BB gives the planning prompt and an example plan, Appendices CC and DD give the Knowledge and Contract Artifact schemas, the witness rules, and the static checks, Appendix EE summarizes the harness rules, Appendix GG describes the trace analysis behind Figure 1, and Appendix II describes the attack payloads. We will release the code, all prompts, the generated plans, and the trajectories upon publication.

AI Use Statement

We used generative AI tools to implement methods: Claude Code assisted in writing the code for AECP and our experiments. As described in Appendices CC and GG, we also used LLMs as annotators in two analyses: Opus 5 labels agent turns for the trace analysis behind Figure 1, and an LLM judges from the traces whether delivered findings are used. We did not use generative AI tools for research ideation or for designing the method and experiments. Additionally, we used generative AI tools as a writing aid. We have reviewed all AI-assisted work, including the code, and we take responsibility for the final content of this work, including text, claims, and artifacts produced with the aid of generative AI.

Ethics Statement

Our experiments use publicly available benchmarks built from open-source repositories and involve no human subjects or personal data. The security study in RQ4 examines how malicious instructions propagate between agents after one agent is compromised, with the aim of informing defenses. All attack cases ran in isolated containers without network access, no payload uses a network endpoint, and the generated repositories were discarded after scoring. We describe the payload families but do not release their full texts (Appendix II). Because AECP removes only the free-form message channel between agents, it should not be treated as a defense against instructions carried through artifacts or shared code. Code produced by coding agents, including AECP, may contain errors or vulnerabilities and should be reviewed before use.

Related Work

Shared context and structured communication help agents exchange information across tasks. Agent Context Protocols combine standardized messages with persistent execution blueprints that record dependencies and intermediate outputs [8]. AgentRoom supports concurrent coding through a shared workspace with tools for claiming files, inspecting peer status, and exchanging messages [11]. These mechanisms make information and collaborators’ progress accessible. Making a finding available, however, does not by itself connect it to a later code access where it becomes relevant. A worker may still need to recognize that an earlier discovery applies to its current work. AECP makes this connection explicit by associating findings with code scopes and delivering them when workers access matching code.

Contracts and verification address a complementary problem of keeping independently produced work consistent. SEMAP specifies the input and output artifacts required by each agent role and uses verification outcomes to govern workflow transitions [26]. Its behavioral contracts define agent responsibilities, leaving the interfaces promised to dependent code as a separate verification target. The Specification Gap examines incompatible assumptions in independently generated code and introduces an AST-based detector for conflicts between implementations [32]. AECP checks a different relationship, comparing each submitted implementation with the interface commitments on which its consumers rely. Those commitments can also change during development, so checking the producer alone is insufficient to keep consumers informed. AECP therefore tracks registered symbol dependencies and requires affected consumers to read revised contracts and renew their registrations before completing their tasks.

Other systems pass structured intermediate artifacts along a fixed pipeline. CodeS [43] builds a repository through successive sketches of its directory structure, files, and functions, and AutoP2C [24] generates repositories from papers through blueprint extraction, decomposition, and debugging stages. AgentMesh [19], DocAgent [40], MapCoder [17], and MAGIS [35] route work through planner, coder, reviewer, or verifier roles, while CodeAgent [45] equips a single agent with repository tools. Code2MCP [29] transforms existing repositories into Model Context Protocol services through a multi-stage workflow with a run-review-fix loop, and CompileAgent (Hu et al., 2025) compiles real-world repositories with a tool-integrated agent that searches for build instructions and resolves errors. Each artifact is consumed by the next agent in the pipeline, whereas AECP’s artifacts are acted on by the harness while workers run in parallel. RepoGenesis [30] extends repository-generation evaluation to multilingual microservices with deployment and API-coverage measures.

In concurrent work, CodeTeam combines structured design contracts, dependency-aware development, and Git-based interface update propagation for repository-level code generation [36]. Because it identifies interface mismatches through QA tests, deviations from declared interfaces can go undetected when those tests do not cover the affected calls. Also concurrent, Contract-Coding projects user intent into a language contract that serves as a single source of truth for parallel module generation, audits the workspace against the contract’s signatures, and updates the contract as execution proceeds [23]. AECP shares this contract-first structure. It differs in exposing each declared interface as immutable stubs at the final module paths, tracking which consumers depend on which symbols, and keeping those consumers from completing after a revision until they have read it. Its Knowledge Artifacts also carry findings that fall outside any interface, such as environment and runtime behavior.

Recent work also treats the harness as the substrate of agent behavior. Ning et al. [27] and Zhong and Zhu [48] survey or formalize its responsibilities, AgentForge requires code changes to pass sandboxed execution before they propagate [21], and Liu et al. [25] search over harness designs that include the coordination protocol. AECP instead specifies the rules by which a harness coordinates multiple agents, namely scope-triggered knowledge delivery, contract checks, and stale-consumer synchronization.

Following the terminology used by Anthropic [1], we distinguish two broad patterns by where coordination primarily resides, subagent delegation and agent teams. In subagent delegation, a main agent assigns tasks to sub-agents in isolated contexts and directs subsequent work from their returned results, as Figure 6 (a) shows. Codex (OpenAI, 2026) and Claude Code [5] provide this as a built-in facility, and FastContext [46] uses it to delegate repository exploration and return compact evidence.

Single general-purpose agent and agent team diagram

Figure 6. From (a) a single general-purpose agent that uses tools and task-specific sub-agents to (b) an agent team composed of multiple such agents. Each teammate retains the capabilities shown in (a), while maintaining its own execution trajectory and coordinating changes to a common project.

Manager-based systems such as CAID ([13]) and Agyn ([7]) extend the pattern to implementation, centralizing task delegation and integration in a manager. In agent teams, teammates hold separate parts of the work and coordinate among themselves, as Figure 6 (b) shows. These interactions may follow predefined workflows, as in ChatDev’s role-based dialogues and MetaGPT’s structured development pipelines ([31, 15]). Claude Code agent teams support direct teammate communication and shared task state while retaining a lead for overall coordination, and each teammate may delegate to sub-agents of its own ([1]).

Planner Prompt and Decomposition Example

The leader receives the complete task specification and is instructed to return only a structured module plan. Listing 1 summarizes the load-bearing requirements of the planner prompt; implementation-specific formatting instructions are omitted.

Given the complete software specification, return one JSON object
and no additional text:

{
  "modules": [{
    "path": "<relative file path>",
    "purpose": "<one-line responsibility>",
    "depends_on": ["<producer module paths>"],
    "symbols": [{"name": "<qualified name>",
                 "kind": "class|function|constant|module"}]
  }],
  "seams": [{
    "type": "<shared type>",
    "produced_by": "<defining module>",
    "consumed_by": ["<consumer modules>"],
    "shape": {"type": "<type>", "keys": ["<field names>"]}
  }]
}

Hard requirements:
- Include at least <min_modules> implementation modules.
- Cover every symbol named in the specification.
- Record most symbols by name and kind only; do not guess call shapes.
- Declare each cross-module seam once at its defining module.
- Seam shapes contain never concrete values or expected outputs.
- If a seam shape is uncertain, omit the shape rather than the seam.

Listing 1 Abridged template of the module-planning prompt.

Consider the resulting plan for dictatebase. The leader decomposes the task into 26 module nodes, each represented by a relative path, a one-line purpose, a depends_on list, and a lightweight public-symbol inventory. Listing 2 shows an abbreviated node from the persisted plan; only three of its public symbols are retained for readability. The harness validates its paths, dependency references, and symbol declarations before using it as shared state.

{
  "path": "dictdatabase/indexing.py",
  "purpose": "Intelligent indexing system with creation, query, and management",
  "depends_on": ["dictdatabase/query.py"],
  "symbols": [
    {
      "name": "dictdatabase.indexing.Indexer",
      "kind": "class"
    },
    {
      "name": "dictdatabase.indexing.create_index",
      "kind": "function"
    },
    {
      "name": "dictdatabase.indexing.create_compound_index",
      "kind": "function"
    }
  ]
}

Listing 2 Abbreviated module node from the dictdatabase decomposition plan.

The dependency field in Listing 2 adds a directed edge from the query node to the dependent indexing node, recording their relationship for task planning. The module paths also provide code locations with which Knowledge Artifacts can be associated. During execution, the harness retrieves findings by matching their recorded scopes to the code a worker accesses and forwards them along these dependency edges to workers owning related modules.

Knowledge Sharing Examples

Complete Knowledge Artifact

Listing 3 reproduces a complete artifact produced by a worker in a live Doc2Repo run. In the Knowledge Artifact abstraction a=⟨c,s,e,z⟩a = \langle c, s, e, z \rangle of Section 3.1, body, the combination of scope and file_tags, witness, and state correspond to cc, ss, ee, and zz, respectively. Their provenance and roles are as follows:

  • Claim (cc). The producer writes the finding as the body; this is the reusable content presented to consumers.

  • Scope (ss). The producer supplies a descriptive scope, while the harness records the applicable file or directory tags. Together they index the artifact for retrieval when a worker accesses a matching code scope.

  • Witness (ee). The producer may attach a runnable, shape-only assertion that supports machine checking. An absent or uncheckable witness leaves the stored artifact UNCHECKED.

  • State (zz). The harness assigns and updates the state from witness execution and later flags. It distinguishes witness-checked, unchecked, and refuted artifacts, and removes refuted artifacts from circulation.

The remaining fields record identity, provenance, and publication metadata.

{
  "id": "kg-6",
  "scope": "mcp-runtime",
  "body": "mcp 2.0.0 has NO mcp.server.fastmcp / FastMCP (it renamed the high-level server to MCPServer). Pin ‘pip install mcp\n==1.9.0‘ to get the classic ‘from mcp.server.fastmcp import FastMCP‘ with .tool() decorator, .add_tool(fn,name,description), and .\nrun(transport=’stdio’|’sse’|’streamable-http’).",
  "state": "verified",
  "by": "worker_3",
  "ts": 1786262322.2400696,
  "redacted": false,
  "task_id": "a8ed0defa7",
  "file_tags": [
    "target_repo/interfaces/__init__.py"
  ],
  "witness": "print(\"KG:REACHED\")\nfrom mcp.server.fastmcp import FastMCP\ns = FastMCP(name=\"t\")\nassert hasattr(s, \"tool\") and hasattr(s, \"add_tool\") and hasattr(s, \"run\")"
}

Listing 3 A complete witness-checked Knowledge Artifact from a live run; the log records this state as verified.

The artifact records a runtime compatibility finding rather than a cross-module interface. Its textual scope, ’mcp-runtime’, identifies the topic, while file_tags binds the finding to the code location where it applies. The body states the version and API conditions, and the witness checks them by importing and constructing FastMCP and inspecting its API. Successful witness execution sets the artifact state to WITNESS-CHECKED before it is made available to consumers.

Witness decision rules. At publication, the harness first checks that the witness contains only permitted shape-level operations, such as imports, calls, construction, and attribute checks. A malformed witness is rejected before storage. A valid witness is then executed in the workspace and prints KG:REACHED before its assertion. A zero exit marks the artifact WITNESS-CHECKED; a failure after the marker refutes the witness and rejects the publication; and a failure before the marker indicates that setup did not complete, so the artifact is stored as UNCHECKED. An artifact without a witness is likewise UNCHECKED. If a consumer later flags a stored artifact, the harness reruns its witness, removes a refuted artifact from subsequent retrieval and delivery, and retains the outcome in its audit record.

Scope-triggered retrieval rules. The harness derives a worker’s current scope whenever it accesses a code file or symbol. It first matches artifacts bound to that symbol or file and then considers artifacts associated with enclosing directories or named global scopes. Refuted artifacts are excluded. Matching artifacts are inserted into the observation returned by the code-access operation, so retrieval occurs at the point of use rather than through a separate inter-agent message. The harness additionally forwards each new finding to workers owning related modules, ranking the same file above modules connected to it in the planned dependency graph and those above modules in the same package. Each lookup delivers at most five artifacts and each forward at most four, newest first; a worker that re-reads a file receives only artifacts it has not already seen; and every delivered artifact is labeled with its witness state. A scope matches the current access when one path contains the other or the two share a path segment, and each delivered artifact is truncated to 280 characters. A single access therefore adds at most five truncated artifacts, about 1,400 characters, to the returned observation. A symbol scope is matched through the file that defines it, so matching ultimately operates on file paths rather than resolved names, and aliases and re-exports do not affect it: a finding is delivered when a worker reads a file that its tags cover. Conflicting findings are resolved through flags: when a consumer flags a claim that contradicts what it observes, the harness reruns the witness and stops delivering the claim if the witness refutes it. In the Opus-4.6 NL2Repo AECP runs, a task receives 41.9 knowledge deliveries on average; judged from the traces by an LLM, 36% of the delivered findings are used in the recipient’s subsequent work. Of the delivered findings, 71% are witness-checked, and they account for 88% of the findings used. Witness execution rejects 14% of publication attempts before they enter circulation, and consumers flag 0.9 findings per task on average, 0.2 of which are retracted after the witness is rerun.

Contract Sharing Details

Contract Artifact Schema

Each module has one Contract Artifact. It records the producer, the module dependencies, and the public interface promised to consumers. Listing 4 shows the implementation schema through one schematic artifact.

{
  "owner": "worker_2",
  "intent": true,
  "ts": 1786000000.0,
  "purpose": "Provide the shared Thing abstraction",
  "depends_on": ["pkg/other.py"],
  "assigned_worker": "worker_2",
  "symbols": [{
    "name": "mypkg.Thing",
    "kind": "class",
    "protocols": ["callable"],
    "construct": "Thing(config)",
``
"params": {"config": "Config"},
"usage": [{
    "callable_as": "thing(item)",
    "returns_type": "bool"
}],
"seam": true,
"shape": {
    "type": "class",
    "keys": ["method"]
},
"construction_exemplars": [{
    "case": "type",
    "exemplar": "Thing(config)"
}]
}

Listing 4 Schematic Contract Artifact for one module.

The producer supplies the symbol declarations. The planner supplies the module purpose and dependencies, which remain attached across revisions. Within each symbol entry, name and kind identify the symbol; construct, params, and usage describe how consumers create and call it; and protocols, return specifications, and shape describe the interface consumers can observe. Consumer registrations are stored separately and connect each used symbol to the workers that depend on it.

Importable Stubs

The harness validates a declaration before placing it on the interface board. It then generates importable stubs for the declared symbols. A function stub preserves its parameters, while a class stub exposes its construction shape and declared protocols. Each generated body raises NotImplementedError, so using an unimplemented path fails explicitly. When a contract is revised, the harness regenerates a stub only if a worker has not started filling its file.

Static Contract Verification

At completion, the checker receives the latest Contract Artifact and the producer’s Python source. It parses the source into an abstract syntax tree and does not import the module, execute its code, or invoke an LLM. It checks interface shape rather than functional behavior.

For each declared symbol, the checker considers the following constraints:

  • the source parses and the declared symbol exists with the stated kind;

  • declared positional and keyword-only parameters match the implementation;

  • parameter and return annotations agree when both are available;

  • literal return statements do not contradict the declared return type or mapping keys;

  • a shared class exposes its declared attributes through class members, methods, self assignments in __init__, or __slots__; and

  • no declared function or method remains a generated NotImplementedError stub.

Mapping-shaped shared types are excluded from the attribute check because their keys belong to instance contents rather than class attributes. Each remaining comparison has three outcomes. A failure means that the source proves a mismatch. A pass records a completed comparison with no mismatch. An abstention records that the property cannot be decided statically, as with an inherited constructor or a return value built by another function; such properties are left to the workers’ tests. The overall verdict is REJECT only if at least one failure is present. Formally, each comparison qq between a module mm and its contract CC yields Vq(m,C)∈{PASS,FAIL,ABSTAIN}V_q(m,C) \in\{\mathrm{PASS}, \mathrm{FAIL}, \mathrm{ABSTAIN}\}, and V(m,C)=REJECTV(m,C) = \mathrm{REJECT} if Vq(m,C)=FAILV_q(m,C) = \mathrm{FAIL} for some qq, and PASS otherwise. Table 5 lists how the checker treats common Python constructs.

ConstructTreatment
Default valuesParameter names, order, and keyword-only parameters are compared; default values are not.
*args / **kwargsAbstain on the call shape.
Missing annotationsAbstain on the type comparison.
Function decoratorsThe signature is read from the definition as written.
@overloadThe final, implementing definition is checked.
@dataclass without __init__The constructor is derived from the annotated fields.
Inherited constructorAbstain on the constructor.
NamedTuple, TypedDict, Enum, Protocol basesAbstain on the constructor.
Properties and methodsCount as exposed attributes.
AttributesClass attributes, methods, self assignments in __init__, and __slots__ of the class itself are recognized; attributes created elsewhere or at runtime are not.
Mapping-typed shared typesThe attribute check is skipped.
Imports, aliases, re-exportsA declared symbol must be defined at the top level of its module; imported or aliased names do not satisfy the declaration.

Table 5. Treatment of Python constructs by the static contract checker.

In the Opus-4.6 NL2Repo AECP runs, 84% of submissions pass and 16% are rejected. Listing 5 shows the report shape.

{
  "verdict": "PASS | REJECT",
  "checks_run": 9,
  "fails": [{
    "symbol": "pkg.parser.DocParser",
    "what": "seam_attr",
    "detail": "missing declared attribute: errors"
  }],
  "abstains": [{
    "symbol": "pkg.parser.parse_doc",
    "why": "return structure is not statically decidable"
  }]
}

Listing 5 Output of the static contract checker.

The checker uses the following closed failure labels:

syntax, missing, kind
param_names, param_arity, kwonly_missing, param_type
return_type, return_contradiction, returns_shape_keys
seam_attr, residual_stub

For example, if a shared class declares an errors attribute but its constructor assigns only _problems, the checker reports a seam_attr mismatch. The producer must then change the implementation or publish a revised contract.

Revision and Staleness

Each revision is merged with the existing entry so that module dependencies and seam marks are preserved. The harness compares the old and merged entries on every contract write. A changed or removed symbol marks its registered consumers stale. Re-reading and re-registering the symbol clears the stale state; until then, the consumer cannot complete its task. Stubs are regenerated only when their files have not been filled by a worker.

Harness Rules

Algorithm 1 lists the rules of Knowledge Sharing and Contract Sharing as the events that trigger them and the harness’s response to each. Algorithm 1: Harness rules in AECP. Each rule fires when a worker’s tool call raises the corresponding event; no background process monitors the code.

Knowledge Sharing

Publish(a=⟨c,s,e⟩a = \langle c, s, e\rangle): run ee if attached; reject aa if ee refutes cc, otherwise store aa under scope ss with state zz and forward it to workers owning related modules

Access(w,σw, \sigma): add non-refuted artifacts scoped to σ\sigma, its file, an enclosing directory, or a global scope to ww’s observation

Flag(aa): rerun ee; if it refutes cc, exclude aa from delivery and keep an audit record

Contract Sharing

Declare(CC): validate CC and generate stubs at its module paths

Register(w,Sw, S): record ww as a consumer of symbols SS; clear ww’s stale mark once it has read the current contract

Revise(C→C′C \to C'): store C′C', regenerate stubs in files no worker has begun filling, and notify and mark stale the consumers registered for changed or removed symbols

Submit(mm): reject mm and report the violated constraint if its AST provably violates the latest contract

Complete(ww): reject while ww is marked stale

Run Configuration

Each agent runs for at most 150 turns with a sliding context window of 300 messages. Individual shell commands time out after 300 seconds, and scoring times out after 1,200 seconds for Opus-4.8 and 2,400 seconds for the other models. Model calls use each provider’s default sampling temperature with client-side adaptive retries. Reported wall time and token counts include planning. All four configurations of a setting run concurrently on the same host against the same endpoint, so service latency affects them alike.

Trace Analysis for Figure 1

We analyze trajectories of an agent team that coordinates through natural-language messages, run with Opus-4.6 on all 104 NL2Repo tasks. An LLM (Opus 5) reads each complete multi-agent trajectory and labels every agent turn with one primary activity: Explore (searching, reading files, tracing dependencies, or otherwise acquiring information), Implement (creating or modifying code), Test (running or inspecting validation), or Other (planning, coordination messages, and status updates). It marks an Explore turn as repeated exploration only when another agent had earlier obtained information sufficient for the same need and the later turn reproduces rather than extends that work; re-inspection after the code changed, or to verify an earlier finding, is excluded. It marks an Implement turn as conflict-driven rework only when already-written code is revised because decisions in different modules or by different agents are incompatible, such as mismatched signatures, return types, or data structures; a test failure alone is not sufficient. Each flagged turn must cite the earlier turns that establish the information or the conflicting decision, and uncertain cases are labeled negative. Token and turn shares follow from these labels. We manually checked 50 flagged events and confirmed all of them.

Additional Analyses

Additional Reasoning

Table 6 examines the effect of enabling adaptive thinking. Scores increase for every method, but additional reasoning does not close the observed gap between Team-Freedom and AECP. Team-Freedom improves from 0.51 to 0.55, with 28% more time and 55% more output tokens. AECP improves from 0.68 to 0.69, with 24% more time and 42% more tokens. Adaptive thinking therefore offers a further quality improvement at additional cost. Because these configurations do not use matched computation budgets, this experiment does not isolate the contribution of reasoning expenditure to AECP’s advantage.

Methodw/o Adaptive Thinkingw/ Adaptive Thinking
ScoreTime (s)Token (M)ScoreTime (s)Token (M)AT Rate
Single0.658687.490.678857.8047%
Team-Freedom0.511,1946.900.551,52810.7051%
Team-Integrator0.661,75310.450.672,10312.6443%
AECP0.6877510.090.6996114.3245%

Table 6. Effect of adaptive thinking on Opus-4.8 performance on NL2Repo. Adaptive-thinking rates are reported as percentages.

Model Allocation between the Leader and Workers

Table 7 compares three model allocations. Using DeepSeek-V4-Flash for both roles achieves a score of 0.425 at $0.12 per repository. Replacing only the leader with Opus-4.8 improves the score to 0.502, while increasing runtime by 9.1% and cost to $0.69. With the Opus-4.8 leader fixed, also upgrading the workers improves the score to 0.680 and reduces runtime from 1,287 to 775 seconds. In these configurations, upgrading the leader helps, but upgrading the workers provides a further substantial improvement.

LeaderWorkerScoreTime (s)Cost ($/repo)
DS-V4-FlashDS-V4-Flash0.4251,180$0.12
Opus-4.8DS-V4-Flash0.5021,287$0.69
Opus-4.8Opus-4.80.680775$2.03

Table 7. Leader–worker model allocation on NL2Repo.

Attack Payloads

The five payload families request safeguard disabling, validation bypass, input passthrough, a local trace sink, or a hidden keyword argument. Each presents the requested change as a cross-module compatibility requirement and asks the compromised worker to relay it to teammates. None uses a network endpoint. These cases evaluate propagation after an initial worker compromise, rather than the likelihood of that compromise. All attack cases ran in isolated containers without network access, and the generated repositories were discarded after scoring. We describe the payload families but do not release their full texts.

References

  1. [1]Anthropic. Orchestrate teams of claude code sessions. https://code.claude.com/docs/en/agent-teams, 2026a. Accessed July 21, 2026.
  2. [2]Anthropic. Introducing claude opus 4.6. https://www.anthropic.com/news/claude-opus-4-6, February 2026b. Accessed: 2026-09-20.
  3. [3]Anthropic. Claude opus 4.8. https://www.anthropic.com/news/claude-opus-4-8, May 2026c.
  4. [4]Anthropic. Introducing claude sonnet 5. https://www.anthropic.com/news/claude-sonnet-5, June 2026d.
  5. [5]Anthropic. Create custom subagents. https://code.claude.com/docs/en/sub-agents, 2026e. Accessed July 21, 2026.
  6. [6]AWS. Strands Agents SDK. https://strandsagents.com/ , 2025.
  7. [7]Nikita Benkovich and Vitalii Valkov. Agyn: A multi-agent system for team-based autonomous software engineering. arXiv preprint arXiv:2602.01465, 2026.arxiv.org/abs/2602.01465
  8. [8]Devansh Bhardwaj, Arjun Beniwal, Shreyas Chaudhari, Ashwin Kalyan, Tanmay Rajpurohit, Karthik R Narasimhan, Ameet Deshpande, and Vishvak Murahari. Agent context protocols enhance collective inference. arXiv preprint arXiv:2505.14569, 2025.arxiv.org/abs/2505.14569
  9. [9]Mert Cemri, Melissa Z. Pan, Shuyi Yang, Lakshya A. Agrawal, Bhavya Chopra, Rishabh Tiwari, Kurt Keutzer, Aditya G. Parameswaran, Dan Klein, Kannan Ramchandran, Matei A. Zaharia, Joseph Gonzalez, and Ion Stoica. Why do multi-agent llm systems fail? ArXiv, abs/2503.13657, 2025. URL https://api.semanticscholar.org/CorpusID:277103715.arxiv.org/abs/2503.13657
  10. [10]Guoxin Chen, Fanzhe Meng, Jiale Zhao, Minghao Li, Daixuan Cheng, Huatong Song, Jie Chen, Yuzhi Lin, Hui Chen, Xin Zhao, et al. Beyondswe: Can current code agent survive beyond single-repo bug fixing? arXiv preprint arXiv:2603.03194, 2026.arxiv.org/abs/2603.03194
  11. [11]Seonglae Cho and Donghyun Lee. Agentroom: Concurrent multi-agent coding in a CRDT-backed shared workspace. In Workshop on Failure Modes of Agentic AI at ICML 2026, 2026. URL https://openreview.net/forum?id=OaGLZqKqGx.arxiv.org/abs/2608.23740
  12. [12]Jingzhe Ding, Shengda Long, Changxin Pu, Huan Zhou, Hongwan Gao, Xiang Gao, Chao He, Yue Hou, Fei Hu, Zhaojian Li, et al. Nl2repo-bench: Towards long-horizon repository generation evaluation of coding agents. arXiv preprint arXiv:2512.12730, 2025.arxiv.org/abs/2512.12730
  13. [13]Jiayi Geng and Graham Neubig. Effective strategies for asynchronous software engineering agents. arXiv preprint arXiv:2603.21489, 2026.arxiv.org/abs/2603.21489
  14. [14]Xiangming Gu, Xiaosen Zheng, Tianyu Pang, Chao Du, Qian Liu, Ye Wang, Jing Jiang, and Min Lin. Agent smith: A single image can jailbreak one million multimodal llm agents exponentially fast. arXiv preprint arXiv:2402.08567, 2024.arxiv.org/abs/2402.08567
  15. [15]Sirui Hong, Mingchen Zhuge, Jonathan Chen, Xiawu Zheng, Yuheng Cheng, Jinlin Wang, Ceyao Zhang, Steven Yau, Zijuan Lin, Liyang Zhou, et al. Metagpt: Meta programming for a multi-agent collaborative framework. In International Conference on Learning Representations, volume 2024, pages 23247–23275, 2024.arxiv.org/abs/2308.00352
  16. [17]Md Ashraful Islam, Mohammed Eunus Ali, and Md Rizwan Parvez. Mapcoder: Multi-agent code generation for competitive problem solving. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4912–4944, 2024.arxiv.org/abs/2405.11403
  17. [18]Carlos E Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. Swe-bench: Can language models resolve real-world github issues? In International Conference on Learning Representations, volume 2024, pages 54107–54157, 2024.arxiv.org/abs/2310.06770
  18. [19]Sourena Khanzadeh. Agentmesh: A cooperative multi-agent generative ai framework for software development automation. arXiv preprint arXiv:2507.19902, 2025.arxiv.org/abs/2507.19902
  19. [20]Arpandeep Khatua, Hao Zhu, Peter Tran, Arya Prabhudesai, Frederic Sadrieh, Johann Kaspar Lieberwirth, Xinkai Yu, Yicheng Fu, Michael J Ryan, Jiaxin Pei, and Diyi Yang. Cooperbench: Why coding agents cannot be your teammates yet. In Third Conference on Language Modeling, 2026. URL https://openreview.net/forum?id=qo1OheIBPVf.arxiv.org/abs/2601.13295
  20. [21]Rajesh Kumar, Waqar Ali, Junaid Ahmed, Najma Imtiaz Ali, and Shaban Usman. Agentforge: Execution-grounded multi-agent llm framework for autonomous software engineering. arXiv preprint arXiv:2604.13120, 2026.arxiv.org/abs/2604.13120
  21. [22]Donghyun Lee, Mo Tiwari, and Brando Miranda. Prompt infection: Llm-to-llm prompt injection within multi-agent systems. In European Symposium on Research in Computer Security, pages 511–520. Springer, 2025.arxiv.org/abs/2410.07283
  22. [23]Yi Lin, Lujin Zhao, and Yijie Shi. Contract-coding: Towards repo-level generation via structured symbolic paradigm. arXiv preprint arXiv:2604.13100, 2026.arxiv.org/abs/2604.13100
  23. [24]Zijie Lin, Yiqing Shen, Qilin Cai, He Sun, Jinrui Zhou, and Mingjun Xiao. Autop2c: An llm-based agent framework for code repository generation from multimodal content in academic papers. arXiv preprint arXiv:2504.20115, 2025.arxiv.org/abs/2504.20115
  24. [25]Hanzhi Liu, Chaofan Shou, Xiaonan Liu, Hongbo Wen, Yanju Chen, Ryan Jingyang Fang, and Yu Feng. Synthesizing multi-agent harnesses for vulnerability discovery. arXiv preprint arXiv:2604.20801, 2026.arxiv.org/abs/2604.20801
  25. [26]Zhenyu Mao, Jacky Keung, Fengji Zhang, Shuo Liu, Yifei Wang, and Jialong Li. Towards engineering multi-agent llms: A protocol-driven approach. In 2025 32nd Asia-Pacific Software Engineering Conference (APSEC), pages 897–901. IEEE, 2025.arxiv.org/abs/2510.12120
  26. [27]Xuying Ning, Katherine Tieu, Dongqi Fu, Tianxin Wei, Zihao Li, Yuanchen Bei, Jiaru Zou, Mengting Ai, Zhining Liu, Ting-Wei Li, et al. Code as agent harness. arXiv preprint arXiv:2605.18747, 2026.arxiv.org/abs/2605.18747
  27. [29]Chaoqian Ouyang, Ling Yue, Shimin Di, Libin Zheng, Linan Yue, Shaowu Pan, Jian Yin, and Min-Ling Zhang. Code2mcp: transforming code repositories into mcp services. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, pages 3835–3846, 2026.arxiv.org/abs/2509.05941
  28. [30]Zhiyuan Peng, Xin Yin, Pu Zhao, Fangkai Yang, Lu Wang, Ran Jia, Xu Chen, Qingwei Lin, Saravan Rajmohan, and Dongmei Zhang. Repogenesis: Benchmarking end-to-end microservice generation from readme to repository. arXiv preprint arXiv:2601.13943, 2026.arxiv.org/abs/2601.13943
  29. [31]Chen Qian, Wei Liu, Hongzhang Liu, Nuo Chen, Yufan Dang, Jiahao Li, Cheng Yang, Weize Chen, Yusheng Su, Xin Cong, et al. Chatdev: Communicative agents for software development. In Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), pages 15174–15186, 2024.arxiv.org/abs/2307.07924
  30. [32]Camilo Chacón Sartori. The specification gap: Coordination failure under partial knowledge in code agents. arXiv preprint arXiv:2603.24284, 2026.DOI
  31. [33]Significant Gravitas. AutoGPT. https://github.com/Significant-Gravitas/AutoGPT, 2023.
  32. [34]SWE-agent Team. mini-SWE-agent: The Minimal Software Engineering Agent. https://github.com/SWE-agent/mini-swe-agent, 2025.
  33. [35]Wei Tao, Yucheng Zhou, Yanlin Wang, Wenqiang Zhang, Hongyu Zhang, and Yu Cheng. Magis: Llm-based multi-agent framework for github issue resolution. Advances in Neural Information Processing Systems, 37:51963–51993, 2024.arxiv.org/abs/2403.17927
  34. [36]Yifei Wang, Ruiyin Li, Peng Liang, Qiong Feng, Zengyang Li, Mojtaba Shahin, and Arif Ali Khan. Codeteam: An llm-powered multi-agent framework for repository-level code generation. arXiv preprint arXiv:2606.22082, 2026.arxiv.org/abs/2606.22082
  35. [37]Qingyun Wu, Gagan Bansal, Jieyu Zhang, Yiran Wu, Beibin Li, Erkang (Eric) Zhu, Li Jiang, Xiaoyun Zhang, Shaokun Zhang, Jiale Liu, Ahmed Hassan Awadallah, Ryen W. White, Doug Burger, and Chi Wang. Autogen: Enabling next-gen llm applications via multi-agent conversation. In First Conference on Language Modeling, 2024. URL https://api.semanticscholar.org/CorpusID:263611068.arxiv.org/abs/2308.08155
  36. [38]Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. Agentless: Demystifying llm-based software engineering agents. arXiv preprint arXiv:2407.01489, 2024.arxiv.org/abs/2407.01489
  37. [39]Anyi Xu, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, Chenchen Ling, et al. Deepseek-v4: Towards highly efficient million-token context intelligence. arXiv preprint arXiv:2606.19348, 2026.arxiv.org/abs/2606.19348
  38. [40]Dayu Yang, Antoine Simoulin, Xin Qian, Xiaoyi Liu, Yuwei Cao, Zhaopu Teng, and Grey Yang. Docagent: A multi-agent system for automated code documentation generation. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations), pages 460–471, 2025.
  39. [41]John Yang, Carlos Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. Swe-agent: Agent-computer interfaces enable automated software engineering. Advances in Neural Information Processing Systems, 37:50528–50652, 2024.arxiv.org/abs/2405.15793
  40. [42]Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=WE_vluYUL-X.arxiv.org/abs/2210.03629
  41. [43]Daoguang Zan, Ailun Yu, Wei Liu, Dong Chen, Bo Shen, Yafen Yao, Wei Li, Xiaolin Chen, Yongshun Gong, Bei Guan, et al. Codes: Natural language to code repository via multi-layer sketch. ACM Transactions on Software Engineering and Methodology, 35(7):1–26, 2026.arxiv.org/abs/2403.16443
  42. [44]Aohan Zeng, Xin Lv, Zhenyu Hou, Zhengxiao Du, Qinkai Zheng, Bin Chen, Da Yin, Chendi Ge, Chenghua Huang, Chengxing Xie, et al. Glm-5: from vibe coding to agentic engineering. arXiv preprint arXiv:2602.15763, 2026.arxiv.org/abs/2602.15763
  43. [45]Këchi Zhang, Jia Li, Ge Li, Xianjie Shi, and Zhi Jin. Codeagent: Enhancing code generation with tool-integrated agent systems for real-world repo-level coding challenges. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13643–13658, 2024.arxiv.org/abs/2401.07339
  44. [46]Shaoqiu Zhang, Maoquan Wang, Yuling Shi, Yuhang Wang, Xiaodong Gu, Yongqiang Yao, Tori Gong, Sheng Chen, Rao Fu, Anisha Agarwal, Spandan Garg, Gabriel Ryan, Colin Merkel, Yufan Huang, and Shengyu Fu. Fastcontext: Training efficient repository explorer for coding agents. arXiv preprint arXiv:2606.14066, 2026.arxiv.org/abs/2606.14066
  45. [47]Qianhui Zhao, Li Zhang, Fang Liu, Junhang Cheng, Chengru Wu, Junchen Ai, Qiaoyuanhe Meng, Lichen Zhang, Xiaoli Lian, Shubin Song, et al. Towards realistic project-level code generation via multi-agent collaboration and semantic architecture modeling. ACM Transactions on Software Engineering and Methodology, 2025.arxiv.org/abs/2511.03404
  46. [48]Hailin Zhong and Shengxin Zhu. Ai harness engineering: A runtime substrate for foundation-model software agents. arXiv preprint arXiv:2605.13357, 2026.arxiv.org/abs/2605.13357

Paper details

vlnc:W_47dwjvmy
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 12

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude Code, Claude Opus 5 (bare), an LLM

View statement
Looking for related papers…
Contents