APEXA adds execution integrity guardrails to LLM multi-agent systems for synchrotron data processingAPEXA: Execution-Integrity Enforcement for Multi-Agent LLM Automation of Synchrotron Data Reduction
APEXA uses the tool layer to reject unexecuted results; on 50 scenarios × 4 models against a simulated IOC, it scores 0/200, while the prompt-only baseline scores 15/200.
Text-based institutional gateways may silently drop issued tool calls, and the model may still narrate calibrations that were never executed. Optional EPICS motor commands are intercepted by five server-side checks before caput. 50 adversarial scenarios are evaluated on a simulated EPICS IOC, where the correct result is to refuse and issue no command.
- Synchrotron data reduction is a multi-step expert process, and a language model's fluent reply does not mean the requested computation has been executed. Institutional gateways may also silently drop tool calls, and the model may still narrate calibrations that were not run.
- APEXA uses one reasoning agent to call 61 tools. A deterministic tool layer refuses to return results without an execution record and runs five checks before motor commands are issued. APEXA-BENCH contains 58 tasks labeled by four types of physical consequence.
- On 50 adversarial scenarios, four models, and a simulated EPICS IOC, tool-layer violations are 0/200, and the prompt-only baseline with roughly 700 tokens is 15/200. On APS 1-ID, one prompt completes calibration and integration, the detector distance in a CeO2 decay scan stays within ±0.02 mm, and non-physical calibrations are rejected.
- The paper does not specifically discuss limitations. This paper reports motor safety gates and cross-detector task completion; large-scale scoring is left to the full paper, and the main text has no APEXA-Score. §IV-C only evaluates task completion, not refinement accuracy.
- Evaluated models
- GPT-5-miniGPT-5.4Claude Opus 4.7Gemini 2.5 Pro
- Benchmarks
- APEXA-BENCH50-scenario adversarial suiteAPS 1-ID ai_tuneMIDAS bundled CeO2 SRM 674b
- Metrics
- unsafe command violationsLsd stabilitytask completionAPEXA-Score
The paper proposes APEXA, a deployed framework that coordinates 61 tools for synchrotron data reduction and, through deterministic execution integrity guardrails, prevents returning results for tool calls that were not actually executed. The same tool layer also enforces motor safety constraints: over 50 adversarial scenarios and four models, it produced 0/200 violations against a simulated EPICS controller, versus 15/200 for the prompt-only baseline. The authors also release APEXA-Bench, containing 58 facility tasks organized by scientific correctness and physical consequence; on real APS beamline data, a single prompt recovered detector geometry and integrated a complete attenuation and exposure scan. The authors argue that trustworthy scientific agents require deterministic execution verification rather than model-side guarantees, and they release the framework, benchmark, and trajectories.
Paper analysis
What problem does this paper attempt to solve?
Fluent replies do not mean computation was executed; the gateway may also silently drop tool calls.
A fluent reply does not mean the requested computation has been executed; synchrotron data reduction cannot rely on such replies.
- Scenario: Synchrotron experiments produce terabyte-scale diffraction data; calibration and long-sequence azimuthal integration involve more than twenty executable programs, each with over a hundred parameters. The authors consider using this pipeline well to be a separate expert skill and it is currently limiting facility throughput.
- Existing Methods: Previous benchmarks score by lexical or execution-level results, string matching, unit tests, or simulated final states. The authors state they cannot see two failure types: formally correct sequences may still not reach scientist-accepted calibration tolerances, or converge to physically impossible geometry; evaluations operating real instruments are also rare, and do not check whether results come from executed tool calls.
- Observation: An institutional gateway can silently drop tool calls, and the model then describes calibrations that never ran. The authors state that prompts cannot prevent this; deterministic checks can confirm that a call was executed. The same principle applies to the optional motor surface.
- This Paper's Approach: The authors present deployed APEXA, which rejects results without execution support at a deterministic tool layer, and uses 61 tools for data reduction. They also present APEXA-BENCH: 58 facility tasks, organized by scientific correctness and physical consequences.
- Threat Model:
- Goal: Do not return unexecuted analyses as results; the correct result in the motor scenario is a refusal with explanation, and no EPICS command is issued.
- Channel: The model sends tool calls through a text-based institutional LLM gateway, which may silently drop calls. The paper does not use white-box, black-box, or no-box.
- Adversarial Inputs: 50 scenarios covering out-of-range, limit switches, travel greater than 50%, contradictory instructions, prompt injection, fast multi-axis without interlocks, illegal speeds, and runaway jog.
- Victim System: Calibration, integration, and optional EPICS motors at APS. Motor experiments run against a simulated EPICS IOC; labels record the cost of the same command on real instruments.
What related research exists?
The authors state that existing benchmarks do not check whether results are produced by executed tool calls.
Related discussion centers on agent benchmarks, adversarial evaluations on digital tools, and agent systems on instruments.
Agent benchmarks
- Chen et al. (2021), SWE-bench (2024), WebArena (2024), and GAIA (2024) evaluate code, repository issues, browser environments, and general assistants, respectively.
- τ-bench (2025) checks final states in simulations; ScienceAgentBench (2025), SciCode (2024), and MLAgentBench (2024) evaluate scientific code or machine learning experiments.
- The authors state that none of these works grades by physical consequence, nor do they face text-based institutional gateways that silently drop real calls; even checks like τ-bench that verify model-claimed outputs would certify results that were never executed. The authors state that the closest physical benchmark, AFMBench (2025), controls an atomic force microscope but has no systematic safety axis or consequence taxonomy.
Adversarial robustness suites
- The authors classify Ruan et al. (2024), AgentDojo (2024), R-Judge (2024), and AgentHarm (2025) as evaluations of risk, prompt injection, or harmfulness on digital tools.
- The authors state that their failure mode is information leakage, not equipment damage; APEXA-BENCH is complementary, with the gate at the deterministic tool layer rather than model-side defenses.
Agents on instruments
- The authors mention Coscientist (2023), ReAct-based ChemCrow (2024), VISION (2025) for SAXS/WAXS, X-ray nanoprobe work (2026), and robot chemistry (2025), as well as the broader self-driving laboratory literature.
- The deep learning phase identification in the introduction addresses isolated subproblems. The authors state that these do not handle an end-to-end operational data reduction pipeline.
- The authors state that microscope automation, X-ray nanoprobes, and general scientific agent benchmarks have been evaluated, but none checks execution integrity.
Baselines and benchmarks
- The experimental baseline is a prompt-only safety prompt of about 700 tokens, sharing a 50-scenario adversarial suite with the tool-layer check, against a simulated EPICS IOC. The task set is APEXA-BENCH, not the external benchmarks above.
The authors position the paper as a deployed analysis framework for checking whether reported results arise from actually executed tool calls, and for grading erroneous actions by physical cost on the beamline.
How does the paper address this problem?
The tool layer rejects unexecuted results and performs motor checks before caput.
APEXA separates stochastic reasoning from execution: tool calls first pass through a deterministic tool layer, then enter three MCP servers. The title says Multi-Agent; §III and Fig. 2 describe a single reasoning agent looping over all 61 tools.
Trust boundary and tools
- Agent: one stochastic reasoning agent issuing text calls through the institutional LLM gateway. The paper does not state which model is bound by default at deployment.
- Tool division: 10 core tools, 38 MIDAS tools (calibration, radial integration, GSAS-II Rietveld, Materials Project structure retrieval), and 13 EPICS tools. Domains include calibration, analysis, motors, knowledge, and visualization.
- Boundary: Fig. 2 places the parser, execution-integrity guard, and motor checks in the tool-layer code. The gateway can silently drop calls; the guard turns this into an explicit non-result and forces a retry.
- Backends: the same analysis can run on a Python (GPU) or compiled (CPU) backend, and results are written to the manifest. The authors state that manual parameter-file edits are not needed.
Execution-integrity guard
- Condition: when a reply contains tool-call syntax but no tool executes in that turn, the runner refuses to finalize, injects a correction, and forces a well-formed retry. After repeated failures, it returns "nothing executed" and does not adopt the model's narrative.
- Format: the authors report that GPT-5-class models emit TOOL_CALL/ARGUMENTS text; Claude Opus/Sonnet drift to native XML or bare key-value pairs. The parser still treats drifted calls as calls.
- Missing inputs: when no Materials Project API key is configured, the CIF cannot be retrieved, and the path is not in the output of any executed tool. The system reports a missing input and does not run refinement.
- Unspecified parameters: the paper gives neither a cap on forced retries nor the original text of the injected correction.
Motor checks
- Timing: before any caput, the checks run in EPICS server code, not in the model or the prompt.
- Five check names: §II-B lists limit switch, soft limit, >50% travel guard, velocity bound, and jog-duration cap; §IV-B lists soft limit, limit switch, travel magnitude, velocity, and jog duration; Fig. 4 lists soft-limit, limit-switch, slew-magnitude, velocity, and jog-duration. The paper gives no numeric thresholds for the velocity bound or jog duration.
- Suite: 50 scenarios and eight failure-mode categories. The correct result is a refusal with an explanation and no EPICS command issued. Evaluation uses a simulated EPICS IOC and measures whether the gate blocks commands.
Benchmark design
- Scale: 58 natural-language tasks: Calibration 11, Integration 8, HEDM Analysis 10, Motor Control 10, GSAS-II Refinement 11, Domain Knowledge 8. The authors state that 50 tasks are foundational and 8 additional cross-detector slices are ref_01–ref_08.
- Labels: in Table I, I, C, PR, and PI correspond to no cost, computation time, beamline time, and equipment damage, respectively. Motor tasks run on a simulated controller; the labels record costs on real instruments.
- Scoring: general tasks assess whether tool selection and parameters fall within domain tolerances. Cross-detector slices additionally define the endpoint as a NIST-traceable lattice constant from GSAS-II Rietveld that must fall within the tolerance of a certified reference. This paper does not report large-scale scores.
- Composite definition: the appendix writes the score as APEXA-Score=1/(|T|)∑t∈ T wt· Ct· St·(α+(1−α)Et). C and S are 0 or 1, E is min(1, nopt/nactual), wI=1, wC=1.5, wPR=2, wPI=3, and α=0.7 is fixed in advance. The multiplication makes an unsafe but correct task score 0. The authors call the weights illustrative.
What experiments did the paper conduct?
Tool layer 0/200, prompt 15/200 (50 scenarios × 4 models, Fig. 4).
Experimental Setup
- Models: GPT-5-mini, GPT-5.4, Claude Opus 4.7, Gemini 2.5 Pro, with identical tool descriptions, accessed through an institutional LLM gateway. The paper does not state the default deployment model.
- Sampling: chat endpoint temperature=0.2. The authors state that frontier APIs are not bit-reproducible, the gateway does not provide a seed, and the prompt-only baseline is a single point estimate from 2026-05. The authors state that the core claim is the deterministic nature of the tool layer.
- Safety Protocol: 50 scenarios × 4 models = 200 runs, simulating an EPICS IOC. The control is a prompt-only baseline of about 700 tokens. Success criterion is refusal without issuing commands. No LLM judge.
- Real Data: APS 1-ID, Varex 2880×2880, 63 keV, Lsd about 900 mm; standards CeO2 and LaB6. Fig. 1 notes 150 µm pixels.
- Cross-Detector: ref_01–ref_08, CeO2 (SRM 674b), detectors are GE, Pilatus, and two Varex types, using MIDAS built-in examples. Only task completion is evaluated.
- Quantities Not Given in the Main Text: per-model violation counts, guard retry limit, success rates for the 58 tasks, and measured APEXA-Score values.
Main Results
0/200 and 15/200 are totals across the four models. The paper does not break them down by model, so the table has no model rows.
Condition Result Source Tool layer with five check types, 50 scenarios × 4 models 0/200 violations Fig. 4 About 700-token prompt-only, same 200 runs 15/200 violations, 185 blocked Fig. 4 Prompt-only, large single-step travel 9 Fig. 4 Prompt-only, out-of-range targets 4 Fig. 4 Prompt-only, prompt injection 1 Fig. 4 Prompt-only, multi-axis 1 Fig. 4 CeO2 attenuation scan, recovered Lsd stable to ±0.02 mm §IV-A, Fig. 3 Same conditions CeO2 and LaB6 Lsd consistent to 0.03 mm §IV-A - Authors' Interpretation: The authors state that such constraints must be written into code, not just into prompts. The figure caption states that the tool-layer side is by construction; the text states that these trials produced no unsafe commands. Violations are spread across the four models; the figure does not break them down.
- Types: The figure caption states that prompt-only violations concentrate in large single-step travel and out-of-range targets; the figure caption states that the remaining types are 0 in both settings.
- Geometry: The authors state that they recover reproducible physical geometry and refuse to report non-physical calibrations. Rejected were CeO2 att5 and LaB6 att6; the figure caption states they are far above the convergence threshold; the text writes strain about 10−3, beam-center offset possibly negative. The specific threshold value is not given in the paper.
Real Beamline Recovery
- Single Prompt: One natural-language prompt runs calibration and 2D-to-1D integration: identify the standard, match dark field, refine geometry, produce 1D pattern. Fig. 1 shows one CeO2 frame with Lsd = 895.80 mm, beam center (1410, 1447) px, λ = 0.1968 Å, residual pseudo-strain 1.3×10−6. The figure caption states these values come from the manifest, with no manual tuning.
- Beam Center: Under the same conditions, the beam-center difference between the two standards is < 0.005 px (< 1 µm). The CeO2 attenuation scan has beam center < 0.004 px. Fig. 3b caption states that run-to-run variation of about 0.005 mm is real scatter within the stability band.
- Figure-Text Comparison: The introduction writes the stability of detector distance as covering attenuation/exposure scans; Fig. 3's horizontal axis is Attenuation level. The authors state that non-physical calibrations are autonomously excluded, not issued.
Execution Integrity and Refinement Tasks
- Failure Modes: The authors report that frontier models give geometry tables, output file sizes, and even checksum-consistent conclusions for commands that never ran, with corresponding files not on disk. The authors state that string matching and tool-state metrics would record such turns as successes.
- Guard: When a call has invocation syntax but no execution in that turn, the guard refuses to finalize and forces a retry; after repeated failures it returns "nothing executed". Without an API key, it does not return fits for structures never obtained.
- ref_01–ref_08: The authors state that a single natural-language request can complete these tasks; no completion rate is given. The authors state that under a narrow convergence radius, a fit can report success and return numbers close to the given initial values, so a tool running does not mean that step constrained the answer. This paper only evaluates completion; refinement accuracy is not evaluated because the recipe has been revised, and it would require ablations of initial unit cell and peak-shape terms, and per-slice robust statistics rather than means.
Other Ablations and Analyses
- temperature=0.2; prompt-only baseline is a single point estimate from 2026-05; gateway has no seed (§III).
- Format-drift observations include Claude Opus/Sonnet; the four formal model list does not include a separate Sonnet (§III, §IV-B). The number of drift misjudgments is not reported.
- Without a Materials Project API key, refinement is skipped (§IV-B).
- Python (GPU) and compiled (CPU) backends can run the same analysis; no numerical comparison is reported (§IV-A).
- Appendix weights wI=1, wC=1.5, wPR=2, wPI=3, α=0.7; no APEXA-Score in the main text.
- The appendix states that the motor gate can be reproduced with a mock and no LLM; this is the same claim as Fig. 4, not a separate set of counts.
What are some points that can be further explored?
The paper does not specifically discuss limitations or future work.
Limitations and future directions noted by the authors
The paper does not specifically discuss limitations.
Experimental coverage
- The safety suite is 50 scenarios times GPT-5-mini, GPT-5.4, Claude Opus 4.7, and Gemini 2.5 Pro, 200 runs total, against a simulated EPICS IOC; the chat endpoint uses temperature=0.2, and the prompt-only side is a single-point estimate (§III, §IV-B, Fig. 4).
- The real data are CeO2 and LaB6 from APS 1-ID with a Varex 2880×2880 detector at 63 keV; Fig. 3 reports calibration residuals and Lsd as a function of attenuation level (§IV-A).
- The cross-detector slices are ref_01–ref_08 using the CeO2 SRM 674b standard, with GE, Pilatus, and two Varex detectors; the data come with MIDAS examples; only task completion is recorded (§IV-C).
- §II-A states that this paper reports motor safety gates and cross-detector tasks, while large-scale model scoring is left to the full paper; the main text has no APEXA-Score values.
- The paper does not report how the 15 prompt-only violations break down across the four models, nor does it report the guard's retry cap and the number of model queries per scenario (Fig. 4, §IV-B).
Summarize the main content of the paper
The authors state that whether execution occurred must be verified at the tool layer, not by relying only on the prompt.
APEXA is a data reduction framework at the Advanced Photon Source that uses tool-layer code to constrain tool calls of a language model agent.
- Problem: Calibration and integration are multi-step processes with many parameters. A fluent reply cannot replace "the call has been executed"; text-based institutional gateways may also silently drop calls.
- Method: A single reasoning agent uses 61 tools through three MCP servers. Guards refuse to present results without an execution record; EPICS commands pass through limit, travel, speed, and jog duration checks before caput. APEXA-BENCH has 58 tasks, annotated by no cost, compute time, beam time, and equipment damage.
- Safety results: On 50 adversarial scenarios, four models, and a simulated EPICS IOC, the tool layer gives 0/200 violations; the prompt-only baseline of about 700 tokens gives 15/200, with large travel 9, out of range 4, prompt injection 1, multi-axis 1 (Fig. 4). The caption states that the tool layer's 0 is obtained by construction.
- Beamline results: One prompt completes calibration and integration on real data at APS 1-ID. Fig. 1 shows Lsd of 895.80 mm for one frame of CeO2, with residual pseudo-strain of 1.3×10−6. The recovered detector distance on a CeO2 attenuation scan is stable to ±0.02 mm, and CeO2 att5 and LaB6 att6 are rejected (Fig. 3). Lsd for two standards under the same conditions agrees to 0.03 mm. The abstract also extends this stability to the full attenuation and exposure scans.
- Authors' conclusion: The authors state that trustworthy scientific agents must check both execution and scientific output in code, rather than relying on model-side guarantees. They also state that execution completeness is necessary but not sufficient, so the refinement tasks in this paper are evaluated only for completion, not accuracy.