Skip to main content
SpiceDB is an open-source, graph-based authorization system inspired by Google Zanzibar. It provides fine-grained, relationship-based access control for your applications.

Installation and setup

Install the Python SDK:
Optional extras are available for specific framework support:
You also need a running SpiceDB instance. For local development:
Create a SpiceDB schema that defines your authorization model:
Create relationships between users and resources:

Retriever

The SpiceDBRetriever wraps any LangChain retriever with SpiceDB authorization filtering, removing documents the user does not have permission to access.
For a detailed walkthrough, see the SpiceDB Retriever page.

Tools

The SpiceDBPermissionTool and SpiceDBBulkPermissionTool enable agents to check SpiceDB permissions before taking actions.
For a detailed walkthrough, see the SpiceDB Tools page.

Runnables

SpiceDBAuthFilter is an LCEL-compatible Runnable for authorization in chains. SpiceDBAuthLambda is a lightweight wrapper for use with RunnableLambda.

LangGraph nodes

Factory functions and classes for adding authorization as a node in LangGraph workflows: