SuperAPIAI Directory

runtime-guard

github.com · AI agents

Runtime policy enforcement for AI agents that prevents accidental system damage and unauthorized access, with automatic backups before file writes.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Runtime Guard (also known as ai-runtime-guard) is a security tool that provides runtime policy enforcement for AI agents. Its core idea is: agents can express anything, but they can only perform actions allowed by policy. It sits between the AI agent and the system, intercepting policy before every file and shell action is executed, preventing agents from deleting files, leaking credentials, or executing destructive commands due to misoperation, hallucinated commands, or policy evasion.

Main capabilities

  • Block destructive commands before execution, including rm -rf, privilege escalation operations, sensitive file access, and more.
  • Automatically back up files before any destructive or overwrite operation.
  • Require explicit human approval for high-risk commands through a local GUI or API.
  • Enforce workspace and path boundaries, keyed by AIRG_WORKSPACE.
  • Support per-agent (keyed by AIRG_AGENT_ID) policy overrides.
  • Configurable network policy, including allowlists, denylists, and monitor/enforce modes.
  • Log all allowed, blocked, and pending-approval operations to activity.log.
  • Index events into reports.db for dashboards to view agent behavior.
  • Script Sentinel: detect attempts to launder blocked commands through scripts.
  • General agent hardening: GUI-driven posture enforcement, including hooks, sandboxing, and native tool restrictions (support varies by client).

Usage

Runtime Guard is built as an MCP server because MCP provides the required interception points. When an agent initiates a tool call, Runtime Guard evaluates it against policy before execution. For clients that support pre-tool hooks (such as Claude Code), AIRG can also deny the agent's native file and shell tools, forcing high-risk operations through the policy layer.

Installation methods include:

  • Install via pip: python -m pip install ai-runtime-guard, then run airg-setup for guided setup (recommended: select/create a workspace during setup; includes a telemetry opt-in prompt, default Yes). After installation, open http://127.0.0.1:5001,在 Add an agent in Settings -> Agents.
  • Source clone method: git clone --branch main https://github.com/runtimeguard/runtime-guard.git,进入目录后执行 python -m pip install .
  • Unattended automated setup (CI/non-interactive): airg-setup --defaults --yes --workspace /absolute/path/to/workspace

For the complete installation reference, see docs/INSTALL.md.

Configuration highlights

  • AIRG_WORKSPACE: the default protected project root directory. execute_command runs from this directory, file tools evaluate path policy based on this root, and out-of-bounds traversal is blocked. Multiple workspaces are supported, and each agent configuration should explicitly set the workspace in the MCP configuration.
  • AIRG_AGENT_ID: the runtime identity key used for activity and report attribution, per-agent policy override resolution, and posture state in settings.
  • AIRG includes a local web control plane http://127.0.0.1:5001,用于策略编辑、审批、智能体配置管理、报告和遥测控制。

Use Cases

Intended for developers and operators running AI agents who want to set deterministic guardrails on what the agent can actually do to the system, without granting privileges to the system, modifying the agent, or rewriting workflows, and without sacrificing agent autonomy.

Limitations and Boundaries

  • AIRG is designed to reduce accidental damage from agent errors, hallucinated commands, and policy-evasion patterns; it is not a complete malicious-actor containment platform.
  • Known enforcement boundary: AIRG only enforces policy on actions routed through the AIRG MCP tool.
  • Native client tools outside of MCP (such as Claude Code's built-in Bash, Glob, Read, Write, Edit) bypass AIRG unless the client is configured to restrict them.
  • For strict enforcement, hook-based native tool restrictions should be applied in the GUI under Settings -> Agents (where supported).
  • Enforcement depth varies by client: MCP policy enforcement is universal; hook-based native tool restrictions and sandboxing depend on the capabilities each client exposes.
  • For Codex, AIRG supports both user-scope (~/.codex/) and project-scope (<workspace>/.codex/) artifacts. Project-scope enforcement requires trusting the workspace in the user-level ~/.codex/config.toml before Codex will load the project .codex/ files. AIRG writes the Codex tool approval stanza only in the project-scope .codex/config.toml.

Telemetry

AIRG supports optional anonymous telemetry, which is opted in by default when set and can be toggled at any time under Policy -> Advanced -> Anonymous telemetry. It does not collect command text, file contents, paths, prompts, usernames, or machine identifiers; one aggregated payload per UTC day; the payload can be previewed in the GUI before enabling. See docs/telemetry.md for details.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools