ai-runtime-guard

ai-runtime-guard

ai-runtime-guard is an MCP server that sits between your AI agent and your system, enforcing a policy layer before any file or shell action takes effect. No retraining, no prompt engineering, no changes to your agent or workflow, just install, configure once, and your agent operates within the boundaries you set.

Category
访问服务器

README

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 it until it is too late.

ai-runtime-guard is an MCP server that sits between your AI agent and your system, enforcing a policy layer before any file or shell action takes effect. No retraining, no prompt engineering, no changes to your agent or workflow, just install, configure once, and your agent operates within the boundaries you set.

Glama Score

What it does

  1. Blocks dangerous operations: rm -rf, sensitive file access, privilege escalation, and more are denied before execution.
  2. Gates risky commands behind human approval (optional): configurable commands require explicit operator sign-off via a web GUI before the agent can proceed.
  3. Simulates blast radius: wildcard operations like rm *.tmp are evaluated against real files before running, and blocked if they exceed a safe threshold.
  4. Controls network behavior: configure command-level network policy with monitor-only mode, domain allowlist/denylist, and optional unknown-domain blocking.
  5. Supports multi-agent policy isolation: apply per-agent policy overrides keyed by AIRG_AGENT_ID while keeping shared runtime controls.
  6. Backs up before it acts: destructive or overwrite operations create automatic backups with full restore support.
  7. Provides robust logging and reporting: all allowed/blocked actions are logged to activity.log and indexed into reports.db for dashboard/log views.

Current state

  1. Policy management is available in the local GUI (commands, paths, extensions, network, advanced policy).
  2. Agent management is available in the GUI (Settings -> Agents), including profile-based MCP config generation.
  3. Per-agent policy overrides are supported and enforced by AIRG_AGENT_ID.
  4. Full runtime visibility is available through activity.log and reports/dashboard views (reports.db).
  5. Stable release notes are tracked in CHANGELOG.md, with in-progress work in docs/CHANGELOG_DEV.md.

Who it is for

Developers and power users running AI agents (Claude Desktop, Cursor, Codex, or any MCP-compatible client) who want guardrails on what the agent can actually do to their system.

Known boundary

  1. AIRG enforces policy only for actions that pass through AIRG MCP tools.
  2. Native client tools outside MCP (for example Claude Code Glob, Read, Write, Edit, Bash) are outside AIRG enforcement and can bypass workspace/path restrictions.
  3. For AIRG policy boundaries to be effective, operators must disable native shell/file tools in the client using official configuration methods.
  4. Treat this as a deployment requirement, not optional hardening.
  5. For Claude Code, an MCP-only sample skill is provided at docs/mcp-only.md and can be saved to <workspace>/.claude/skills/mcp-only.md.

Design scope

  1. AIRG is designed to reduce accidental damage from AI agent mistakes or hallucinations.
  2. AIRG is not positioned as a full malicious-actor containment system.
  3. Core controls:
    • block high-risk destructive/exfiltration commands and paths
    • enforce workspace boundaries
    • gate mass/wildcard actions with simulation and budget limits
    • optionally require human approval for selected risky actions
    • automatically back up destructive/overwrite targets before applying changes
    • log allowed/blocked actions and operator decisions to an audit trail

How it works

  • Python MCP server with policy-driven enforcement loaded from policy.json
  • Default profile is basic protection: severe actions blocked, everything else allowed
  • Advanced controls available for opt-in: simulation gating, human approval workflows, cumulative budget limits, and shell workspace containment modes (off/monitor/enforce)
  • Local web GUI for policy editing, approval management, and audit log review

Requirements

Python:

  1. Required: Python >=3.10 (project package metadata enforces this).
  2. Recommended on macOS: Python 3.12+ (Homebrew or python.org install).
  3. macOS system Python 3.9 is often too old and may fail dependency install.

How to run

