Deterministic guardrails

Your AI agent just broke production.
It didn't know.

mati blocks Claude Code and Codex from touching critical files until they've read the rules that protect them, and logs every decision your auditors will ask for.

At a glance
 
Languages
 
Imports resolved
 
Init
 
LLM calls
97% is the average across the 7 benchmarked languages
Enforcement

Hard enforcement,
not suggestions.

mati intercepts the read at the agent's hook. The agent can't touch the file until it has consulted the rule attached to it. No skip path.

01Agent issues a read
02mati denies, rule not yet read
03Agent calls mem_get(path)
04mati allows, context loaded
mati hook·Read request
Agent
~
mati
File
charges.rs
$ Agent issues Read on src/billing/charges.rs
Decision log
0140ALLOWclaude-code · session.rs
0141DENYcodex · charges.rs
How deep it goes

A read gate is the floor,
not the ceiling.

The hook is the lightest touch. When a file or a command is too important to leave to a prompt, mati escalates: a deny, an OS-level seal, a signed policy that governs the whole org.

In the free binary
01
Read gatemati hooks

Deny the read until the agent consults the file's rule. The hook you just watched.

02
Sealmati seal

Set the file to mode 000. Unreadable to every process, not just the agent, until it's consulted.

03
OS sandboxmati sandbox

Compile crown-jewel rules into Seatbelt / bubblewrap deny rules that block the shell and every subprocess it spawns.

04
Path & command guardsmati protect · guard

Gate a sensitive path, or a destructive command like rm or terraform destroy, behind a required consult.

05
Local policy enginemati policy add

Author trigger → required-consult rules, observe them in shadow, then promote to enforce.

On the signed floorENTERPRISE
Signed policy floor

One signed bundle mandates consultation across files, shell commands, and network egress. An unresolvable command fails closed.

Step-up approvals

High-risk actions hold until a licensed human mints a single-use, expiring, signed approval receipt. The agent can't self-approve.

Cumulative-authority envelope

Caps the volume of gated activity per window; a breach contracts authority until a human explicitly resets it.

Fail-closed floor pin

If the signed bundle goes missing, enforcement denies instead of falling open. Retiring the pin is a licensed, logged action.

Attestation suite

An org CA signs per-repo attestations and coverage rollups that flag silent, non-reporting repos. Proofs cross, never your source or logs.

Off-host WORM archive + alerts

Replicate the hash-chained log to a directory or S3 Object-Lock bucket and verify it offline (RFC 3161 / 6962); denials fire to your webhook.

All on-prem, all local CLI. No mati-hosted service, dashboard, or control plane.

What it prevents

The failure mode
is always the same.

Someone changed code they didn't understand, and the one fact that would have stopped them was in Slack, a stale doc, or nobody's head. mati puts that fact in the agent's way.

Scenarios01/ 05
Without mati

Contractor makes a 'minor performance fix' to a data pipeline. No one flags it as HIPAA-covered. Audit exposure 6 months later.

With mati

mati blocks the read. The agent consults the gotcha: 'Every read/write to patient_records must call audit_log::record_phi_access.' The audit trail logs the consultation.

For regulated teams

Built for teams
handling PHI.

mati generates the audit trail your auditors will ask for. Every deny, consultation, and bypass it catches is logged and timestamped, ready to export.

On-premZero network calls · no telemetry
Audit trailHash-chained local log · tamper-evident
Retention365 days · extended on Enterprise
ExportSigned audit report on Enterprise

Local hash-chained logs and signed exports ship today. Off-host WORM evidence archiving is in development.

mati · enforcement audit
Enforcement Audit Report
Signed
Project
acme-health / patient-api
Period
2026-03-24 → 2026-04-24
Hash chain
valid (intact) · head → genesis
Every event cryptographically linked to the previous. Tamper-evident by design.
License
Enterprise · 12-seat
33
Events
7
Denials
9
Allowed
0
Bypasses
✓ Signed·fingerprint a27ea8528f81a45cRSA-2048 · CMS/PKCS#7
Live output

