Invariant Guardrails
Rule-based guardrails that sit between an agent and its MCP servers or LLM provider, checking and blocking tool calls and messages.
Tags
Description
Rules use a Python-like matching language that can follow flows between tool calls, e.g. block sending email to an unknown address after reading the inbox. The README still describes running it as an MCP or LLM proxy via Invariant Gateway, but the hosted Explorer (and its hosted Gateway endpoint under explorer.invariantlabs.ai) shut down in January 2026 and now redirect to GitHub; the invariant-proxy repo is just a redirect to invariant-gateway, which has not been pushed since 2025-11-06. Self-hosting is the only option. From Invariant Labs (now part of Snyk), whose docs now sit under mcp-scan. Apache-2.0. Last PyPI release invariant-ai 0.3.5 (Jul 2025); last commit Jan 2026.
Related
- Snyk Agent Scan: Security scanner that discovers agent components on your machine (agents, MCP servers, skills) and scans them for prompt injections and vulnerabilities.
- LlamaFirewall: Meta's open-source guardrail framework for agents that chains scanners for prompt injection, goal hijacking and insecure generated code.
Guides & comparisons
- Runtime guardrails for agents: Guardrails AI, NeMo Guardrails, Invariant and HOL Guard (Comparison): Four open-source guardrail layers compared: where each one sits, what a rule looks like, whether it can check tool calls, which checks need a model, what leaves your machine and how actively each is maintained. All four were installed and run on 2026-11-01.
Sources
- https://github.com/invariantlabs-ai/invariant
- https://invariantlabs.ai
- https://invariantlabs-ai.github.io/docs/mcp-scan/guardrails-reference/
- https://pypi.org/project/invariant-ai/
- https://github.com/invariantlabs-ai/explorer
- https://github.com/invariantlabs-ai/invariant-gateway
Machine-readable
- JSON
- Markdown
- Source file on GitHub (edit via pull request)