Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

agent-aegis

> AI 编程
Open source

AgentAegis is a lightweight plugin providing full-lifecycle runtime protection for OpenClaw.

190 stars0 likes1 views
WebsiteGitHub

About

AgentAegis is a lightweight plugin providing full-lifecycle runtime protection for OpenClaw.

AgentAegis

English | 简体中文

AgentAegis builds a multi-dimensional, defense-in-depth runtime security architecture for OpenClaw-style agents, implementing five-layer defense across the full lifecycle of LLM agents in various Claw environments — from initialization to execution — covering security and reliability risks in agent execution services, including skill poisoning, memory contamination, intent misalignment, malicious execution, and resource exhaustion. As a lightweight built-in security plugin, AgentAegis proactively triggers defense mechanisms at critical OpenClaw stages to dynamically safeguard agent runtime security. It also provides configurable risk identification and response policies for security operators to flexibly and extensibly address agent runtime threats, as well as sensitive file and skill asset protection for everyday users to safeguard personal privacy and assets.


Architecture

AgentAegis builds a multi-dimensional, defense-in-depth architecture for OpenClaw, forming a complete security closed loop across the full lifecycle from initialization to execution. The system consists of five core defense layers:

  • Foundation Scan Layer — Ensures the trustworthiness of the underlying environment, establishing a solid security foundation from the initialization stage.
  • Perception Input Layer — Strictly filters and audits both internal and external instructions, intercepting malicious injections and high-risk requests.
  • Cognitive State Layer — Monitors the agent's internal state in real time, preventing memory corruption and context contamination.
  • Decision Alignment Layer — Validates intent during the logic generation phase to ensure output decisions align with the user's true intent. Ambiguous instructions require secondary user confirmation to eliminate intent deviation risks.
  • Execution Control Layer — Enforces permission management before final operations, ensuring all instructions execute within controlled security boundaries.

Through this layered, progressive mechanism, AgentAegis ensures that OpenClaw possesses fine-grained risk mitigation capabilities at every critical link in the chain, neutralizing potential threats before they materialize. Furthermore, as a built-in security plugin — unlike passive defense mechanisms such as prompt-based or skill-based defenses — AgentAegis can proactively trigger defense mechanisms at critical OpenClaw stages, dynamically safeguarding runtime security.


Quick Start

1. Clone AgentAegis:

bash
git clone https://github.com/antgroup/agent-aegis

2. Install the plugin:

bash
openclaw plugins install ./agent-aegis

3. (Optional) Enable AgentAegis with observe mode for safe rollout:

json
{
  "allDefensesEnabled": true,
  "defaultBlockingMode": "observe"
}

4. (Optional) Promote high-confidence defenses to enforce as needed:

json
{
  "allDefensesEnabled": true,
  "defaultBlockingMode": "observe",
  "selfProtectionMode": "enforce",
  "commandBlockMode": "enforce",
  "memoryGuardMode": "enforce",
  "exfiltrationGuardMode": "enforce"
}

✨ Features

Runtime Defense

AgentAegis provides a set of built-in runtime defenses that cover the full agent lifecycle. These defenses detect and mitigate threats automatically without requiring additional configuration.

  • Five-Layer Defense-in-Depth — Covers intent scanning, tool call governance, tool result inspection, asset protection, and output safeguarding across nine OpenClaw lifecycle hooks.
  • Skill Poisoning Defense — Scans skill content at startup and continuously, detecting malicious payloads that attempt to bypass approval, disable safety controls, or tamper with protected assets.
  • Memory Contamination Guard — Rejects suspicious or oversized writes to persistent memory stores (memory_store, MEMORY.md, SOUL.md, memory/), preventing persistent prompt poisoning across sessions.
  • Intent & Prompt Safety — Detects jailbreak attempts, secret-exfiltration requests, and plugin-tampering intent in user messages, then injects safety context into prompts to influence subsequent model reasoning.
  • Tool Call Governance — Blocks high-risk shell commands, encoded/obfuscated payloads, write-then-execute chains, repeated mutation loops, and SSRF/exfiltration chains before tool execution.
  • Tool Result Inspection — Treats external tool outputs as untrusted input, scanning for prompt-injection, secret-request, and escalation patterns before they affect the next reasoning step.
  • Output Redaction — Masks API keys, tokens, and similar sensitive values before assistant output is sent or stored.

Advanced Configurable Defense

Beyond the built-in runtime defenses, AgentAegis gives security operators and end users a configurable control surface for advanced risk management and asset protection.

  • Configurable Security Operations — Operators can enable all defenses globally with allDefensesEnabled, set a fleet-wide baseline with defaultBlockingMode, and override individual controls such as selfProtectionMode, commandBlockMode, memoryGuardMode, and exfiltrationGuardMode. Each defense supports enforce, observe, and off modes, enabling staged rollout from monitoring to active blocking. Operators can also define protectedPaths, protectedSkills, and protectedPlugins to match the assets that matter in their environment, and use startupSkillScan to identify risky skills early. Detections are surfaced as runtime observations, blocked actions, and promoted prompt warnings, giving defenders actionable signals for triage and response.
  • Sensitive Files and Skill Asset Protection — Sensitive files and directories can be added to protectedPaths to block or observe unauthorized reads, writes, deletes, and tampering. High-value skills and important plugins can be registered via protectedSkills and protectedPlugins to prevent deletion, overwrite, or patch-based mutation of skill and plugin assets. Self-protection reduces the chance that the agent disables its own defenses or silently rewrites security configuration. For personal users, this means safer handling of private notes, documents, and custom skills; for organizations, it means stronger protection for operational runbooks, audit plugins, and security-critical configuration.