The briefing your agent reads first.

~ mati explain src/billing/charges.rs
 
Purpose
Confidence
Staleness
Blast radius
Cluster
 
● [critical]idempotency-key (confirmed, developer, 0.91)
● [high]zero-amount-validation (confirmed, developer, 0.84)
verifying record00/15sha · a8e4f1c
~ mati diff main
 
● [critical]src/billing/charges.rs 2 gotchas
● [critical]src/data/patient_records.rs 2 gotchas
● [high] src/auth/session.rs 1 gotcha
○ [normal] src/api/handlers.rs documented, no gotchas
○ [normal] src/config/database.rs documented, no gotchas
? [unknown] src/utils/helpers.rs no file record
 
scanning diff00/11branch · main
Import graph

12 languages.
Blast radius needs the graph.

mati resolves imports to build a dependency graph for each file. That graph powers blast radius scoring and staleness propagation. The resolution rate is how much of the graph mati can see. Each rate below is measured against a real open-source project, linked.

Scroll sideways for all columns →
LanguageResolution rateVerified againstEdges
Rust97%ripgrep342
Python100%httpx124
TypeScript97%vitest2,147
Go98%hcl190
Java95%jsoup740
C100%mimalloc129
C++95%nlohmann/json619
Ruby/Rails—structuraldiscourse2,622
Haskell—meaningfulaeson223
Scala—partialzio-json21
JavaScript—sharedvitest—
Elixir—fixtureMix—

97% is the average across the 7 fully benchmarked languages. Rows with a status tag are parsed structurally but not yet measured end-to-end. A missed import is a missed edge in the blast radius.

File-level intelligence

What your agent can't see on its own.

Blast radius

diagram
TIER
— 18 direct— 12 transitive
charges.rs HIGH

Co-change clusters

diagram
billing0.87auth0.74data0.81
3 clusters · 14 files · git co-change

Staleness propagation

diagram
DECAY
sourced1d2d3 excluded
session.rs 0.52 stale
How it compares

Not a memory tool.
Not a linter.

mati answers a different question: has this actor proven they understand what's dangerous about this file, and can we prove it to an auditor?

Scroll sideways for all columns →
CapabilitymatiLintersADRs
Block reads until knowledge consulted●——
Tamper-evident audit trail●——
On-prem, zero network calls●●●
Per-file gotchas with confidence scoring●——
Per-actor enforcement (subagents prove their own knowledge)●——
Works without any LLM calls●●●

Your AI agent just refactored a payment flow and removed the fraud check. With mati, that's blocked by default. The agent can't read the file until it proves it knows about the fraud check.

The problem mati was built to solve
Enterprise

Free for developers.
Paid for compliance teams.

Cloud compliance tools automate paperwork. mati enforces the rules at the code level, before the code ships.

Open source
Free
Apache 2.0 licensed · No telemetry
  • 01Full enforcement engine
  • 02Per-actor enforcement (agents & subagents)
  • 03OS-level file seal & sandbox deny rules
  • 04Path & command guards + local policy engine
  • 0512-language import resolution
  • 06Blast radius & co-change clusters
  • 07Enforcement event recording
  • 08365-day event retention
  • 09Claude Code & Codex support
View on GitHub
Enterprise
SIGNED AUDIT EXPORTON-PREM
Enterprise
For compliance teams at regulated companies
  • 01Signed policy floor: files, commands & egress
  • 02Step-up approvals (human-minted, single-use)
  • 03Attestation suite: org CA + coverage rollups
  • 04Signed audit PDF export
  • 05Cryptographic chain of custody
  • 06Per-actor consultation attribution
  • 07License-verified enforcement reports
  • 08Extended retention controls
  • 09Direct support from the founder

Signed, hash-chained audit export. Every agent decision, tamper-evident.

Design-partner pricing during pilot.
Get a demo
Get started

Running in your repo in 15 minutes.

