AgentAegis 是一款轻量级插件,为 OpenClaw 提供全生命周期的运行时保护。
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.
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:
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.
1. Clone AgentAegis:
git clone https://github.com/antgroup/agent-aegis2. Install the plugin:
openclaw plugins install ./agent-aegis3. (Optional) Enable AgentAegis with observe mode for safe rollout:
{
"allDefensesEnabled": true,
"defaultBlockingMode": "observe"
}4. (Optional) Promote high-confidence defenses to enforce as needed:
{
"allDefensesEnabled": true,
"defaultBlockingMode": "observe",
"selfProtectionMode": "enforce",
"commandBlockMode": "enforce",
"memoryGuardMode": "enforce",
"exfiltrationGuardMode": "enforce"
}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.
memory_store, MEMORY.md, SOUL.md, memory/), preventing persistent prompt poisoning across sessions.Beyond the built-in runtime defenses, AgentAegis gives security operators and end users a configurable control surface for advanced risk management and asset protection.
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.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.…AgentAegis includes a standalone Web management panel for visually configuring defense policies, viewing security status, browsing event logs, and managing Skill scans.
After installing the plugin, navigate to the plugin directory and start the WebUI:
# macOS / Linux
cd ~/.openclaw/extensions/agent-aegis/web
# Windows
cd %USERPROFILE%\.openclaw\extensions\agent-aegis\webnpm install
npm run build
npm startOpen http://localhost:3800 to access the management panel.
For development mode with hot-reload:
npm run devThe 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.
AEGIS_CONFIG_DIR/.aegis-webui-token (mode 0600); you can also set your own via AEGIS_TOKEN. Save it.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.npm run dev) auto-injects the token via the Vite proxy, so no manual entry is needed there.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.
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.
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:
{
"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,或尚未同步最近议题。