MCP security wrapper with policy tiers, approvals, backup, and audit.
Project description
ai-runtime-guard
Your agent can say anything. It can only do what policy allows.
AI agents with filesystem and shell access can delete files, leak credentials, or execute destructive commands, often without the user realizing until it is too late.
Runtime Guard sits between your AI agent and your system, enforcing policy on every file and shell action before it executes. Install once, configure your rules, and your agent operates within the boundaries you set. Works with Claude Code, Claude Desktop, Cursor, Codex, and any MCP-compatible client. No retraining, no prompt engineering, no external account required.
See it in action
agent -> execute_command("rm -rf /tmp/build")
✗ BLOCKED destructive command pattern: rm -rf
matched_rule: destructive_command | decision: blocked
agent -> execute_command("git push --force")
⏸ APPROVAL REQUIRED awaiting operator
token: a4f2b9 | expires: 10min | check GUI to approve
agent -> write_file("README.md", ...)
✓ ALLOWED backup created before write
backup_location: ~/.local/state/airg/backups/2026-03-18
Quick start
pipx install ai-runtime-guard
pipx ensurepath # if airg* commands are not found
# open a new terminal
airg-setup
airg-doctor
After setup, open http://127.0.0.1:5001 and add your first agent from Settings -> Agents.
Alternative install methods (venv, source, CI)
Alternative quick start (venv):
python3 -m venv .venv-airg && source .venv-airg/bin/activatepython -m pip install --upgrade pippython -m pip install ai-runtime-guardairg-setup(guided, recommended: select/create workspace during setup; includes telemetry opt-in prompt, default Yes)airg-doctor- Open GUI
Settings -> Agents, add agents manually, and apply MCP config/hardening from there.
Source-clone path:
git clone --branch main https://github.com/runtimeguard/runtime-guard.gitcd runtime-guardpython3 -m venv .venv-airg && source .venv-airg/bin/activatepython -m pip install --upgrade pippython -m pip install .airg-setupairg-doctor
Unattended automation-only setup (CI/non-interactive):
airg-setup --defaults --yes --workspace /absolute/path/to/workspace
See docs/INSTALL.md for the full install reference.
What it does
Prevention
- Blocks destructive commands (
rm -rf, privilege escalation, sensitive file access) before they run - Auto-backs up any file before destructive or overwrite operations
Control
- Gates risky commands behind explicit human approval via local GUI or API
- Enforces workspace and path boundaries keyed to
AIRG_WORKSPACE - Supports per-agent policy overlays keyed to
AIRG_AGENT_ID - Configurable network policy with allowlists, denylists, and monitor/enforce modes
Visibility
- Logs every allowed, blocked, and pending action to
activity.log - Indexes events into
reports.dbfor a dashboard view of agent behavior
Hardening
- Script Sentinel: detects attempts to launder blocked commands through scripts
- Universal agent hardening: GUI-driven posture enforcement including hooks, sandboxing, and native tool restrictions (support varies by client)
Why MCP
Runtime Guard is built as an MCP server because MCP provides the interception point you need. When your agent issues a tool call, Runtime Guard evaluates it against policy before execution. For clients that support pre-tool hooks (like Claude Code), AIRG can also deny the agent's native file and shell tools, forcing risky operations through the policy layer.
This approach is the closest to kernel-level enforcement without requiring system privileges or modifying your agent, and it works across any MCP-compatible client without per-agent engineering.
Who it is for
Developers and operators running AI agents who want deterministic guardrails on what an agent can actually do to their system, without giving up agent autonomy or rewriting their workflow.
Supported platforms and clients
| Platform | Clients |
|---|---|
| macOS | Claude Code, Claude Desktop, Cursor, Codex |
| Linux | Claude Code, Claude Desktop, Cursor, Codex |
Enforcement depth varies by client. MCP policy enforcement is universal; hook-based native tool restriction and sandboxing depend on what each client exposes.
Scope and boundaries
What AIRG is designed for: reducing accidental damage from agent mistakes, hallucinated commands, and policy-evasion patterns.
What AIRG is not: a full malicious-actor containment platform.
Known enforcement boundary:
- AIRG enforces policy only on actions routed through AIRG MCP tools
- Native client tools outside MCP (e.g. Claude Code's built-in Bash, Glob, Read, Write, Edit) bypass AIRG unless the client is configured to restrict them
- For strict enforcement, use
Settings -> Agentsin the GUI to apply hook-based native tool restrictions where supported
Configuration essentials
AIRG_WORKSPACE
The default project root for guarded agent operations. execute_command runs from this directory, file tools evaluate path policy relative to this root, and traversal outside the root is blocked. Multiple workspaces are supported. Each agent profile should set workspace explicitly in its MCP config.
AIRG_AGENT_ID
The runtime identity key used for activity and report attribution, per-agent policy override resolution, and posture state in Settings -> Agents.
Web GUI
AIRG includes a local web control plane at http://127.0.0.1:5001 for policy editing, approvals, agent profile management, reports, and telemetry control.
Service commands:
airg-service install --workspace /absolute/path/to/airg-workspace
airg-service start | status | stop | restart | uninstall
Telemetry
AIRG supports optional anonymous telemetry to help prioritize improvements. It is opt-in during setup (default: Yes) and can be toggled any time from Policy -> Advanced -> Anonymous telemetry.
- No command text, file contents, paths, prompts, usernames, or machine identifiers are collected
- One aggregate payload per UTC day
- Payload preview available in the GUI before enabling
- Full details in docs/telemetry.md
More
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_runtime_guard-2.2.2.tar.gz.
File metadata
- Download URL: ai_runtime_guard-2.2.2.tar.gz
- Upload date:
- Size: 222.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d006c2d9f95ba9aa3f698835bde5afd3a3b7bbd6aa2e9bc0ead1c882757f6d4e
|
|
| MD5 |
6c041cdd5f5a1e6728d595ab362c9f7c
|
|
| BLAKE2b-256 |
a090cdb917e40d6f24c7290b0cade156ce3612960540317e3189b42485d4498f
|
Provenance
The following attestation bundles were made for ai_runtime_guard-2.2.2.tar.gz:
Publisher:
publish-pypi.yml on runtimeguard/runtime-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_runtime_guard-2.2.2.tar.gz -
Subject digest:
d006c2d9f95ba9aa3f698835bde5afd3a3b7bbd6aa2e9bc0ead1c882757f6d4e - Sigstore transparency entry: 1347883200
- Sigstore integration time:
-
Permalink:
runtimeguard/runtime-guard@56aec9ca0c0f6db10c669c7f49d79a5a53e07023 -
Branch / Tag:
refs/tags/v2.2.2 - Owner: https://github.com/runtimeguard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@56aec9ca0c0f6db10c669c7f49d79a5a53e07023 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_runtime_guard-2.2.2-py3-none-any.whl.
File metadata
- Download URL: ai_runtime_guard-2.2.2-py3-none-any.whl
- Upload date:
- Size: 213.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e450b372d73dd7a0cd9635d0491690c29e37b9eb62e6c1b384aa5e7ec0ca27a
|
|
| MD5 |
f5b1f4ba2f27735243e90e0c83ee3774
|
|
| BLAKE2b-256 |
6255e2f3dcfec0b7e5d57b252d63c7a98662d160f1d1280b00c4721bee58d3d0
|
Provenance
The following attestation bundles were made for ai_runtime_guard-2.2.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on runtimeguard/runtime-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_runtime_guard-2.2.2-py3-none-any.whl -
Subject digest:
1e450b372d73dd7a0cd9635d0491690c29e37b9eb62e6c1b384aa5e7ec0ca27a - Sigstore transparency entry: 1347883240
- Sigstore integration time:
-
Permalink:
runtimeguard/runtime-guard@56aec9ca0c0f6db10c669c7f49d79a5a53e07023 -
Branch / Tag:
refs/tags/v2.2.2 - Owner: https://github.com/runtimeguard
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@56aec9ca0c0f6db10c669c7f49d79a5a53e07023 -
Trigger Event:
push
-
Statement type: