Appium restricting access to android keystore

After a user authenticates in my app, there access token is stored securely so it can be re-used later without having to log in again. I believe it is stored in the android key store. This keystore is inaccessible when the OS considers that the device is insecure or compromised - an example is when the device has no pin or biometric security active.

I need to write some automation to test whether this flow is working correctly. When I run the app manually it works as expected, however when I run the same flow in an automation test through appium, it cannot retrieve the access token. It seems the act of using appium to automate the device is causing the OS to consider the device insecure and refuse access to the keystore. This makes it impossible to run the tests I need to run.

Is this something someone else has encountered? If so, has anyone found a workaround? Do you think this issue is insurmountable with Appium?