permission-denied

what this Firebase error means

How it shows up

FirebaseError: [code=permission-denied]: Missing or insufficient permissions.

What it means

The caller does not have permission to run this read or write. For apps that use the client SDK, that decision comes from the project's Firestore Security Rules.

The usual cause in an AI-built app

The rules let users read only their own documents, but the AI-generated query asks for the whole collection. Security rules are not filters, so the whole query is refused even though some documents would be allowed.

Check this first

Open the Rules tab of Firestore in the Firebase console and compare the rule for this collection with the exact query your code runs, including its where filters.

More Firebase codes