Multi-agent LLM systems assign different responsibilities to different agents: one plans, another retrieves evidence, another verifies, another executes. This division of labor is only meaningful if each agent stays within the functions it is authorized to perform. Over many turns, however, an agent can produce a locally reasonable message that exercises authority belonging to another role: a verifier that begins planning, a retriever that asserts unsupported conclusions, an executor that changes state no one approved. We formalize this as role drift, a turn-level breach of an agent's role contract. We introduce Agent Trajectory Control (ATC), which makes each role's authority explicit as a contract and enforces it at the point where a message would enter the shared conversation. ATC scores a proposed output for out-of-role deviation, leakage into the functions of other roles, impermissible speech acts, and logical contract breaches, then computes a leakage-regularized target that constrains regeneration; the revised message is re-checked before admission. Enforcement acts on the message rather than the generator, so ATC governs agents whose internal representations are unavailable. Across homogeneous and heterogeneous teams, ATC improves task performance and role consistency while lowering role-drift energy relative to strong baselines spanning prompting, memory, workflow control, and activation editing, with the largest gains under explicit role-confusion stress tests and in larger, more diverse teams.
Figures & tables
Figure 1: Overview of ATC. At each turn, an agent output is encoded into a functional behavior vector, scored for role drift using subspace deviation, cross-role leakage, linguistic violations, and logical-contract violations, then corrected through a leakage-regularized role-preserving target before constrained regeneration. The corrected output is re-evaluated before entering the shared multi-agent conversation.
Metric
Stable
Drifted
Dout
0.18
0.57
Dleak
0.11
0.49
Dling
0.07
0.36
Dlogic
0.05
0.31
Ei,t
0.36
1.47
out–leak corr.
0.76
Table 1: Pilot role-drift analysis. Values are class-conditional means of uncorrected candidate turns from the diagnostic pilot sample. Energy is reported on the raw, unnormalized per-turn scale of Eq. (8), using α=1.00 , β=1.00 , γ=0.50 , and δ=0.75 . These descriptive pilot means do not define lower or upper bounds for the benchmark-level RDE values, which average method-specific released outputs over the corresponding evaluation set. Lower is better.
Setting
Method
EntCollabBench
MultiAgentBench
SWE-bench Verified
Primary ↑
RC ↑
RDE ↓
Primary ↑
RC ↑
RDE ↓
Primary ↑
RC ↑
RDE ↓
S1: Hom-10
Single-Agent
54.8
68.1
0.39
49.6
65.4
0.42
27.4
63.2
0.45
Prompt-Only
61.3
72.6
0.34
55.2
70.8
0.36
31.8
68.7
0.39
Struct-Role
64.7
78.9
0.28
58.4
76.1
0.31
33.9
74.5
0.33
A-MEM
66.5
77.3
0.27
60.1
75.6
0.30
35.6
73.8
0.32
CAA
65.2
79.8
0.26
59.3
78.4
0.29
34.8
76.2
0.31
Table 2: Main results across benchmarks and team settings. Primary = benchmark-specific task score. RC = Role Consistency ( ↑ ). RDE = Role-Drift Energy ( ↓ ). Values are means over three seeds.
Variant
Primary ↑
RC ↑
RDE ↓
Full ATC
76.4
93.5
0.11
w/o role subspace term
68.2
80.1
0.27
w/o leakage penalty
70.4
84.3
0.22
w/o linguistic term
72.1
87.5
0.19
w/o logical contract
71.6
86.8
0.20
w/o regeneration
69.7
82.9
0.24
Table 3: Component ablation on EntCollabBench, S3: Het-12. Each row removes one component of the full method.
Correction
Primary ↑
RC ↑
RDE ↓
No correction
59.2
67.4
0.41
Hard role reminder
62.9
72.6
0.35
Pure projection Piz
71.3
86.1
0.20
Hard orthogonality to Fi
69.8
87.0
0.18
Full ATC objective
76.4
93.5
0.11
Table 4: Correction-objective ablation on EntCollabBench, S3: Het-12. The full leakage-regularized projection is most stable.
Method
Role- confuse ↑
Authority- swap ↑
Late- correction ↑
Prompt-Only
42.5
39.8
44.1
Struct-Role
49.3
46.7
50.2
A-MEM
51.1
48.5
55.8
SEA
54.7
51.6
56.3
SOP-Role
57.9
55.2
58.6
ATC
70.8
68.4
72.1
Table 5: Role-drift stress tests on EntCollabBench, S3: Het-12. Values are task success under perturbation.
λ
Primary ↑
RC ↑
RDE ↓
0.00
71.3
86.1
0.20
0.25
74.2
90.4
0.15
0.50
76.4
93.5
0.11
1.00
75.8
92.7
0.12
2.00
73.6
90.8
0.15
Table 6: Sensitivity to leakage weight λ on EntCollabBench, S3: Het-12. Moderate leakage control performs best.
Setting
Primary ↑
RC ↑
RDE ↓
Hom-5
72.9
92.1
0.12
Hom-10
74.6
91.8
0.13
Het-10
75.8
92.7
0.12
Het-12
76.4
93.5
0.11
Het-16
75.1
91.4
0.14
Table 7: Sensitivity to team scale and heterogeneity on EntCollabBench. ATC remains stable as teams become larger and more diverse.
Method
Calls ↓
Tok. ↓
Lat. ↓
RCG/C ↑
Prompt-Only
12.4
116.0
24.3
0.00
Struct-Role
12.6
100.2
24.8
0.52
A-MEM
15.8
137.5
31.2
0.34
CAA
12.8
119.8
27.1
0.62
SEA
13.1
121.4
29.3
0.76
SOP-Role
13.6
126.2
28.5
0.86
Table 8: Cost and latency on EntCollabBench, S3: Het-12. Tok. = average generated tokens per episode in thousands. Lat. = average wall-clock latency in seconds. RCG/C = RC gain over Prompt-Only per 10K tokens.
Figure 2: Cost-normalized role-stability gain. ATC achieves the largest role-consistency improvement per 10K tokens, substantially exceeding the strongest non-ATC baseline.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Setting
Agents
Families
Role Assignment
S1: Hom-10
10
1
same backbone for all roles
S2: Het-10
10
5
role groups by model family
S3: Het-12
12
5+
S2 + auditor, specialist
Appendix
Table 9: Model and team configuration. S1 is homogeneous; S2 and S3 are heterogeneous. S3 is the hardest setting, with 12 agents and at least five model families.
Parameter
Value
Temperature
0.2
Top- p
0.95
Max output tokens / turn
512
Max turns / episode
200
Context budget
128K tokens
Retrieval budget
top- k=10
Appendix
Table 10: Shared runtime settings. These settings are fixed across all methods unless otherwise stated.
Symbol
Value
Meaning
α
1.00
out-of-role deviation weight
β
1.00
cross-role leakage weight
γ
0.50
linguistic violation weight
δ
0.75
logical violation weight
λ
0.50
leakage penalty in correction
ρ
0.95
temporal memory factor
Appendix
Table 11: ATC hyperparameters. Values are selected on validation and fixed across benchmarks.
Figure 3: Reproducibility pipeline. Each run loads a fixed benchmark split, team configuration, role contract file, and method configuration. The logger records agent outputs, behavior vectors, drift scores, corrections, latency, token usage, and final benchmark metrics.
Agent
Drifted Output
ATC Correction
Why Corrected
Verifier
“We should assign the retrieval task to the Memory-Reader, then ask the Executor to submit the final answer.”
“The proposed plan requires verification. I will check whether the retrieval step matches the task constraints and whether the Executor has sufficient evidence before finalization.”
Verifier leaked into Planner role. ATC suppresses planning behavior and restores verification behavior.
Retriever
“The contract likely requires approval from the finance lead, so the answer is yes.”
“I found the relevant policy passage but cannot infer the final decision. The Verifier should check whether the approval condition is satisfied.”
Retriever generated an unsupported conclusion instead of returning evidence.
Executor
“I will update the shared memory to mark this request as approved.”
“I can produce the final response only after the Memory-Writer updates the state and the Verifier confirms the approval condition.”
Executor attempted an unauthorized state update. ATC enforces the logical role contract.
Memory-Writer
“The user should choose option B because it is cheaper.”
“I will store the updated constraint: option B has the lowest cost among the available choices.”
Memory-Writer began making a recommendation. ATC restricts it to state maintenance.
Appendix
Table 12: Qualitative role-drift corrections. ATC rewrites outputs so that each agent remains within its assigned function before the message is released to the shared conversation.
Figure 4: Example role-drift trace. The drifted Verifier output causes a spike in role-drift energy due to cross-role leakage into the Planner subspace. ATC correction lowers the released output’s drift energy before it enters the shared conversation.
Figure 5: Component breakdown for a corrected turn. ATC reduces out-of-role deviation, cross-role leakage, linguistic violation, and logical contract violation. The largest reduction occurs in cross-role leakage, matching the qualitative observation that the Verifier was drifting into the Planner role.
Behavior encoder
Primary ↑
RC ↑
RDE ↓
Relative encoding latency ↓
BAAI/bge-large-en-v1.5
76.4
93.5
0.11
1.00 ×
BAAI/bge-base-en-v1.5
75.2
91.8
0.14
0.62 ×
BAAI/bge-small-en-v1.5
73.6
89.4
0.17
0.34 ×
Appendix
Table 13: Sensitivity to behavior-encoder scale on EntCollabBench, S3: Het-12. Relative encoding latency is normalized to bge-large-en-v1.5 .
Correction policy
Corrected turns (%)
Primary ↑
RC ↑
RDE ↓
Tokens (K) ↓
Latency (s) ↓
SOP-Role (no runtime correction)
0.0
66.8
78.2
0.29
126.2
28.5
ATC-Gated, Ei,t>0.50
24.7
71.3
85.1
0.21
128.1
29.7
ATC-Gated, Ei,t>0.35
46.8
73.9
89.2
0.16
129.9
30.8
ATC-Gated, Ei,t>0.20
72.6
75.6
92.1
0.13
131.5
31.7
ATC (correction at every turn)
100.0
76.4
93.5
0.11
132.8
32.4
Appendix
Table 14: Gated ATC cost–performance trade-off on EntCollabBench, S3: Het-12. Full ATC corrects every turn, whereas ATC-Gated regenerates only when Ei,t>τ .
Leakage weight
Primary ↑
RC ↑
RDE ↓
Harmful over-correction ↓
Content preserved ↑
λ=0.50
76.4
93.5
0.11
5.6%
94.3%
λ=2.00
73.6
90.8
0.15
18.4%
82.1%
Appendix
Table 15: Audit of legitimate role overlap on held-out EntCollabBench turns. Moderate leakage control substantially reduces harmful over-correction while preserving task-relevant content.
School of Information Science and Technology, Northeast Normal University, Changchun, Jilin · School of Computer Science and Engineering, Guangxi Normal University, Guilin, Guangxi
1National Key Laboratory for Novel Software Technology, Nanjing University, Nanjing, China · School of Intelligence Science and Technology, Nanjing University, Suzhou, China