Matchers

Matcher Reference

We maintain a growing, hand-crafted library of deterministic "Matchers" that cover multiple different execution paths for similar operations, so that agents cannot trivially route around one blocked command. We expose this library to our AI when recommending new guardrails, so that it can readily draw upon robust abstractions rather than re-deriving complicated regular expressions and argument checks.

This library enables us to rapidly provide coverage over rapidly evolving concepts in AI like MCP servers and Skills, while creating guardrails that readily generalize across different agent runtimes.
Deterministic Rules

Rule Matchers

When agents use tools caught by any of these matchers, Stoplight can approve, ask, or deny the operation. Each matcher expands into multiple lower-level matches to allow teams to protect an entire behavior class instead of chasing one tool invocation at a time.

OperationIDDescriptionTarget
File readingfile.readAny attempt to read or view file contentse.g., **/.env*, credentials.json, **/*.pem
File writingfile.writeAny attempt to write or modify file contentse.g., **/config/*, package.json, **/*.yaml
File deletionfile.deleteAny attempt to delete or remove filese.g., **/migrations/*, **/*.log
File creationfile.createAny attempt to create new files or directoriese.g., **/src/**, **/*.config.js
File copyingfile.copyAny attempt to copy files via cp, scp, or rsynce.g., **/.ssh/*, **/secrets/*
File rename / movefile.moveAny attempt to move or rename filese.g., **/config/*, Makefile
File permission changesfile.permissionChanging file permissions, ownership, or access controle.g., **/bin/*, /etc/**
Symlink creationfile.symlinkCreating symbolic links that can bypass path-based guardse.g., **/.env*, **/secrets/*
Sensitive file accessfile.sensitiveAccessing inherently sensitive files like SSH keys, certificates, and credentials
Policies

Policy Triggers

Policies may use trigger matchers as a screening mechanism to determine if an operation should be considered for review by an LLM based, natural language defined rule. Structurally, they are similar to deterministic rules, but the final decision to approve, ask, or deny is made by an LLM based on the operation and the context, not by whether the match is hit.

MatcherKeyDescriptionExample
Command includescommand_containsSubstring match (case-insensitive)rm -rf
Command excludescommand_not_containsNegative substring match--dry-run
Command starts withcommand_starts_withPrefix matchkubectl delete
Command ends withcommand_ends_withSuffix match--force
Command equalscommand_equalsExact matchnpm publish
Command regexcommand_regexRegular expression patternrm\s+-rf\s+/