Manuscript Offprint

arXiv:2610.35982

Generation and Verification: Human-Agent Collaboration for Safety-Critical Automotive Software Engineering

Elizaveta Zinovyeva, Aiham Taleb, Nikita Kozodoi, Daniel Schleicher, Amir Mahdi Namazi, Martin Kraus, Levent Kent, Brian Jensen

Abstract

Research on coding agents mainly focuses on generation quality. Yet, safety-critical automotive software makes two additional demands. It prioritizes verification, since every change is reviewed, traced to a requirement, and checked against industry standards such as MISRA and AUTOSAR before it can be committed. It is also a narrow domain, written against layered architectures, embedded resource constraints, and organization-specific interface conventions that are scarce in the data general-purpose LLMs are trained on. We present a coding assistant for automotive C/C++ that addresses both demands. First, it exposes three tools to the user over the Model Context Protocol (generate, edit, and verify), allowing developers to run verify on any code on demand rather than relying on the agent to check its own output. Second, rather than using a general-purpose model, we customize the underlying LLM for the automotive domain through prompt engineering and fine-tuning. We construct a dataset from automotive production code of AUMOVIO, where each function is paired with the requirement texts and Unified Modeling Language (UML) behavior it must satisfy. In a two-week pilot on active production projects, developers report verify as the most-used tool and confirm using it on their own code and not only on generated output. Comparing model customization strategies, 75% prefer the faster prompt-engineered configuration. MISRA- and AUTOSAR-inspired pattern checkers indicate that prompt engineering achieves a lower number of violations on C, while fine-tuning shows better conformance with architecture patterns for C++.

1 Introduction

Research on AI coding assistants is organized largely around generation quality (Jiang et al., 2024), asking whether a model produces code that compiles, passes tests, and resembles a reference implementation (Paul et al., 2024; Zheng et al., 2025). Automotive software development is adopting these assistants as car makers seek productivity gains (Hepp et al., 2025). Yet, they fall short of safety-critical requirements such as AUTOSAR (AUTOSAR, 2017) and MISRA-C (Association, 2013), which establish strict rules for reliability in automotive systems. Recent studies show that popular LLMs struggle to produce MISRA-compliant code by default (Umer, 2025), while hallucinations pose tangible safety risks (Pavel et al., 2025). This places two additional demands on coding assistants for automotive software.

The first demand is verification. In safety-critical settings, developers cannot accept LLM output blindly, since every change is reviewed, traced to a requirement, and checked against coding standards before it can be committed. The practical question is therefore not only whether the model can write compliant code, but how the agent should collaborate with the developer so that compliance can be verified, audited, and trusted.

The second demand is domain fit. Automotive code must guarantee deterministic execution under real-time constraints, follow specific architectural patterns (e.g., AUTOSAR layered architecture) rarely encountered during pre-training, operate under tight memory and resource constraints in embedded systems, and respect interface conventions particular to the organization that owns the codebase. A general-purpose model fits this

∗^{*}Work done while at Amazon Web Services.

setting poorly, since the conventions it must follow are underrepresented in its training data (Cassano et al., 2024; Gu et al., 2025; Liu et al., 2023).

This paper introduces an agentic assistant for automotive software, built on the Model Context Protocol (MCP) (Anthropic, 2024), that addresses both demands. We address the first demand by exposing verification as a separate tool. Rather than providing a single code generation mode, the system exposes three tools: generate, edit, and verify. The first two generate and revise function bodies from a signature, documentation, and context such as imported functions and UML diagrams. This task is central to automotive workflows, where interfaces are specified upfront and implementations must follow established patterns. The third tool lets developers run the same automotive rule checks the agent uses internally, on demand and independently of generation. Most coding agents treat checking as an internal step that the agent itself decides to invoke. We argue that in safety-critical settings the developer must be able to trigger evaluation directly, because a check the agent can skip is not a reliable check.

We address the second demand by customizing the model to the domain. We build a dataset from an AUMOVIO's production automotive code in which each function is paired with the context needed to implement it compliantly, including requirement texts resolved from AUMOVIO's requirements-management system and the UML behavior the function must realize. On this dataset we compare the two customization strategies most used for code models (Shin et al., 2025; Freire et al., 2026): prompt engineering (PE) with general-purpose API models and domain-specific fine-tuning (FT) (Zirak and Hemmati, 2024), both scored against custom rule sets inspired by established automotive standards. PE here involves supplying the assembled context and the rule sets in full at inference time, rather than tuning instruction wording, so the two strategies differ in when the domain information reaches the model and not in what it contains. Because those rule sets are pattern matchers, we treat their output as pattern conformance rather than compliance, and report how that changes what the numbers support.

The main contributions are the following. First, we present an MCP-based architecture in which verification is exposed as a tool the developer can invoke directly, on any code and at any time, and articulate the corresponding division of labor between human and agent in safety-critical review. Second, we implement a context engineering pipeline that assembles requirement texts, UML behavior, and API context into training and inference examples, which lets us compare PE against FT on the same domain information, differing in whether it arrives during training or at inference. We analyze how the two methods perform in terms of architecture and coding pattern violations and generation latency. Comparing against a human baseline of shipped production code, we find that generated C code scores better than code written by the engineers, and we show that this reflects what the checkers reward rather than a genuine quality advantage. Finally, we report results from a two-week pilot with nine developers from AUMOVIO and show how the three tools are taken up in a real-world production workflow.

References (27)