App on Arm Mac (Ventura 13.3) doesn't get microphone access (for automated testing)

I’m working on automated CI tests for an app that uses JUCE. On an x64 (Monterey 12.6) the app just has permission to access the mic (we are not using a real mic, but BlackHole for Audio routing). But on the Arm Mac (Ventura 13.3) the app requested access must be granted manually.

This makes automated testing really hard. If I remote control the CI workstation and manually start the app / enable mic access in the privacy settings it works fine. But when the app is run by the automation, it doesn’t get any audio input.

How do you go about test automation for apps that require mic access?
Any Idea how to solve this issue?

I already tried to edit the permissions manually by editing the, but I couldn’t do it for the system wide TCC.db (error: attempt to write a readonly database).
If I modify the user TCC.db it has the has the same effect as manually granting access, which does not work for the automated tests.

Any help would be greatly appreciated!