Skip to main content
Glama
infraveilhq

infraveil-guard

Official
by infraveilhq

infraveil-guard

A seatbelt for your AI agent. Put a governed, tamper-evident gate in front of the destructive things an agent can do — rm -rf, DROP TABLE, terraform destroy, git push --force, kubectl delete namespace, DELETE FROM … with no WHERE. The agent proposes; the dangerous ones are blocked until a human approves them out of band; every decision is written to a local hash-chained ledger you can verify.

Offline by design: no account, no network, no telemetry. It runs entirely on your machine. Open your network tab — it talks to nobody.

pip install infraveil-guard

Why

Coding agents (Claude Code, Cursor, and friends) are great until the one time they run rm -rf in the wrong directory, or drop the production database to "fix a migration." You don't want to read every command — you want the catastrophic ones to stop and wait for you. That's all this does, and it does it well.

Related MCP server: Agent File Guardian

Wire it into your agent

Add it as an MCP server. For Claude Code / Cursor / any MCP client:

{
  "mcpServers": {
    "infraveil-guard": {
      "command": "infraveil-guard"
    }
  }
}

Then add one rule to your agent's instructions (CLAUDE.md, system prompt, etc.):

Before running any shell command, SQL statement, or infrastructure/cloud operation, first call guard_action with the exact command. Only proceed if it returns proceed: true. If it returns decision: "blocked", stop and ask me to approve it — I'll give you a one-time code to pass back as approval_code.

That's it. Safe commands sail through (and are logged). Dangerous ones stop.

How approval works (the part that matters)

When the agent hits something dangerous, guard_action returns blocked and an action_id. The agent cannot approve itself — by construction, not by good behavior. You approve in your own terminal:

$ infraveil-guard approvals
1 action(s) blocked, waiting for approval:

  [9b58e9c499b3]  CRITICAL  CRITICAL risk: drop table (+0 more). Irreversible.
            DROP TABLE users;
            approve with:  infraveil-guard approve 9b58e9c499b3

$ infraveil-guard approve 9b58e9c499b3

  Action requesting approval
  id:        9b58e9c499b3
  risk:      CRITICAL  (IRREVERSIBLE)
  why:       CRITICAL risk: drop table. Irreversible.
  command:
    DROP TABLE users;

  Approve this action? [y/N] y

  APPROVED. Give the agent this one-time code:

      8f2510

  It is valid for 15 minutes and works exactly once.

You hand the agent 8f2510; it calls guard_action("DROP TABLE users;", approval_code="8f2510"); the guard checks it, lets it through once, and records the approval. The code is minted only by the human CLI, is single-use, and expires — so an agent can't forge or replay it.

Inspect everything — trust nothing

Every decision (allowed, blocked, approved, denied) is appended to a hash-chained ledger at ~/.infraveil-guard/ledger.jsonl. Editing, deleting, reordering, or inserting any line breaks the chain:

$ infraveil-guard verify
{ "ok": true, "count": 42, "message": "Hash chain verified across 42 entries - no tampering." }

$ infraveil-guard log 10        # the last 10 decisions, raw

It's ~400 lines of plain stdlib Python. Read it. That's the point.

Tools (MCP)

Tool

What it does

guard_action(action, approval_code="")

Gate an action before running it. Returns proceed true/false.

assess_action(action)

Classify blast radius without recording or gating.

verify_ledger()

Verify the tamper-evident ledger's hash chain.

recent_decisions(limit=20)

The most recent decisions, newest first.

Configuration

Env var

Default

Meaning

INFRAVEIL_GUARD_THRESHOLD

high

Gate actions at/above this severity: none|low|medium|high|critical.

INFRAVEIL_GUARD_MODE

enforce

enforce blocks dangerous actions; audit logs everything but never blocks (use it to watch your agent before you trust the gate).

INFRAVEIL_GUARD_HOME

~/.infraveil-guard

Where the ledger and approval queue live.

What this is — and isn't

It is a high-signal classifier + an out-of-band human-approval gate + a tamper-evident local log. It's the smallest honest version of "a human approves before anything irreversible happens."

It is not a sandbox. It works because your agent is told to route actions through guard_action — a cooperative guardrail, not an unbypassable jail. That is a deliberate trade: in exchange you get something you can install in one line, read end to end in an afternoon, and run with no account, no network, and no dependency on anyone else's infrastructure — including ours. Nothing here calls home, checks a license, or needs a server to keep working. It does one job and owns it: stop the catastrophic actions and wait for a human. Yours to fork and run forever.

Part of Infraveil's open-source tools for running backends you own:

  • infraveil-lockin — scan a repo and score how locked in your app is to one cloud provider (npx infraveil-lockin).

  • infraveil — a policy DSL you enforce in CI, plus offline audit-ledger and signature verification.

License

AGPL-3.0-or-later. Use it, fork it, read every line. If you run a modified version as a network service, share your changes. © Infraveil Corporation.

Available Tools

4 tools
assess_actionA

Classify the blast radius of an action WITHOUT recording or gating it. Use this to reason about risk; use guard_action when you actually intend to run it. Returns risk (none/low/medium/high/critical), whether it is reversible, the specific dangerous capabilities found, and a recommendation.

