AutoRAS: Learning Robust Agent Systems via Primitive RepresentationsAutoRAS: Learning Robust Agentic Systems with Primitive Representations
The authors propose AutoRAS, which represents multi-agent system design as primitive sequences and optimizes them with GFlowNet; on GPT-4o-mini the average performance drop under attack is 2.13% (Table 1).
The authors evaluate external robustness (injection, poisoning, manipulation) and internal robustness (specification errors, misalignment, premature termination). Attacks are injected into half of the randomly selected agents in the workflow, covering four types: Brain, Memory, Tool, and Agent-to-Agent; the victim systems are automatically designed multi-agent workflows.
- Most work on automatically designing multi-agent systems treats robustness as an afterthought, and system performance degrades under external attacks and internal faults. The authors believe the difficulty lies in structure and behavior being entangled, fault sources being unpredictable, and equivalent designs causing ambiguous learning signals.
- AutoRAS represents an agent system as a symbolic sequence composed of structural primitives and behavioral primitives, compiled via a stack-based compiler to generate workflows; after execution, a monitor extracts numerical rewards and textual safety signals, and a GFlowNet Trajectory Balance loss plus textual gradients are used to optimize the generation policy in a closed loop.
- Compared against 11 baselines on MMLU, MSMARCO, MATH, ProgramDev, AutoRAS has the highest average vanilla score of 74.27% and the smallest average drop under attack of 2.13% (GPT-4o-mini, Table 1); across four backbone models the average drop is 1.31% (Table 2), and the drop is moderate for the AgentHarm and ASB attack variants unseen during training (Table 7).
- The authors state that the robustness conclusion is limited to structural robustness within the evaluated agent threat model, not immunity to all attacks (Sec. 6.3); monitor detection cannot be fully accurate (Appendix E.2). Experiments cover 4 benchmarks, 4 backbone models, and 4 attack categories, with the smallest training set having only 6 examples (ProgramDev, Table 5).
- Evaluated models
- GPT-4o-miniDeepSeek-V3.1Claude-3.5-HaikuGemini-2.0-Flash
- Benchmarks
- MMLUMSMARCOMATHProgramDevAgentHarmAgent Security Bench (ASB)
- Metrics
- AccuracyExecutabilityperformance drop under attackCost ($)Cohen's kappa
The AutoRAS framework formulates the automatic design of robust agent systems as generating a sequence of symbolic primitives that simultaneously encode structural connections and behavioral actions, and optimizes this sequence via learning with safety signals obtained during execution and a flow-based sequence-level objective. Experiments show that AutoRAS achieves the best performance under both regular and adversarial settings, with the smallest performance degradation under attack; analysis further shows that it offers advantages in transferability, optimization stability, and cost trade-offs.
Paper analysis
What problem does this paper attempt to solve?
Addressing the problem that robustness of automatically designed multi-agent systems is handled after the fact, the authors propose AutoRAS, which incorporates robustness into the design loop.
Core problem: automatically designed multi-agent (agentic) systems treat robustness as an afterthought, causing performance and reliability degradation under external attacks and internal failures (Sec. 1).
- Scenario and importance: multi-agent systems extend LLM capabilities through collaboration, and automated design can adapt to diverse scenarios, but the authors state that in real deployment systems are susceptible to adversarial threats and execution failures.
- Shortcomings of existing methods: the authors state that existing approaches are mostly post-hoc detection of malicious behavior or repair of failed trajectories, or defend only in isolation against specific adversarial strategies; although automated design methods show some robustness, robustness is not systematically incorporated into the design loop.
- Three difficulties summarized by the authors (Fig. 1): Entanglement (structural aspects such as topology and behavioral aspects such as prompting strategy must be determined jointly), Unpredictability (failure sources are diverse and open-ended, hard to foresee in advance), Equifinality (different systems have similar performance but very different structure and behavior, making the learning signal ambiguous).
- What the paper proposes: AutoRAS formalizes system design as generating symbolic primitive sequences that jointly encode structural connections and behavioral actions, and optimizes the sequence with safety signals obtained from execution and a flow-based sequence-level objective.
- Threat model (Sec. 3.3, 5.1, Appendix A.3):
- Attacker goal: reduce the task success rate of the agent system; the authors divide robustness into external robustness (resilience to adversarial or uncertain environments such as injection, poisoning, manipulation) and internal robustness (resilience to the system's own failures such as specification errors, misalignment, premature termination).
- Knowledge and capability: attacks are injected into half of the randomly selected agents in the workflow, simulating a scenario where some agents are compromised; attack types are Brain, Memory, Tool, and Agent-to-Agent, with different datasets using different attack combinations.
- Victim systems: single-agent baselines and automatically designed multi-agent workflows, with backbone models accessed via API.
What related research exists?
Related work falls into two categories: agent system design and system robustness; the authors state that the former does not unify topology and behavior, and the latter is mostly post-hoc defense.
Agent system design
- Hand-designed multi-agent systems: Wang et al. (2023), Du et al. (2023), Wu et al. (2024), etc. rely on hand-constructed designs (e.g., prompts) and demonstrate the potential of agent collaboration.
- Automated design: Hu et al. (2025b), Zhang et al. (2025e), Zhuge et al. (2024), Zhang et al. (2025a), etc. use LLMs for role assignment, agent profiling, and workflow orchestration; the authors state that jointly reasoning about topology and behavior within a unified representation remains challenging.
- Expert-customized systems: domain-specific systems such as Li et al. (2023), Hong et al. (2024b), Hu et al. (2025a) are carefully iteratively tuned; the authors state that automated design is intended to complement rather than replace such systems.
Robustness of agent systems
- Execution-level defenses: Andriushchenko et al. (2024) detect adversarial behavior, Chen et al. (2024) sanitize actions, Wang et al. (2025) prune compromised agents, Zhang et al. (2025f), Fan & Li (2025) analyze failure trajectories; the authors state that such methods are essentially reactive and target specific failure modes.
- Robustness treated as a secondary objective: the authors state that automated design works such as Wang et al. (2024), Zhuge et al. (2024) treat robustness as a secondary objective.
Optimization and feedback methods
- GFlowNet and Trajectory Balance: Bengio et al. (2021) proposed the flow network generative model, and Malkin et al. (2022) proposed Trajectory Balance to improve credit assignment; this paper uses them for primitive sequence optimization.
- Textual feedback methods: Hao et al. (2025), Hu et al. (2024), Zhou et al. (2024), Zhang et al. (2025a), etc. use textual feedback to improve systems; this paper uses it as a textual gradient in prompt space.
Baselines and benchmarks: baselines include hand-crafted methods CoT, Self-Consistency, LLM-Debate, DyLAN, G-Safeguard, and automated workflows GPTSwarm, AgentPrune, AFlow, G-Designer, MaAS; benchmarks are MMLU, MSMARCO, MATH, ProgramDev (Sec. 5.1).
The authors position this paper as: using a unified primitive representation to cover both topology search and behavioral variation, and carrying robustness signals through both the design and execution stages, distinguishing it from work that searches only at a single level or adds defenses post hoc (Appendix G).
How does the paper address this problem?
AutoRAS turns system design into primitive sequence generation, extracts signals through compiled execution, and then performs closed-loop optimization with GFlowNet and textual gradients.
Overall idea: formalize agent system design as the generation problem of symbolic primitive sequences; the sequence is compiled by a stack-based compiler into an executable workflow, after execution a monitor extracts numerical and textual feedback, and then a flow-based objective optimizes the generation policy, forming a design–execution–feedback loop (Fig. 2).
Problem setting and primitive representation
- System definition: an agent system is defined as S = (V, E, B, G(·), K), where V is the set of agents (each agent contains Brain, Role, Memory, Tool), E is the set of communication edges, B is the set of actions acting on a subset of agents, G(·) aggregates intermediate outputs, and K is the number of interaction rounds (this paper takes K = 1) (Sec. 3.1).
- Primitive alphabet: Φ = Φstruct ∪ Φact; structural primitives include boundary markers (BEG, SEP) and composition patterns (CTRL_SEQ, CTRL_PAR_k, CTRL_FORK_k), and behavioral primitives include functional classes (AGT_DIRECT, AGT_COT, AGT_ENS, AGT_PROGRAM, AGT_REFINE) and safety classes (SAFE_Filter, SAFE_Hygiene, SAFE_ToolGuard, SAFE_Trajectory, SAFE_CrossAgent) (Appendix B.1).
- Design as search: a legal sequence X uniquely determines the system S(X) through stack-based compilation, and the design problem reduces to maximizing the reward over legal sequences X⋆ = argmax R(S(X)), where R jointly evaluates task utility, robustness, and cost (Sec. 3.2).
Primitive sequence generation (Sec. 4.1)
- Conditional generation: sequence generation is modeled with a forward policy Pθ(X | q, s), conditioned on the query q and the textual safety signal s; the generation probability of a system sums over sequences within its equivalence class [S] to handle equivalent designs.
- Policy parameterization: an encoder–decoder structure embeds the query, signal, and primitives with MiniLM and fuses them via cross-attention; candidate primitives are scored bilinearly, and the legality mask mt given by the compiler constrains the selectable actions.
- Primitive instantiation: each behavioral primitive consists of a base block (functional or safety role) and a supplementary block; the supplementary block is dynamically generated and updated by an analyzer module implemented by an LLM based on q and s; Appendix C.1 gives the full prompts.
Robustness-aware execution (Sec. 4.2)
- Stack-based compilation: the stack machine compiles the sequence into a workflow by RPN-style reduction, checks legality step by step and outputs a mask, ensuring feasible prefixes and avoiding dead-end designs.
- Execution and monitoring: the executor runs nodes in topological order and records structured trajectories; the monitor evaluates task correctness u, normalized cost c, external robustness rext = (1 − p)^j, and internal reliability rint = (1 − p)^k, where j and k are the numbers of externally flagged violations and internal failure events, and failures are detected via LLM audit (Appendix E gives the review prompts covering nine failure modes).
- Feedback: the numerical tuple v = (u, c, rext, rint) and the natural language safety signal s (e.g., diagnosis of missing guardrails) are fed back together to optimization.
Flow-based sequence exploration learning (Sec. 4.3)
- Reward shaping: R(X) = α u + ρ rext + η rint − β c, required to be strictly positive; defaults are β = 0.2, ρ = 0.1, η = 0.1 (Sec. 5.1).
- Trajectory Balance: the TB loss matches the forward flow with the reward-scaled backward flow, so that the stationary distribution satisfies Pθ(X) ∝ R(X); the authors state that equivalent designs share reward mass under R(X), thereby absorbing equifinality into the flow.
- Textual gradient: each execution is distilled into a rationale ν(X) summarizing robustness issues, used as a textual gradient in prompt space; the total signal is ∇L = ∇θ LTB + ∇t(ν(X)), without retraining the underlying LLM.
- Key parameters: maximum sequence length L = 16, number of training samples per iteration K = 4, decoding temperature fixed at 1 (Sec. 5.1).
What experiments did the paper conduct?
Compared with 11 baselines on 4 benchmarks and 4 backbone models, AutoRAS has the highest average vanilla 74.27% and the smallest average drop under attack, 2.13%.
Experimental setup
- Backbone models tested: GPT-4o-mini, DeepSeek-V3.1, Claude-3.5-Haiku, Gemini-2.0-Flash, all accessed via API with temperature 1; the main table (Table 1) uniformly uses GPT-4o-mini.
- Benchmarks and scale (Table 5): MMLU (train 40, test 153), MSMARCO (20/80), MATH (119/486, difficulty level 5), ProgramDev (6/24), train:test = 1:4.
- Attack setup (Appendix A.3): attacks are injected into half of the randomly selected agents; MMLU and MATH use Brain + Agent-to-Agent, MSMARCO adds Memory, ProgramDev adds Tool; each dataset is evaluated under multiple injection attack variants.
- Baselines: CoT, Self-Consistency, LLM-Debate, DyLAN, G-Safeguard, GPTSwarm, AgentPrune, AFlow, G-Designer, MaAS, plus the single-agent Vanilla, 11 in total.
- Metrics and review: MMLU/MSMARCO/MATH use Accuracy, ProgramDev uses Executability (two-step protocol: runnability + strict LLM review scoring); LLM review reliability is measured by micro-kappa, k = 0.86 on 50 logs (Appendix A.1).
- Number of repetitions: not reported in the paper.
Main results
According to Table 1 (GPT-4o-mini, values are vanilla / attack, with the drop after ↓):
Swipe horizontally to read the table
Method MMLU MSMARCO MATH ProgramDev Avg. Vanilla 73.20 / 68.63↓4.57 68.75 / 58.75↓10.00 46.29 / 36.64↓9.65 43.75 / 37.50↓6.25 58.00 / 50.38↓7.62 SC (CoT) 79.74 / 75.82↓3.92 75.00 / 68.75↓6.25 47.95 / 41.94↓6.01 39.58 / 33.33↓6.25 60.57 / 54.96↓5.61 DyLAN 81.17 / 74.51↓6.66 72.50 / 43.75↓28.75 48.63 / 32.09↓16.54 52.08 / 35.42↓16.66 63.60 / 46.44↓17.16 GPTSwarm 75.82 / 71.24↓4.58 81.25 / 76.25↓5.00 52.06 / 46.00↓6.06 54.17 / 47.92↓6.25 65.82 / 60.35↓5.47 AgentPrune 81.70 / 76.47↓5.23 80.25 / 72.50↓7.75 53.59 / 47.05↓6.54 58.33 / 52.08↓6.25 68.41 / 62.03↓6.38 AFlow 82.35 / 70.58↓11.77 78.75 / 61.25↓17.50 54.11 / 34.65↓19.46 70.83 / 62.50↓8.33 71.51 / 57.25↓14.26 MaAS 81.17 / 76.01↓5.16 81.25 / 53.75↓27.50 52.05 / 29.67↓22.38 60.42 / 43.75↓16.67 68.72 / 50.29↓18.43 Ours 83.01 / 82.35↓0.66 90.00 / 88.75↓1.25 57.41 / 54.94↓2.47 66.67 / 62.50↓4.17 74.27 / 72.14↓2.13 (The four rows CoT, LLM-Debate, G-Safeguard, G-Designer are omitted; among them G-Safeguard has the lowest average attack score in the whole table, 41.87.)
- The authors state that AutoRAS has the best or second-best accuracy on all four datasets, the highest average vanilla score, and lower cross-task variance than baselines such as AFlow.
- The authors state that AutoRAS has the smallest average drop under attack, and observe that attacks compromising multiple agents cause larger drops than single-agent injection.
- Exception: on ProgramDev, AutoRAS's vanilla score 66.67 is lower than AFlow's 70.83 (Table 1).
Cross-backbone transfer (Table 2)
- Setup: on MMLU, transfer the same agent system to four backbone models and compare with 6 baselines.
- Results: AutoRAS's attack drops on GPT-4o-mini, DeepSeek-V3.1, Claude-3.5-Haiku, Gemini-2.0-Flash are 0.66, 1.96, 1.30, 1.31 respectively, with average vanilla 87.42 and average drop 1.31, both the smallest in the table; MaAS has the largest average drop among the comparisons, 16.53.
- Authors' interpretation: the authors state that the primitive representation decouples system logic from model-specific behavior, giving stable transferability; in cross-dataset transfer (Table 19), policies trained on one dataset still maintain accuracy and robustness after transfer to other datasets.
Unseen attack variants and cost
- Unseen attacks (Appendix A.4, Table 7): tested with stronger attack variants AgentHarm and ASB unseen during training, the attack scores on MMLU are 81.17 and 81.70 respectively (original setting 82.35), and on MSMARCO 86.25 and 85.00 (original setting 88.75); the authors state the drops are mild, indicating that what is learned is a general defensive structure rather than a patch for specific attacks.
- Cost (Table 3, MMLU): AutoRAS total cost is $0.6655, the second lowest among six methods (the lowest is MaAS at $0.3300), with training cost $0.3343; the authors state the overhead comes from the analyzer and monitor, but is reasonable relative to the performance and robustness gains.
- Comparison with production-grade systems (Table 16): compared with Magentic-One, CAMEL, OWL, the authors state that AutoRAS has the smallest attack drop on MMLU and MATH, at higher cost ($3.51 on MATH), because training samples multiple candidate workflows.
Ablations and component analysis
- Component ablation (Table 4, MMLU / MATH): removing the safety signal s drops the attack score to 71.90 / 46.87 (full system 82.35 / 54.94), the largest drop; removing rext gives 76.47 / 47.95; removing the textual gradient gives 79.74 / 52.70; removing rint gives 79.74 / 53.56. The authors state that the robustness feedback obtained from execution is the dominant optimization signal.
- Optimizer comparison (Table 14): under the same primitive space, replacing with PPO, REINFORCE, MCTS all reduce accuracy and robustness, and MCTS costs $1.6428 (MMLU), higher than GFlowNet's $0.6655.
- Monitor validation (Table 12): the GPT-4o-mini monitor achieves 94.89% accuracy on 100 trajectories and 900 binary human annotations, at a cost of $0.31; GPT-5.4 achieves 96.44% at a cost of $4.89.
- Random monitor (Table 13): replacing with random predictions drops the MMLU attack score to 79.74; the authors state performance decreases but is not catastrophic.
Other ablations and analyses
- Primitive vocabulary sensitivity (Table 9, MMLU): removing safety primitives (Vocab 2) gives an attack score of 75.16, versus 82.35 for the full vocabulary (Vocab 5); adding primitives (Vocab 6, 7) yields only marginal changes.
- Hyperparameter sensitivity (Fig. 3, MMLU): gains are marginal when L exceeds 16 and K exceeds 4; increasing ρ, η consistently reduces accuracy.
- Number of training queries (Table 17, 18): on MSMARCO, N = 15 already reaches the peak 90.00 / 88.75; on ProgramDev, N = 6 gives 66.67 / 62.50.
- Reward variants (Table 15): severity-weighted and compounding penalty perform similarly to the default reward.
- Analyzer backbone (Table 10, MMLU): with GPT-5, 84.97 / 84.31 at a cost of $2.5174; with GPT-4o-mini, 83.01 / 82.35 at a cost of $0.0058.
- Convergence (Fig. 6): the authors state that the smoothed TB loss stabilizes after about 30 training trajectories; the policy model has 4.29M parameters, one training run takes 2–6 hours, and more than 90% of the time is spent on LLM API calls (Appendix F.9).
What are some points that can be further explored?
The authors state that robustness is limited to the evaluated threat model and that monitor detection cannot be fully accurate; experiments cover 4 benchmarks and 4 backbone models.
Limitations and future directions noted by the authors
- Boundary of the robustness claim (Sec. 6.3): The authors state that the robustness conclusion refers to structural robustness within the evaluated agent threat model, not immunity to all possible attacks.
- Monitor detection accuracy (Appendix E.2): The authors state that due to the inherent difficulty of the tasks, LLM detection of the nine categories of internal faults cannot be fully accurate; the monitor is a plug-in module that can be replaced once specialized tools such as AgenTracer are publicly available.
- Primitive vocabulary requires design (Appendix G.1, Table 20): The limitation of the Primitive representation listed by the authors is that it requires vocabulary design.
- Source of cost (Appendix F.4): The authors state that cost is higher compared with production-grade systems because automated system design inherently requires sampling multiple candidate workflows at training time.
Experimental coverage
- Models tested: The backbone models are GPT-4o-mini, DeepSeek-V3.1, Claude-3.5-Haiku, Gemini-2.0-Flash, 4 in total, all accessed via API (Sec. 5.1); main table results are uniformly on GPT-4o-mini.
- Benchmarks and scale: 4 benchmarks in total—MMLU, MSMARCO, MATH, ProgramDev—with training sets of at most 119 and at least 6 examples, and test sets of at most 486 and at least 24 examples (Table 5).
- Attack coverage: Four attack categories—Brain, Memory, Tool, Agent-to-Agent—injected into half of the randomly selected agents; two stronger variants unseen during training, AgentHarm and ASB, were also tested (Sec. 5.1, Appendices A.3, A.4).
- Judging and agreement: LLM judge agreement measured on 50 logs gives micro-kappa 0.86; monitor-human agreement measured on 100 trajectories and 900 judgments gives accuracy 94.89% (Appendices A.1, E.3).
- Not reported in the paper: The number of repetitions and variance for each experiment (not given in Tables 1, 2); quantification of attack success rate or attacker budget; total number of training iterations (only reports convergence after about 30 trajectories, Appendix F.8).
Summarize the main content of the paper
AutoRAS uses primitive sequences plus GFlowNet to incorporate robustness into multi-agent system design, with an average drop under attack of 2.13%, the smallest among 11 baselines.
AutoRAS is a framework for automatically designing robust multi-agent systems, addressing the situation that existing automated design methods treat robustness as an afterthought and systems are vulnerable to external attacks and internal faults.
- Problem to solve: The authors state that designing robust systems is difficult because structure and behavior are entangled, fault sources are unpredictable, and equivalent designs cause ambiguous learning signals (Fig. 1).
- Method highlights: The system is represented as a sequence of symbolic primitives jointly encoding structure and behavior, compiled via a stack-based compiler to generate workflows; after execution, a monitor extracts numerical rewards and textual safety signals, and a GFlowNet Trajectory Balance loss plus textual gradients are used to optimize the generation policy in a closed loop, without retraining the underlying LLM.
- Main results: On MMLU, MSMARCO, MATH, ProgramDev with GPT-4o-mini as backbone against 11 baselines, AutoRAS has the highest average vanilla score of 74.27% and the smallest average drop under attack of 2.13% (Table 1); across four backbone models the average drop is 1.31% (Table 2).
- Robustness evidence: For the stronger attack variants AgentHarm and ASB unseen during training, the MMLU attack score drops from 82.35 to 81.17 and 81.70 respectively (Table 7); ablation shows that removing the safety signal drops the MMLU attack score from 82.35 to 71.90, the largest impact among the components (Table 4).
- Cost: Total cost on MMLU is $0.6655, the second lowest among the six compared methods (Table 3).
- Authors' conclusion and boundaries: The authors state that incorporating execution feedback into the design loop allows robustness to emerge naturally through trajectory-level learning; they also state that the robustness conclusion is limited to structural robustness within the evaluated threat model, not immunity to all attacks (Sec. 6.3).