~ install
# Homebrew (macOS + Linux)
$ brew install ioni-dev/tap/mati

# Cargo (builds from source)
$ cargo install mati

# Cargo (prebuilt binary, no compile)
$ cargo binstall mati
~ quickstart
# Scan your repo (zero AI calls, <1s)
$ mati init --claude

# Import rules you already have (CODEOWNERS, markers)
$ mati suggest

# See what mati knows about a file
$ mati explain src/billing/charges.rs

# Add a gotcha
$ mati gotcha add src/billing/charges.rs \
    -r "Never remove the idempotency_key"
FAQ

What engineers ask us.

What mati does and doesn't do.

What is mati?

mati gives you deterministic guardrails for AI coding agents. It blocks Claude Code from reading or editing critical files, and Codex from patch-editing them, until they've consulted the per-file constraints ("gotchas") that protect them, and records every enforcement decision in a tamper-evident local audit trail. mati runs on-prem with zero network calls and works without any LLM calls.

How does mati stop AI agents from breaking production code?

mati intercepts file reads at the hook level and denies access until the agent consults the verified knowledge record for that file. For example, before editing a payments file the agent must acknowledge a constraint such as keeping an idempotency check that was added after a fraud incident, so it cannot silently remove safeguards.

How does mati enforce beyond blocking a read?

The read gate is the lightest option. mati can also seal a file (chmod 000, unreadable to every process until it is consulted), compile crown-jewel rules into OS-level Seatbelt or bubblewrap sandbox deny rules that block the shell and every subprocess it spawns, and guard a sensitive path or a destructive command like rm or terraform destroy behind a required consult with mati protect and mati guard. You choose how hard each file pushes back.

Can I write rules that trigger on commands, not just files?

Yes. mati policy add authors trigger-then-consult rules that fire on file paths or shell commands, with a shadow mode to observe before you enforce. It is local and needs no license. The org-wide signed policy floor that governs a whole team, across files, commands, and network egress, is the Enterprise layer.

Does mati make LLM calls or send code to the cloud?

No. Everything runs locally. No network calls, no telemetry. That's the point for teams handling HIPAA or other compliance-scoped code.

How is mati different from agent memory, linters, or ADRs?

Memory and ADRs are passive. Nothing stops an agent from ignoring them. mati hard-blocks the read until the agent proves it consulted the rule, produces an audit trail, and scores each gotcha by confidence. Enforcement, not documentation.

Is mati open source, and what does it cost?

Apache 2.0. The enforcement engine, import resolution, and local audit log are free with no feature gates. Paid plans add signed audit export and governance for teams.

Which AI coding agents does mati work with?

mati enforces at the hook level with Claude Code and Codex (mati hooks --claude or --codex), so it intercepts file operations before the agent acts. It also exposes its knowledge to any MCP client via mati serve (MCP over stdio). One honest gap: Claude Code's native read tool is gated, but Codex has no read hook, so mati gates its shell reads and apply_patch edits instead.

What is a "gotcha"?

A gotcha is a confirmed, structured rule attached to a specific file: what an agent must do or avoid there, like "never remove the idempotency key." When an agent touches a file that has a confirmed gotcha, mati's hook surfaces it and can block the operation until it has been consulted.

Do I have to write all the gotchas by hand?

No, and not always by you. On mati init, the Layer 0 scan proposes candidates from your code and git history with zero LLM calls: tree-sitter parsing, the import graph, and co-change clusters. mati suggest imports more from your CODEOWNERS file and inline markers. You can also just tell your agent to capture one as you work ("add a gotcha to charges.rs: never drop the idempotency key") and it records the rule with mati gotcha add. You confirm what matters instead of writing from a blank page, and confirmed gotchas activate hook enforcement.

Does mati enforce subagents, or just the main agent?

Every actor independently. When your agent spawns subagents, each one must consult a file's gotcha before it can read or edit that file. A subagent can't coast on what the main thread already read. On Enterprise, the signed audit attributes each consultation to the actor that made it.