️ Project Structure

…

️ WebUI

AgentAegis includes a standalone Web management panel for visually configuring defense policies, viewing security status, browsing event logs, and managing Skill scans.

Quick Start

After installing the plugin, navigate to the plugin directory and start the WebUI:

bash
# macOS / Linux
cd ~/.openclaw/extensions/agent-aegis/web

# Windows
cd %USERPROFILE%\.openclaw\extensions\agent-aegis\web
bash
npm install
npm run build
npm start

Open http://localhost:3800 to access the management panel.

For development mode with hot-reload:

bash
npm run dev

Security & Access Control

The management API binds to 127.0.0.1 by default (not exposed to the LAN/internet) and only allows same-host browser origins via a CORS allowlist. Every API request (reads and writes) requires a token — only /health is open.

  • Token — at startup a token is auto-generated, printed to the console, and written to AEGIS_CONFIG_DIR/.aegis-webui-token (mode 0600); you can also set your own via AEGIS_TOKEN. Save it.
  • Entering it — the token is never embedded in the page. When you open the WebUI it prompts you to paste the token once (stored in localStorage). Because it is never served in the HTML, an attacker with local code execution (e.g. a prompt-injected agent doing GET /) cannot read it from the page. For extra hardening, place AEGIS_CONFIG_DIR in an agent-aegis-protected path so a local agent cannot read the token file either.
  • Dev mode (npm run dev) auto-injects the token via the Vite proxy, so no manual entry is needed there.
  • Use AEGIS_HOST / --host to change the bind address (pair 0.0.0.0 with AEGIS_TOKEN).

See web/README.md for the full environment-variable reference.

Feature Pages

Dashboard — Defense status overview, 12-defense status matrix, self-integrity status, Trusted Skills count, and recent security events.

Config — Master controls (global toggle + default blocking mode), per-defense cards, Protected Assets tag editor, and Advanced options. Supports dirty-state tracking with Save / Reset to Defaults.

Events — Security event log with filtering by defense type and result (blocked / observed / clear), auto-refreshing every 10 seconds.

Skills — Trusted Skills list (path, hash, size, scan time) with manual removal support.

Configuration Parameters

AgentAegis defense parameters are stored in openclaw.plugin.json under the userConfig field. You can modify them in two ways:

Method 1: Via WebUI (Recommended)

Open the WebUI Config page, toggle switches and select modes visually, then click Save.

Method 2: Via JSON

Edit openclaw.plugin.json directly and add or modify the userConfig field:

json
{
  "userConfig": {
    "allDefensesEnabled": true,
    "defaultBlockingMode": "enforce",
    "selfProtectionEnabled": true,
    "selfProtectionMode": "enforce",
    "commandBlockEnabled": true,
    "commandBlockMode": "enforce",
    "memoryGuardEnabled": true,
    "memoryGuardMode": "observe",
    "protectedPaths": ["/path/to/sensitive/file"],
    "protectedSkills": ["my-important-skill"],
    "protectedPlugins": ["audit-guard"]
  }
}

Parameter Reference:

Parameter Type Default Description
allDefensesEnabled boolean true Master switch for all defenses
defaultBlockingMode off / observe / enforce enforce Default mode for all blocking defenses
selfProtectionEnabled boolean true Protect sensitive paths, skills, and plugins
selfProtectionMode off / observe / enforce enforce Mode for protected-path defenses
commandBlockEnabled boolean true Block high-risk shell commands (e.g., rm -rf /, curl | sh)
commandBlockMode off / observe / enforce enforce Mode for command blocking
encodingGuardEnabled boolean true Detect encoded/obfuscated payloads
encodingGuardMode off / observe / enforce enforce Mode for encoding guard
scriptProvenanceGuardEnabled boolean true Track and block risky scripts written in current run
scriptProvenanceGuardMode off / observe / enforce enforce Mode for script provenance guard
memoryGuardEnabled boolean true Reject suspicious memory writes
memoryGuardMode off / observe / enforce enforce Mode for memory guard
loopGuardEnabled boolean true Stop repeated mutating tool calls
loopGuardMode off / observe / enforce enforce Mode for loop guard
exfiltrationGuardEnabled boolean true Block SSRF/exfiltration chains
exfiltrationGuardMode off / observe / enforce enforce Mode for exfiltration guard
dispatchGuardEnabled boolean true Intercept dangerous messages targeting protected resources
dispatchGuardMode off / observe / enforce enforce Mode for dispatch guard
userRiskScanEnabled boolean true Detect jailbreak and tampering in user messages
skillScanEnabled boolean true Enable skill scanning
toolResultScanEnabled boolean true Scan tool results for injection patterns
outputRedactionEnabled boolean true Mask API keys and tokens in output
promptGuardEnabled boolean true Inject safety reminders into prompts
toolCallEnforcementEnabled boolean `tru

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptagentagent-securityllmopenclaw

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.