A Local Agentic AI Framework to Generate Edge Case Scenarios for Safety Assurance
Organizations: Department of Computer Science, University of York, York, YO10 5DD, UK
Abstract
Generating edge case scenarios is crucial for training, testing and safety assuring autonomous systems. This identifies hazardous failures to increase system reliability and robustness, ensures the system can still function safely on the boundaries of its operational design domain and learns the expected system behaviour for these edge cases. The rapid advancement in the generation and analysis capabilities of language models (LMs) has expanded their applicability and recent work has investigated LM scenario generation. However, many recent approaches rely on human-in-the-loop or rule-based strategies. This restricts the LM's ability to generate diverse and edge case scenarios; the long tail of the distribution. Our work uses local LMs in a laptop-based agentic AI framework for adaptive scenario generation. This is cheap, fully-controlled, ensures data privacy and security. It uses think, act, observe, update, and continue loops with lightweight JSON encoding to generate scenarios. We use the system requirements, system description and environment description as knowledge bases in contextual prompts for an LM to ensure scenario realism. A second, independent LM critiques each scenario using domain specific criteria so it can be refined. The refined scenarios are run in simulation and evaluation metrics collected. These metric scores are analysed and similar scenarios are created for edge cases (exploitation) or novel scenarios are generated to explore the scenario space. Post-hoc clustering using metric scores and thematic-type analysis of the rich-text scenario descriptions produced by the LM pinpoints functional gaps and their triggering conditions. This creates traceable evidence for the safety assurance case. Our work highlights the potential of a flexible and adaptive local agentic AI framework for automating edge case generation and producing traceable safety assurance evidence.
Figures & tables
| Baseline | Description |
|---|---|
| Random_1 | Random asset placement generated using the Python random number generator with 1-20 tiles and 1-10 obstacles. Tile values are generated as unique values (used at most once). If tile or obstacle locations clash then a new location is generated. |
| Random_5 | Random asset placement generated using the Python random number generator with 1-20 tiles and 5 -10 obstacles. Tile values are generated as unique values (used at most once). If tile or obstacle locations clash then a new location is generated. |
| Metric | Description |
|---|---|
| Success score | how many times it successfully completed the task (over 50 episodes) |
| Timeout score | how many times the task timed out (over 50 episodes) |
| Wrong tile score | how many times it visited the wrong tile (over 50 episodes) |
| Avg path length | the average number of steps taken (over 50 episodes) |
| Ideal path length | the ideal number of steps (shortest path) |
| Regret | (avgPathLength / idealPathLength) |
| JSON Parameter / Asset Configuration | ISO 21448 Triggering Condition (TC) | Exposed Functional Gaps (FG) | Resulting Unsafe Behaviour |
|---|---|---|---|
| Dense clusters of obstacles near the robot’s starting point | Algorithmic search space saturation: Complex spatial topology | Planning oscillations ( ): Local planner path deadlock or trajectory freezing. | Timeouts: Robot stuck, path oscillation, or trajectory abandonment |
| Tile access blockades (clearance ) | Geometric Constraint Boundary: Access to tile blocked requiring robot to reverse | Perception Insufficiency ( ): LiDAR point-cloud sparsity (no backward facing LiDAR) | Collisions with wrong tile or arena walls, or obstacle contact. |
AI Assurance
Artificial intelligence assurance develops evidence and controls to evaluate, govern, and certify AI systems across their lifecycle and deployment contexts.
See all 77 papers