> while reducing bugs on my side with the help of AI.

How do you know? You might be adding (latent) bugs every time your LLM fixes one for you.

Same as usual: add tests. Over time the test suite becomes the spec that describes how the software should function. As the test suite grows you squeeze out room for undefined behaviour and bugs.