LibreAI / AI Agents / invariant
// agents · invariantlabs-ai/invariant

invariant

Guardrails for building secure, robust agents.

★ 467 stars⑂ 50 forksApache-2.0updated 2026-01
▦ visual — this project's README ships no embeddable screenshot,
so here's a placeholder. The guide below is complete regardless.
// project facts

Project facts

invariant is an open-source ai agents project by invariantlabs-ai (invariantlabs-ai/invariant on GitHub). It has 467 GitHub stars and 50 forks, is released under the Apache-2.0 license, and was last updated on GitHub on 12 January 2026.

GitHub stars
467
Forks
50
License
Apache-2.0
Last updated on GitHub
12 January 2026
Category
AI Agents
Listing
Full install guide
Official site
Official site
// how it works

How it works

  1. Know your goal

    Be clear about the problem you are solving before installing.

  2. Get the code

    Clone the repository and skim the docs for hardware or key requirements.

  3. Configure it

    Install dependencies, then add API keys, endpoints, or local-model settings.

  4. Take it for a spin

    Launch the example flow and verify the output matches expectations.

// features

Why people love it

Agent guardrails

Constrain agent actions and tool calls.

Security-first

Built to prevent unsafe behavior.

Developer-friendly

Integrates into the dev workflow.

Invariant Labs

From a dedicated agent-security team.

Python-native

Works with Python agent stacks.

Apache-2.0

Permissive licensing.

Advertisement
// run it

Run it yourself

  1. Step 1 — Clone the repo

    Download the source and move into the project folder.

    git clone https://github.com/invariantlabs-ai/invariant.git
    cd invariant
  2. Step 2 — Install

    Set up a virtual environment and install the package.

    python -m venv .venv && source .venv/bin/activate
    pip install -e .
  3. Step 3 — Add guardrails

    Follow the README to guard your first agent.

    # see README for the quickstart
// use cases

What you can build

Advertisement
// faq

Questions, answered

Who maintains Invariant?

It is maintained by Invariant Labs at invariantlabs-ai/invariant, with 50 forks.

Is Invariant free to use?

Yes. It is released under the Apache-2.0 license, which permits commercial use, modification, and redistribution. Read the LICENSE file for the exact terms.

Do I need a paid API to use it?

The library is free; you supply the models and infrastructure.

How does it compare to other guardrail frameworks?

Compare with Microsoft's governance toolkit on guardrail style and policy language.

How do I get started?

Follow the README quickstart to add guardrails to a sample agent.

// keep exploring

Similar tools

AI Agents

agenta

A team workspace for building AI agents together.

★ 4.8k starsNOASSERTION
View guide →
AI Agents

AutoGPT

The open-source platform for building and running autonomous AI agents, hosted or self-hosted

★ 187.5k starsNOASSERTION
View guide →
AI Agents

botpress

Open-source hub of integrations, SDK and CLI for building and deploying GPT/LLM chatbots and agents.

★ 14.9k starsMIT
View guide →
AI Agents

mcp-agent

Simple workflow patterns for building effective agents on MCP.

★ 8.6k starsApache-2.0
View guide →
AI Agents

agent-governance-toolkit

Policy, identity, and sandboxing guardrails for AI agents.

★ 6.4k starsMIT
View guide →
AI Agents

eve

Vercel's open framework for building agents that run anywhere.

★ 5.5k starsApache-2.0
View guide →
// alternatives

Alternatives in AI Agents

The most-starred other AI Agents projects in the LibreAI catalogue — the realistic shortlist if invariant is not the right fit.

Get invariant

Free and open — grab the source, star the repo, and start creating.