---
name: firebase-rules-security-auditor
description: "Generate and audit Firebase Security Rules for Firestore or Realtime Database. Use when the user wants help with Firebase Rules Security Auditor. Related topics: firebase, security, coding."
---

# Firebase Rules Security Auditor

Generate and audit Firebase Security Rules for Firestore or Realtime Database.

## How to use this skill

1. Ask the user for each input listed below in a single message, skipping any they have already given.
2. Where options are listed, offer them, but accept other answers too.
3. Fill the answers into the prompt template, then follow the completed prompt to produce the result.

## Inputs

- **Firebase Product** (choose one: Firestore, Realtime Database, Cloud Storage)
- **Target Collection/Path** (free text, e.g. "")
- **Describe the data model** (longer free text)
- **Who can Read?** (choose one: Public, Authenticated Users, Only Owner, Admin Only)
- **Who can Write?** (choose one: Authenticated Users, Only Owner, Admin Only, No One)
- **Additional constraints** (choose any: Validate data types, Check string length, Prevent field updates, Require specific fields)
- **Are you using Custom Claims (e.g., admin)?** (choose one: Yes, No)

## Prompt template

## Introduction
Write strict, secure Firebase Security rules for your database schema.

## Database Info
- Firebase Product: {{Firebase Product}}
- Target Collection/Path: {{Target Collection/Path}}
- Describe the data model: {{Describe the data model}}

## Access Requirements
- Who can Read?: {{Who can Read?}}
- Who can Write?: {{Who can Write?}}
- Additional constraints: {{Additional constraints}}
- Are you using Custom Claims (e.g., admin)? {{Are you using Custom Claims (e.g., admin)?}}

---
**Goal**: Output the precise Firebase Security Rules with an explanation of the security logic.

---

Source: [Firebase Rules Security Auditor on PromptBuild](https://promptbuild.io/prompt/UgN3c3lnTqy1ZyLaBQ73/firebase-rules-security-auditor)
