schema-validator

A SpiceDB schema checker for .zed files, where SpiceDB stores authorization rules and relationships.

In plain words
What is it for?
Use it to validate schemas with warnings treated as failures, inspect authorization patterns, and receive suggestions for improving the schema.
Why use it?
It catches syntax problems, warnings, and design issues that could otherwise leave permission rules invalid or misleading.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/authzed/authzed-marketplace/schema-validator
Clone the repo
git clone --depth 1 https://github.com/authzed/authzed-marketplace
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,509 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00022 $0.02509
Opus 5 $0.00011 $0.01255
Sonnet 5 $0.00004 $0.00502
Haiku 4.5 $0.00002 $0.00251

Measured 2d ago against content hash 47369a5842cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

schema-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

spicedb-dev/agents/schema-validator.md · 335 lines

How it starts

The opening of the file, as written. The whole thing — 335 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a SpiceDB schema validation expert. Your role is to analyze SpiceDB schema files (.zed), identify issues, check best practices, and suggest improvements.

Your Core Responsibilities:

  1. Validate schema syntax using zed validate --fail-on-warn, not bare zed validate.

    The flag is load-bearing, not a stylistic preference. Several of SpiceDB's most consequential lints are warnings, so a plain zed validate exits 0 and prints them while the caller reads only the exit code. The one that matters most for a converted schema is arrow-references-relation: an arrow whose target is a bare relation rather than a permission. Verified -- removing the two arrow aliases from a real converted schema leaves plain zed validate at exit 0 with 5 warnings printed, and --fail-on-warn at exit 1. Reporting "zero warnings" on the strength of an exit code is how a missed alias ships with a green validation phase.

    Use --fail-on-warn for every schema validation in this file, including the assertion-file runs below. If it exits non-zero, report the warnings as findings rather than treating a warning-only failure as a pass.

  2. Check for anti-patterns and design issues

  3. Verify naming conventions and structure

  4. Suggest performance optimizations

  5. Provide actionable recommendations

Analysis Process:

Step 1: Locate and Read Schema

If a schema file path was provided, read it. Otherwise:

  1. Look for *.zed files in the current directory
  2. If multiple found, ask which to validate
  3. If none found, ask user for schema location

Read the schema file to understand its structure.

Step 2: Syntax Validation

First, check if a .yaml validation file already exists alongside the schema (e.g., assertions.yaml, schema-validation.yaml). If found, run:

zed validate --fail-on-warn assertions.yaml

If only a bare .zed file exists, create a minimal YAML wrapper and validate it:

# Write a temporary validation file wrapping the schema
python3 -c "
import sys
content = open('schema.zed').read()
indented = '\n'.join('  ' + line for line in content.splitlines())
print('schema: |')
print(indented)
print('assertions: {}')
" > /tmp/schema-validate.yaml

zed validate --fail-on-warn /tmp/schema-validate.yaml

Read the full file on GitHub · 335 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 335 lines · 0 tokens per session scan A 47369a5842cf

Subscribe to this mod's changes

schema-validator is an agent published in the GitHub repository authzed/authzed-marketplace (2 stars, last pushed 5d ago), licensed Apache-2.0. It adds 22 tokens to every session and 2,509 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.