This repository contains sample store models for OpenFGA.
- Table of Contents
- Sample Store Models
- Creating your store and loading sample data
- OpenFGA models in open source projects
- Modeling Resources
- Modeling ABAC with ReBAC
- Advanced Entitlements
- Banking
- Condition Data Types
- Custom Roles
- Developer Portal
- Entitlements
- Expenses
- GitHub
- Google Drive
- Group Resource Attributes
- IoT
- IP-Based Access
- Modeling Guide
- Modeling Multi-Tenant Role-Based Access Control
- Modular Models
- Role Assignments
- Slack
- Super-Admin
- Temporal Access
This repository includes a copilot-instructions file that can help you author OpenFGA models. It can be used in VS Code or in any AI-assisted IDE. You can also use it as a prompt, or system prompt, in any LLM.
Some prompts you can try:
- Create an OpenFGA authorization model for an insurance company.
- Create an OpenFGA authorization model for B2B SaaS project management system.
- Create an OpenFGA authorization model for (e.g. create a model for Figma).
It will create a model in an .fga
file, and a .fga.yaml
with tuples/tests, and use the CLI to run the tests.
To use it in Visual Studio Code:
- Setup VS Code with Copilot
- Create a new folder, with a .github folder, and copy the copilot-instructions file.
- Open Copilot
- Prompt
Other coding assistants look for other file names (CLAUDE.md, AGENTS.md, Cursor rules).
You can also use the DeepWiki MCP or the Context7 MCP to provide AI agents with OpenFGA context to help you implement OpenFGA using different SDKs.
For modeling assistance, we you use copilot-instructions even if you configure an MCP.
To try this out, you need the following tools installed:
- The
fga
CLI, follow the installation instructions here to get it git
- Clone this repository
git clone https://github.com/openfga/sample-stores.git openfga-sample-stores && cd $_
- Use the
fga
CLI to test the store you choose (e.g.github
,custom-roles
, etc..)
SAMPLE_STORE=github
fga model test --tests "stores/${SAMPLE_STORE}/store.fga.yaml"
- Linux Foundation
- canonical/lxd
- canonical/identity-platform-login-ui
- canonical/jimm
- grafana/grafana
- lxc/incus
- mindersec/minder
- theopenlane/core
- instill-ai/pipeline-backend
- virtool/virtool
- concrete-utopia/utopia
- Cross-Lab-Project/crosslab
- sourcegraph/sourcegraph-public-snapshot
- klothoplatform/infracopilot
- ZEISS/knox
- Lakekeeper
If you are using OpenFGA in your open source project, please let us know by opening a PR to add your model to this list.