Tutorials

Step-by-step guides that build working agents. Start here.

Tutorial 1

File Safety Agent

Sequencing and permanent blocking. The agent must back up before deleting and can never use rm.

Build it →
Tutorial 2

Deployment Agent

Chained dependencies, human approval gates, and session rate limits. A full CI/CD pipeline.

Build it →
Tutorial 3

Discord Bot

Dot notation tool mapping, action-dispatch tools, cycling dependencies, and rate limits.

Build it →
Tutorial 4

DevOps Assistant

Cross-domain composition. One agent, 13 tools, 5 domains, 10 rules — everything composes automatically.

Build it →

Reference

Package documentation and API reference.

@petriflow/rules

Rules Engine

DSL reference, composition model, and internals. Learn how to write safety rules and how they compile to verified Petri nets.

Read docs →
@petriflow/gate

Gate

The core primitive. Framework-agnostic Petri net gating — skill nets, deferred transitions, tool mapping, multi-net composition.

Read docs →
@petriflow/vercel-ai

Vercel AI SDK

Wrap your Vercel AI SDK tools with Petri net gating. One function call instruments every tool with safety checks the model cannot bypass.

Read docs →
@petriflow/claude-code

Claude Code

Hook into Claude Code's tool pipeline. Block Bash, gate file writes, enforce ordering constraints — all via Petri net hooks.

Read docs →