action: the command/SQL/tool call to assess (required).

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavior: it does not record or gate, returns risk level, reversibility, dangerous capabilities, and recommendation. This is comprehensive for an assessment tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with two clear sentences for purpose and usage, followed by a parameter description. Every sentence adds value, and the key information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema, the description already lists the return fields (risk, reversible, dangerous capabilities, recommendation). The description is complete for understanding the tool's input, output, and behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter 'action' is described as 'the command/SQL/tool call to assess (required)', which adds meaning beyond the schema's simple string type. This clarifies what kind of input is expected.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Classify' and the resource 'blast radius of an action'. It explicitly distinguishes from the sibling 'guard_action' by stating 'WITHOUT recording or gating it', making the purpose specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: 'Use this to reason about risk; use guard_action when you actually intend to run it.' This clearly advises when to use this tool versus the alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

guard_actionA

Check an action BEFORE you run it. Pass the exact command, SQL statement, or tool invocation you are about to execute.

Returns JSON with proceed (true/false). If proceed is false and decision is "blocked", the action is dangerous and a human must approve it out of band: tell the user to run infraveil-guard approve <action_id> in their own terminal, then call this tool again with the one-time approval_code they give you. You cannot approve your own action. Every decision is recorded in a local tamper-evident ledger.

action: the exact command/SQL/tool call about to run (required). approval_code: the one-time code a human produced via the CLI (optional).

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYes
approval_codeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses the tool's behavior: it returns proceed true/false, a 'blocked' decision requires human approval via CLI, the agent cannot self-approve, and every decision is recorded in a tamper-evident ledger. Minor omissions include potential error scenarios or side effects beyond logging.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: a lead sentence summarizing purpose, then return format, workflow details, and parameter explanations. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (pre-check with approval workflow), the description covers the core flow and return structure. It lacks details on error handling (e.g., invalid action format) but the output schema likely covers return fields. The description is sufficient for correct tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description adds meaningful semantics for both parameters: 'action' is defined as the exact command/SQL/tool call to check, and 'approval_code' as the one-time code from human CLI approval. This compensates for the schema's lack of description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Check an action BEFORE you run it' and details the return value and workflow, clearly distinguishing it from siblings like assess_action (which likely evaluates risk) and recent_decisions (which lists decisions).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description specifies when to use the tool ('before you run it') and provides a step-by-step workflow for handling blocked actions and approval codes. However, it does not explicitly compare against sibling tools or mention when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

recent_decisionsA

Return the most recent guard decisions from the local ledger (newest first): what was allowed, blocked, or approved, with risk and timestamps.

limit: how many entries to return (1-500, default 20).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It explicitly states it returns decisions 'from the local ledger' (indicating read-only), 'newest first' (ordering), and includes 'risk and timestamps' (fields). It does not mention side effects, auth requirements, or rate limits, but for a read-only list tool, this is sufficient transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with purpose, and no wasted words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity (one optional parameter, no nested objects) and existence of an output schema, the description is complete. It covers purpose, fields, and parameter usage without needing to detail return format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema_description_coverage is 0%, so description must compensate. It explains the 'limit' parameter fully: how many entries to return, valid range (1-500), and default (20). This adds significant meaning beyond the schema's type and default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns 'most recent guard decisions' from the 'local ledger' and specifies the data fields (allowed, blocked, approved, risk, timestamps). It distinguishes itself from siblings like assess_action and guard_action, which perform actions rather than list decisions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives (assess_action, guard_action, verify_ledger). It does not mention limitations, prerequisites, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

verify_ledgerA

Verify the local guard ledger's hash chain - proves no decision has been edited, deleted, reordered, or inserted. Returns ok plus where any tampering was found. This is the 'trust by inspection' check; it reads only local files and trusts nothing remote.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses that it reads only local files, trusts nothing remote, and returns ok plus tampering location. Verification implies read-only; would benefit from explicit side-effect statement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no fluff. First sentence states purpose and proof, second adds context. Perfectly concise and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With output schema present, return values need not be described. No parameters, scope fully explained, behavioral constraints clear. Complete for a verification tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters, so baseline is 4. Description appropriately doesn't add parameter info as none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'verify' and resource 'local guard ledger's hash chain', clearly stating it proves no tampering. It distinguishes from siblings which are about assessment, guarding, and recent decisions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage for local integrity verification ('trust by inspection'), but does not explicitly state when not to use or provide alternatives. No comparison with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.1
    • First observedassess_action
    • First observedguard_action
    • First observedrecent_decisions
    • First observedverify_ledger

TDQS

A4.6/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinct purpose: assess_action for risk assessment without recording, guard_action for pre-execution gating, recent_decisions for history review, and verify_ledger for integrity verification. No overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case: assess_action, guard_action, recent_decisions, verify_ledger. No deviations.

Tool Count5/5

With 4 tools, the set is well-scoped for a security guard/audit domain. Each tool serves a clear function without redundancy or omission.

Completeness5/5

The set covers the full lifecycle: risk assessment (assess_action), action gating (guard_action), audit review (recent_decisions), and integrity verification (verify_ledger). No obvious gaps.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A local-first security gateway and visual dashboard for AI agents that enforces cost caps, blocks prompt injections, and requires approval for dangerous actions.
    2
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides a human-in-the-loop security layer for AI agents by intercepting file operations, explaining them with a local LLM, and enforcing a deterministic policy that requires user approval for risky actions.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    A default-deny SQL firewall sidecar for AI agents that enforces per-agent policies on database queries, provides safe rewrites, and maintains a tamper-evident audit chain.
    AGPL 3.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    A three-stage guardrail agent for LLM-powered coding assistants that reviews proposed actions before execution, blocking destructive commands and maintaining an audit trail.
    3
    MIT