Firebase Admin SDK Permission Error in Studio workspace with AI Prototype. The same codebase works fine with workspace is directly created from same github repo

Hi everyone, I’m experiencing a specific permission issue in Firebase Studio.

Scenario A (Works): When I create a new Firebase Studio workspace directly using a GitHub repo, the server-side createUser function works perfectly. Scenario B (Fails): When I create a new Firebase Studio workspace using the ‘AI Prototype’ feature and then replace that codebase with my same GitHub repo, I get an INSUFFICIENT_PERMISSION error when calling admin.auth().createUser().

Error text - Deletion Failed

Credential implementation provided to initializeApp() via the “credential” property failed to fetch a valid Google OAuth2 access token with the following error: “Error fetching access token: Missing error payload”.

I have already confirmed that, the Project ID matches in both scenario.

Why does the AI Prototype environment block the Admin SDK from recognizing these credentials after a codebase swap, whereas a clean GitHub-linked workspace does not?