Quick start (package install):

  1. python3 -m venv .venv-airg && source .venv-airg/bin/activate
  2. python -m pip install --upgrade pip
  3. python -m pip install ai-runtime-guard
  4. airg-setup (guided) or airg-setup --defaults --yes (unattended defaults)
  5. airg-doctor

For source-clone setup, TestPyPI flow, and advanced options, see docs/INSTALL.md.

What is optional

  1. Web GUI is optional, but strongly recommended for policy operations, approvals, agent profile management, and reporting.
  2. GUI background service (airg-service) is optional; airg-ui can run manually.
  3. airg-init is optional and low-level; airg-setup is the recommended onboarding path.

Web GUI (optional)

A local web interface is available for:

  1. Policy editing and per-agent overrides.
  2. Approval management.
  3. Agent profile/config management (Settings -> Agents).
  4. Reports dashboard and event log.

Prebuilt UI assets are shipped for normal installs, so no frontend build is required unless you are modifying UI source.

Start it with:

airg-ui

Open http://127.0.0.1:5001

For persistent background run:

airg-service install --workspace /absolute/path/to/airg-workspace
airg-service start

See INSTALL.md for advanced setup, service management, and frontend rebuild instructions.

MCP client configuration (example)

Use generated profile config from GUI Settings -> Agents whenever possible. That view generates client-ready JSON/CLI snippets with your runtime paths, workspace, and agent ID.

If you configure manually, use an absolute server command path (not a bare airg-server unless PATH is guaranteed):

{
  "mcpServers": {
    "ai-runtime-guard": {
      "command": "/absolute/path/to/airg-server",
      "args": [],
      "env": {
        "AIRG_AGENT_ID": "claude-desktop",
        "AIRG_WORKSPACE": "/absolute/path/to/agent-workspace",
        "AIRG_POLICY_PATH": "/absolute/path/to/policy.json",
        "AIRG_APPROVAL_DB_PATH": "/absolute/path/to/approvals.db",
        "AIRG_APPROVAL_HMAC_KEY_PATH": "/absolute/path/to/approvals.db.hmac.key",
        "AIRG_LOG_PATH": "/absolute/path/to/activity.log",
        "AIRG_REPORTS_DB_PATH": "/absolute/path/to/reports.db",
        "AIRG_SERVER_COMMAND": "/absolute/path/to/airg-server"
      }
    }
  }
}

Best practice:

  1. Run airg-setup, then open GUI Settings -> Agents and copy generated config for your profile.
  2. Keep explicit AIRG_* paths in client config so launches are deterministic across restarts.

AIRG_WORKSPACE (important)

AIRG_WORKSPACE is the default project root for agent operations. In unattended defaults mode, AIRG creates/uses ~/airg-workspace unless you set another path.

How it works:

  1. execute_command starts from AIRG_WORKSPACE as its working directory.
  2. File tools (read_file, write_file, delete_file, list_directory) enforce workspace/path policy relative to this root.
  3. Traversal attempts outside this root are blocked by policy checks.

Workspace model:

  1. You can use an existing folder as workspace.
  2. Multiple workspaces are supported.
  3. You can run multiple agents against the same workspace or separate workspaces per agent profile.
  4. Each agent profile should set workspace explicitly in generated MCP config.

Deployment model FAQ

  1. Do I need to run source scripts/setup_runtime_env.sh?
    • If you use packaged flow with airg-setup, no. Setup initializes secure default paths and files.
    • If you run directly from source (PYTHONPATH=src python -m server, PYTHONPATH=src python -m ui.backend_flask), yes, it is recommended.
  2. What folders are involved?
    • Install folder (airg-install): where the code/package lives.
    • Runtime state folder: where policy.json, approvals.db, HMAC key, logs, reports DB, and backups live.
    • Workspace folder (AIRG_WORKSPACE, often airg-workspace): where agent actions are intended to run.
  3. Does the agent only work inside one workspace?
    • By default, yes, it is anchored to AIRG_WORKSPACE.
    • Additional allowed roots can be configured with policy.allowed.paths_whitelist.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选