27.02.2026
Public auditing plays a crucial role in strengthening the efficiency, transparency, and accountability of public resources.
Aligning with this mission, the Comptroller General’s Office is exploring new technologies, dedicating resources to identify areas where AI can be first applied and supporting Barcelona City Council’s efforts to roll out AI tools across the organization. This approach also indirectly contributes to broader objectives, such as those outlined in SDG 16.
In Spain, part of the internal control functions carried out by comptrollers are performed prior to administrative actions. This is a distinctive feature of the Spanish internal control system, implemented in municipalities through what is known as the “preliminary auditing” of administrative acts. This preliminary control is regulated and defines the requirements to be verified for each type of case file. Precisely because of its regulated nature, the Comptroller General’s Office considered this task suitable for the application of AI, making it the first step in implementing AI in internal financial auditing.
In 2024, pilot tests were launched around public procurement. The decision to start with the preliminary auditing of contracts was not only due to the standardized nature of this area, but also because it currently represents a significant investment in resources. The aim is to maximize efficiency by standardizing and automating tasks, allowing comptrollers to focus on supervision and other auditing functions where human capital contributes to improving management.
The Comptroller General’s Office set up a team to explore the potential, benefits, and limitations of several large language models (LLMs). The team focused on testing these systems not only for processing data and documents, but also for performing semantic analysis to support the auditing of public service contracts. Several LLMs were tested on five basic checks applied to contracts, including budget availability, authority competence, consistency of evaluation criteria, and special conditions.
Key documents were identified for AI use, including administrative terms, expenditure approvals, technical specifications, service and inspection reports. Supporting data—such as lists of competent authorities, budget codes, relevant legislation, and audit templates—was provided to guide the AI in validating contracts.
The AI system was designed to leverage both structured and unstructured data to automate contract validations and accurately assess each audit point. Preliminary results showed that while the AI models could process the information, they tended to over-simplify or summarize excessively, particularly when executing repetitive instructions. This highlights the importance of carefully defining test conditions and benchmarks, as AI continues to evolve rapidly.
At the same time, Barcelona City Council’s IT department (IMI) assisted in assessing the market’s ability to provide a robust and reliable solution, whether off-the-shelf or custom-built. IMI identified a company willing to develop a proof-of-concept project.
Thanks to the collaboration between IMI, the proof-of-concept developer, and the internal team, the strengths and limitations of AI have been identified. The research highlighted the rapid and dynamic evolution of this technology, which can improve reliability and reduce costs, but also requires clear conditions and safeguards for its use. Additionally, ensuring data privacy and compliance with current legislation is essential. During the testing and evaluation process, only publicly available documents and data were used.
Building on the knowledge gained over the past year, the Comptroller General’s Office is working with IMI to define the specific terms of a tender aimed at finding the best market solution to automate municipal auditing processes.
As a requirement, the AI tool should integrate with the Council’s procurement system and use internal records, regulations, and audit templates to perform automated validations. Municipal auditors must be able to review and override AI results, and validated reports should be sent back for administrative processing. The tool should include a dashboard to monitor performance and a library of structured forms to guide consistent checks. It should combine technology and human expertise and be flexible enough to improve over time based on auditor feedback, ensuring efficiency while maintaining rigorous oversight.
Implementing AI in auditing presents both challenges and opportunities. Challenges include the need for high-quality, continuous supervision, training auditors in new technological skills, and ensuring privacy and security. At the same time, AI can automate repetitive tasks, enable continuous monitoring, detect irregularities, and support data-driven decision-making, enhancing efficiency, transparency, and public trust.
The experience gained so far demonstrates the value of AI in modernizing and strengthening auditing processes. The goal is to gradually expand its application to all areas of public auditing. This approach will maximize the benefits of automation while maintaining rigorous oversight and improving the overall quality and efficiency of public management.
Further information:
The topic of artificial intelligence and its responsible use in local public finances was also discussed at the European Cities for Sustainable Public Finances (CSPF) meeting, where city finance leaders exchanged experiences on administrative capacity, AI and SDG 16.