A local agentic AI framework generates edge-case scenarios for safety assuranceA Local Agentic AI Framework to Generate Edge Case Scenarios for Safety Assurance
Local dual-LM generated Sorter scenarios achieved an Agentic success rate of 70.5%, lower than Random_1's 82.0% (Figure 9).
- Autonomous systems must argue acceptable safety at the ODD boundary, but edge scenarios lie in the long tail of the distribution. Manual enumeration is infeasible, random sampling does not align with triggering conditions, and many LM generations still rely on humans or rules.
- On the laptop, qwen3-coder:30b generates JSON layouts from the ODD knowledge base, nemotron3:33b criticizes and the results flow back for revision; Unity metrics decide whether to rewrite similar scenarios or explore new scenarios based on recent history.
- Each with 512 scenarios × 50 runs. In Figure 9, Agentic success rate is 70.5%, Random_1 is 82.0%, and Random_5 is 79.6%. The authors state that Agentic collisions and paths are more challenging, but coverage is narrower than random.
- The authors note that small models generate more than 10 obstacles, exploitation sometimes makes difficult scenarios easier, and Unity is not a full digital twin. The experiment compares two random baselines and a PPO policy; the paper does not report exploitation/exploration counts, and replay logs were not collected.
- Evaluated models
- PPO brain
- Benchmarks
- Unity-3D ML-Agents Sorter
- Metrics
- Success scoreTimeout scoreWrong tile scoreCollision countcumulative rewardregret
An arXiv paper (2610.13479) proposes an agentic AI framework that runs locally on a laptop, using a local LM to adaptively generate edge-case scenarios to support safety assurance for autonomous systems. The framework generates scenarios in a think, act, observe, update, continue loop with lightweight JSON encoding, and a second independent LM reviews and refines them against domain standards. Refined scenarios collect metrics in simulation, which are used to generate similar scenarios for exploitation or new scenarios for exploration, and clustering with topic analysis identifies functional gaps and triggering conditions, forming traceable safety assurance evidence.
Paper analysis
What problem does this paper attempt to solve?
Local dual-LM closed-loop generation of JSON edge scenarios on ODD boundaries, leaving evidence for safety arguments.
How to automatically generate concrete edge scenarios at the boundary of the operational design domain (ODD) of autonomous systems in a local, controllable computing environment, while leaving traceable safety assurance evidence.
- Motivating scenario: The authors state that after human oversight of safety-critical autonomous systems is reduced, qualified personnel can no longer be relied on to handle anomalies, and the system must be argued to autonomously meet operational, safety, and regulatory requirements under expected conditions. The open environment may be underspecified or even unknown at design time, so unknown and unsafe situations are more likely to occur.
- Existing shortcomings: The authors state that many recent language-model scenario generation approaches rely on human-in-the-loop or rules, limiting long-tail diversity. Monte Carlo does not target edge cases; formal and statistical models require behavior models that are difficult to capture; evolutionary search requires extensive configuration and trial and error; reinforcement learning lacks language-model world knowledge and requires many training rounds. Several LM pipelines also require accident data, failure logs, known errors, or manual editing.
- The authors' setting: Edge cases are statistical outliers that are rarely encountered and lie at the ODD boundary, and are not mutually exclusive with typical or critical scenarios. ISO 21448 Clause 7 requires identifying trigger conditions that expose functional gaps; Clauses 9–11 address verification strategies, known scenario spaces, and confirming unknown scenario spaces through simulation and other means. PAS 8800 requires generating synthetic edge scenarios but does not specify an implementation mechanism.
- The authors' proposed framework: A local agent closed loop on a laptop. A generation LM writes system requirements, system description, environment description, and task description into a JSON spatial layout; another LM critiques it against domain criteria and then revises it; simulation metrics determine whether to exploit existing layouts or explore new ones. The metrics and scenario text are then used to localize trigger conditions as goal structuring notation (GSN) evidence. The authors state that no prior knowledge of functional gaps is needed, and it can run on consumer-grade hardware.
What related research exists?
The authors position this paper as a fully automatic local edge-scenario closed loop that does not require prior knowledge of functional gaps.
Section 2 of the paper organizes related work by standards, simulation, and generation methods, and Section 5 additionally gives two random baselines.
Standards and assurance frameworks
- ISO 26262 and ISO 21448: The authors state that ISO 26262 targets deterministic software and pre-specified boundaries and does not address performance gaps in AI high-dimensional inputs. SOTIF divides regions by known/unknown and safe/unsafe; verification focuses on region 2 (known and unsafe), confirmation focuses on region 3 (unknown and unsafe), and it requires identifying triggering conditions.
- PAS 8800: A normative safety framework for AI in road vehicles. The authors state that it specifies safety goals that must be achieved but not the implementation mechanisms, so how to verify, quantify, and traceably confirm remains a methodological gap; and it requires using synthetic edge scenarios to check data gaps, model gaps, nondeterministic behavior, and generalization boundaries.
- STAMP/STPA and SACE: STPA can produce a large number of scenarios, and the authors state that only a small fraction of them are edge cases. Tsuji et al. (2020) use statistical model checking to search for critical scenarios, but the UML and statistical templates are customized per application and not easily generalizable. SACE uses scenarios in risk discovery, boundary testing, and simulation forensics, and the authors state that it gives little operational guidance on how to do scenario coverage. The authors believe this paper can supplement the targeted edge cases that STAMP/STPA lack.
Simulation testing
- Platform differences: The paper discusses Gazebo, Unreal-based CARLA, and Unity-3D, and cites that low-fidelity simulation can also find navigation defects (Sotiropoulos et al., 2017). The authors relay that Platt and Ricks (2022) state Unity-3D is superior to Gazebo in scalability, visuals, and real-time LiDAR. The experiments use Unity-3D ML-Agents and decouple from the specific simulator using JSON.
Scenario generation
- Sampling, formalization, and search: De Gelder and Paardekooper (2017) sample from a parameterized representation using Monte Carlo, and the authors state this is random search and not aligned with edge cases. Fuzzy logic combined with a labeled ODD yields a parameterized model (Proma et al., 2026). Formal scenarios such as SCENIC can be executed in simulation; statistical models biased toward critical scenarios require full-domain behavior models that are difficult to capture. Evolutionary and genetic algorithms are used to generate obstacle-avoidance failure scenarios (e.g., Khatiri et al., 2025), and the authors state they rely on random mutation, many configurations, and trial and error.
- Reinforcement learning and LM pipelines: Reinforcement learning that adjusts scenarios dynamically based on observations is used to find edge and high-risk interactions (Pandy et al., 2025; Karunakaran et al., 2023). The authors state that RL lacks LM world knowledge and requires many training episodes and complex rewards. LM work includes visual scenarios, adversarial behavior simulation, generation from accident reports, SERA retrieving existing scenarios from failure logs (Xia et al., 2025), ODD text to CARLA (Danso and Büker, 2025), and PlannerForge, which converts user descriptions to JSON and then edits (Gao et al., 2026). The shortcomings the authors name: they often require ready-made data, known errors, or pre-specified critical scenarios, and some require a small amount of manual adjustment.
Baselines and evaluation environment
- Random_1 and Random_5: Python random numbers place assets, tile values are not repeated, and position conflicts are resampled. Random_1 uses 1–20 tiles and 1–10 obstacles; Random_5 uses 1–20 tiles and 5–10 obstacles. The evaluation environment is an adapted Unity-3D Sorter arena, and the paper does not call it a separately named public benchmark.
The authors position the framework as a fully automatic closed loop: it does not presuppose errors, functional gaps, or critical examples, connects the environment, system, requirements, and task description directly to generation, and incorporates simulation feedback into dynamic adjustment.
How does the paper address this problem?
Two local LMs generate JSON scenarios through critical revision, and simulation metrics determine whether to exploit or explore.
The local agent closed loop converts the ODD and task description into a schema-strict JSON spatial layout, which is scored in simulation after being critiqued and revised by a second LM, and then decides whether to deepen the existing layout or switch to a new batch of layouts.
Problem Setting and Encoding
- The domain ontology is divided into environment description, system description and system requirements, plus a task description, all entering the context prompt as a YAML knowledge base. The authors state that it provides the spatial scope, constraints, data schema and task goals.
- Functional, logical and concrete are three levels of abstraction. Concrete scenarios are sampled from the logical distribution. Equation 1 writes a scenario as θJSON={(po1,ro1,do1),…,(vtn,ptn)}, i.e. the position, orientation and size of each obstacle, plus the values and positions of the floor tiles.
- Safety guarantees are denoted g(AS), examples including minimum obstacle clearance, an upper bound on erroneous visits and completion time. TC(θJSON)=1 means that these guarantees are violated at some point during the simulation period, otherwise 0. In Table 3 the authors assume that a timeout is also a safety risk, because the robot may get stuck and oscillate.
- The JSON also contains the scenario name, text description and start point. The prompt describes the schema with a TypeScript interface and requires JSON output; the authors state that this makes it easier for smaller LMs to write short, readable JSON. Pydantic checks types, can repair simple syntax errors such as missing brackets, and can also catch fields added out of nowhere.
Generation, Critique and Two Loops
- The generation LM is ollama:qwen3-coder:30b and the critique LM is ollama:nemotron3:33b, invoked locally through Ollama; AISuite switches models by changing a one-line string. The authors state that they chose the two based on coding and reasoning ability, and separated the roles because they observed confirmation bias when Qwen was used to self-evaluate alone.
- The process in Figures 2–3 is: the knowledge base enters the generation LM, the draft undergoes syntax validation, the critique LM comments according to domain guidelines, the generation LM revises, then validation again and writing to history; then each enters simulation one by one, metrics are collected, and it is decided whether to exploit or explore. think, act, observe, update and continue are used for the first draft, exploitation and exploration. The authors state that this splits the chain of thought into step-by-step blocks.
- The generation LM is asked for 4 scenarios at a time. The authors state that this is the largest batch in this experiment that still yields error-free JSON. Temperature is set to 0.7, based on examining 8 scenarios each at different temperatures; the authors state that higher temperatures introduce hallucination.
- Exploitation: When a functional gap is judged to exist, the generation LM is asked to rewrite the current scenario on the same interface. Exploration: A short FIFO stores the text descriptions of recent scenarios rather than the full JSON, and the new scenario is required to differ from the history. The authors state that the small model's context cannot hold the full history. The criterion in Listing 1 is: if successScore does not exceed 45, or crash_count is greater than 24, or avg_ratio_tiles_visited is less than 0.75, then exploit; otherwise explore. The paper does not explain the item-by-item correspondence between these three variable names and the metrics in Table 2.
Policy Under Test in Simulation
- The experiment adapts the Sorter from Unity-3D ML-Agents: a circular room, with the robot starting from the center, visiting the surrounding floor tiles in numbered order and avoiding obstacles. The authors state that the JSON interface keeps the framework from being tied to a particular simulator.
- The robot uses 7 LiDAR beams and can only perceive locally; the authors treat the operational domain as a partially observable Markov decision process. Each step has a movement penalty of -2/5000, reversing adds another -1/5000, the correct next tile gives +1, and a wrong tile or collision gives -1. Reaching the highest-numbered tile is success, 5000 steps is a timeout, and stepping on a wrong tile terminates the episode. The reward values were determined by trial and error.
- There are also 5 fixed obstacles with side length 1.0 in the arena. Each scenario JSON specifies 1–10 random obstacles with scale [1.0, 3.0], and 1–20 floor tiles with random numbers and positions.
- The "brain" under test uses proximal policy optimization (PPO). Training uses incremental curriculum learning: starting with at most 2 tiles, adding 2 tiles per lesson up to 20, with 5 fixed obstacles and 5 random obstacles of side length 1.0. The average final reward determines whether to proceed to the next lesson. Training runs for 15 million epochs, with 8 arenas in parallel. Before testing, this policy is treated as the navigation policy whose functional gaps are to be exposed.
Correspondence with the Safety Argument
- The top-level claim G1 is system-level avoidance of collisions with the facility. Figure 6 decomposes the agent scenario testing into passed tests, JSON scenario runs, metrics, simulation failures and collision logs, edge cases from Region 3 to Region 2, and hazard discovery reports.
- The authors use scenario text for a thematic-analysis-inspired categorization, then compare it with the metrics to map layout descriptions to trigger conditions and functional gaps. The knowledge base is written as non-negotiable constraints, but the authors state that the LM may still ignore the specification, so critique-revision and schema validation are used together. The appendix gives the full specifications of the environment, system, requirements, task and the two kinds of JSON.
What experiments did the paper conduct?
In Figure 9, Agentic success rate is 70.5%, lower than Random_1's 82.0% and Random_5's 79.6%.
Experimental Setup
- Tested policy: Curriculum-learned PPO Sorter brain, 7-beam LiDAR. Training is 15 million epochs, 8 arenas in parallel. The paper does not report multiple training seeds.
- Generation-side models: ollama:qwen3-coder:30b generates JSON, ollama:nemotron3:33b critiques. Temperature 0.7. Success is determined by simulation rule metrics, no separate LLM judge.
- Baselines: Table 1's Random_1 (1–20 tiles, 1–10 obstacles) and Random_5 (1–20 tiles, 5–10 obstacles). All three output JSON per Listing 5. Random baselines use Python random numbers, tile values are non-repeating, and resample on position conflicts.
- Scale: Each method has 512 scenarios total, 8 in parallel per batch in Unity, 50 episodes per scenario, totaling 25,600 episodes. 50 runs account for randomness in the PPO stochastic policy and environment.
- Arena and hardware: Circular Sorter, with 5 fixed obstacles of side length 1.0; scenario obstacles have scale [1.0, 3.0]. Laptop is Ubuntu 22.04, Intel i9, 32GB RAM, GeForce RTX 4080.
- Metrics: Table 2, including success, timeout, wrong tile, average path, ideal path, regret, proportion of tiles visited, cumulative reward, action distribution entropy, action transition entropy, and collision count. Closed-loop decisions use only the three thresholds in Listing 1.
Main Results
Figure 9 directly labels the proportions of the three methods on stacked bars. Figure 8 compares success counts over 50 repetitions; the text does not print specific boxplot values.
Swipe horizontally to read the table
Method Success Timeout Wrong Tile Random_1 82.0% 8.2% 9.7% Random_5 79.6% 10.9% 9.4% Agentic 70.5% 15.0% 14.5% - The authors state the lower success proportion indicates Agentic finds more critical scenarios that timeout or hit wrong tiles. The contribution list's "higher edge case yield and hazard discovery rate" does not give an additional overall percentage.
- The authors state in Figure 10 Agentic's final reward interquartile range is higher, but with more negative-reward outliers; Random_5 has one very low outlier (yellow circle), and they believe random methods may also happen to find edge cases. The text does not give these quartile values.
- The authors state regret is similar across the three methods; Agentic's mean and lower quartile are slightly higher, random methods have occasional outliers (Figure 11). The text also does not give specific regret quartiles.
Lowest and Highest Reward Scenarios
Section 6.2 lists the three lowest-reward scenarios and the one highest-reward scenario, with metrics from 50 episodes each.
Swipe horizontally to read the table
Scenario Average Reward Average Path Collisions Timeout Wrong Tile θJSON1 -105.8 3802 89 15 7 θJSON2 -42.9 2674 144 2 5 θJSON3 -40.2 2536 6 4 10 θJSON4 19.6 1118 0 0 0 - The authors classify the texts of θJSON1 and θJSON2 as dense obstacles near the start, and map this theme to low reward, long paths, multiple collisions, and timeout or wrong tile.
- θJSON3 is described as obstacle density varying with progress, with density decreasing near the center. θJSON4 is described as a peripheral loop plus route blocking; the authors state such layouts are less challenging.
- Table 3 maps "dense obstacles near start" to search space saturation and planning oscillation, and blocked tile passages to insufficient perception. This is the authors' categorization, not another set of measured gaps.
Coverage, Collisions, and Action Entropy
- The authors state in Figure 12 Agentic has more tile-visit failures: upper quartile below 1.0, lower mean, more outliers; its minimum is higher than Random_5's minimum. The text does not give these quartile values.
- The authors state in Figure 13 Agentic causes more collisions, and in Figure 14 the average path lower quartile, mean, and upper quartile are all higher, with larger interquartile range. Action distribution entropy lower and upper quartiles are lower (Figure 15); transition entropy interquartile range is similar to Random_1, with Random_5's lower and upper quartiles higher (Figure 16). These comparisons have no summary numbers.
- The authors state Figure 17 shows Agentic targets a subset of scenarios, placing obstacles mostly in 8 cardinal directions, with patterns like circles, T-junctions, blocking lines, blocking arcs, and diamonds, some visible in Figure 7. The authors state it generally takes the allowed maximum of 10 obstacles and 20 tiles, but still uses all values and positions; Figure 22 shows longer ideal paths and wider interquartile range. The authors conclude it complements rather than replaces random generation.
Other Ablations and Analyses
- Removing environment description: obstacles with scale 4.0 appear, exceeding the [1.0, 3.0] in the knowledge base (Section 4.2).
- Removing system description: obstacles are placed at the start (x=0.0, z=0.0) (Section 4.2).
- Single-LM self-evaluation: the authors observed confirmation bias when using only Qwen for critique, so switched to Nemotron; no quantitative comparison.
- Batch size: 4 scenarios per prompt; the authors state more causes Qwen JSON errors. Temperature comparison was 8 scenarios per setting, then chose 0.7.
- Out-of-spec: Figure 18 shows some generated scenarios have obstacle counts exceeding 10, despite the prompt specifying 1–10 (Section 7.3).
- Negative observations: the authors state that when not more successful, Agentic's cumulative reward quartiles are higher, and observed exploitation sometimes makes critical layouts easier to reach the goal (Section 7.3). The paper does not report how many times exploitation and exploration each occurred.
What are some points that can be further explored?
The authors note that small models can go out of specification, and plan to investigate the exploitation steps and the simulation-to-real gap.
Limitations and Future Directions Noted by the Authors
- Model capability: Smaller LMs are more task-dependent, with shorter context windows and task horizons. The authors suggest selecting models per task and using software guardrails to handle out-of-distribution errors, rather than adding more steps to prompts (Section 7.3).
- Specification not followed: Despite prompt limits of 1–10 obstacles, more than 10 were generated. The authors suggest handling this in Pydantic validation, e.g., returning to the generation step or randomly keeping 10 (Section 7.3).
- Reward and exploitation: The interquartile range of final cumulative reward is higher than both random methods, coinciding with more unsuccessful scenarios. The authors propose further investigation and call this a prototype; visual inspection also shows exploitation sometimes makes key layouts easier to reach the goal (Section 7.3).
- Simulation to field: The authors acknowledge the gap between simulation and open real environments. Unity-3D has high fidelity but is not a full digital twin. The authors state that JSON is platform-agnostic and scenarios can be arranged in the field according to the same specification (Section 7.3).
- No absolute coverage metric: The authors state the framework aims to discover unknown and unsafe scenarios, so there is no absolute coverage metric; they suggest trying other LMs to exploit training and structural differences to increase output variety (Section 7.3).
- Planned extensions: Filter metrics that better support forensics; feed discovered scenarios back into curriculum learning for retesting; collect replay logs previously unsaved due to disk usage; feed more metrics and logs into exploitation/exploration decisions; switch to a different Unity-3D environment; extend to dynamic obstacles and movable waypoints; transfer JSON layouts to hardware-in-the-loop and check whether patterns need expansion (Section 8.1).
Experimental Coverage
- Generation methods are Agentic, Random_1, Random_5, each with 512 scenarios and 50 episodes per scenario, totaling 25,600 episodes per method (Section 5.2).
- The navigation policy under test is a PPO Sorter brain trained with incremental curriculum learning over 15 million epochs; the simulation environment is an adapted circular Sorter, with static obstacles and floor tiles in the experiments (Sections 3.3, 5.1, 8.1).
- Generation and critique models are ollama:qwen3-coder:30b and ollama:nemotron3:33b; the runtime environment is a laptop with a GeForce RTX 4080 (Sections 3.1–3.2).
- Exported metrics are the full set in Table 2; closed-loop uses only the three conditions in Listing 1. Knowledge base ablation removes environment description and system description sequentially (Sections 4.2, 5.3).
- The paper does not report counts of exploitation and exploration triggers, generation queries, wall-clock time, or statistical tests for differences among the three methods; it also states that replay logs were not collected this time (Sections 6–7, 8.1).
Summarize the main content of the paper
Local closed-loop generation of JSON edge scenarios; in Figure 9, Agentic success rate is 70.5%, lower than the random baseline.
The authors built a local agentic closed loop that runs on a laptop to generate edge scenarios for safety arguments of autonomous systems, rather than releasing a new public test set.
- Difficulty addressed: The ODD parameter space is large with nonlinear relationships, and complete sets of concrete edge scenarios cannot be done manually. Random sampling does not align with triggering conditions as per ISO 21448; the authors believe several LM pipelines still require human-in-the-loop, known failures, or existing scenario libraries.
- Approach: Environment, system, requirements, and task descriptions are written as a YAML knowledge base. qwen3-coder:30b generates 4 JSON layouts at a time, nemotron3:33b critiques, then the generation model revises, and Pydantic checks syntax. A PPO robot in Unity-3D uses 7-beam LiDAR to visit tiles in order. Three thresholds in Listing 1 decide whether to rewrite the current scenario or generate different layouts based on recent text history. Scenario texts are then used with metrics by the authors to record unknown unsafe situations from region 3 as region 2.
- Main comparison: Three methods each with 512 scenarios, 50 runs per scenario. In Figure 9, Agentic's Success, Timeout, Wrong Tile are 70.5%, 15.0%, 14.5%; Random_1 are 82.0%, 8.2%, 9.7%; Random_5 are 79.6%, 10.9%, 9.4%. The authors state this indicates Agentic finds more incomplete scenarios.
- Cases and exceptions: The lowest-reward θJSON1 has average reward -105.8, 89 collisions; θJSON2 has 144 collisions. The highest-reward θJSON4 is 19.6, with collisions, timeouts, and wrong tiles all 0. The authors state heatmaps show Agentic concentrates more on specific obstacle patterns, with narrower coverage than random, thus suitable to complement random testing. Meanwhile, the interquartile range of final rewards is higher than random methods, which the authors suggest needs further investigation; exploitation sometimes also makes difficult scenarios easier.
- Authors' conclusion: The authors state JSON layouts plus simulation metrics can serve as reproducible evidence in GSN, and enable smaller teams to do targeted scenario testing on consumer hardware. The authors call the current system a prototype and plan to continue testing with replay logs, curriculum learning retests, dynamic objects, and hardware-in-the-loop.