Back to skill

Security audit

IronClaw Security Guard

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent security-guard plugin, but it can persist sensitive message and tool contents in a local audit log without redaction.

Review this before installing in environments where prompts, tool parameters, or outgoing messages may contain API keys, private tokens, or sensitive business data. The plugin is not malicious, but its audit log can become a local store of the very secrets it is meant to protect; use a private audit path with restrictive permissions and prefer a version that redacts audit previews centrally before deployment.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
src/tool.ts:65
Finding

Unredacted Sensitive Content Is Persisted in Audit Logs

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (40)

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · README.md (reported line 9)May include surrounding context.

md
# OpenClaw IronClaw Security Guard

Defense-in-depth guardrails for OpenClaw: block dangerous tool calls, detect prompt-injection patterns, redact secrets before outgoing messages, and keep an audit trail.

For Chinese docs, see [README.zh-CN.md](./README.zh-CN.md).

## Why this exists

Open-source and local-model workflows often fail in the same ways:

- destructive shell commands run too early
- sensitive paths or credentials leak into tool calls
- untrusted content tries to override system behavior
- agents forward secrets into chats, webhooks, or third-party tools

`ironclaw-security-guard` adds a lightweight security layer at OpenClaw's plugin hook surface without pretending to be a full sandbox or container runtime.

## What it adds

- dangerous shell command blocking
- sensitive path protection
- prompt-injection pattern detection
- outbound secret leak prevention
- secret redaction before

Instruction Override

High
Category
Prompt Injection
Confidence
90% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · README.md (reported line 13)May include surrounding context.

md
- destructive shell commands run too early
- sensitive paths or credentials leak into tool calls
- untrusted content tries to override system behavior
- agents forward secrets into chats, webhooks, or third-party tools

`ironclaw-security-guard` adds a lightweight security layer at OpenClaw's plugin hook surface without pretending to be a full sandbox or container runtime.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 74)May include surrounding context.

再跑一次手动安全扫描示例:

bash
node --input-type=module -e "import('./src/config.ts').then(async ({ normalizeSecurityConfig }) => { const { createSecurityScanTool } = await import('./src/tool.ts'); const writes = []; const tool = createSecurityScanTool({ config: normalizeSecurityConfig({}), audit: { write: async (event) => writes.push(event) } }); const result = await tool.execute('demo', { toolName: 'shell', content: 'rm -rf /tmp/demo', redactPreview: true }); console.log(result.content[0].text); })"

典型能力

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.zh-CN.md (reported line 51)May include surrounding context.

再跑一次手动安全扫描示例:

bash
node --input-type=module -e "import('./src/config.ts').then(async ({ normalizeSecurityConfig }) => { const { createSecurityScanTool } = await import('./src/tool.ts'); const writes = []; const tool = createSecurityScanTool({ config: normalizeSecurityConfig({}), audit: { write: async (event) => writes.push(event) } }); const result = await tool.execute('demo', { toolName: 'shell', content: 'rm -rf /tmp/demo', redactPreview: true }); console.log(result.content[0].text); })"

典型能力

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · README.md (reported line 79)May include surrounding context.

md
## 典型能力

- 拦截 `rm -rf`、`git reset --hard`、`curl ... | sh` 等危险模式
- 标记 `.env`、SSH key、`.pypirc`、`.npmrc`、云凭据等敏感路径
- 识别 “ignore previous instructions” 这类注入模式
- 在发消息前把敏感 token 替换成 `[REDACTED:...]`

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · README.zh-CN.md (reported line 56)May include surrounding context.

md
## 典型能力

- 拦截 `rm -rf`、`git reset --hard`、`curl ... | sh` 等危险模式
- 标记 `.env`、SSH key、`.pypirc`、`.npmrc`、云凭据等敏感路径
- 识别 “ignore previous instructions” 这类注入模式
- 在发消息前把敏感 token 替换成 `[REDACTED:...]`

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 79)May include surrounding context.

md
## 典型能力

- 拦截 `rm -rf`、`git reset --hard`、`curl ... | sh` 等危险模式
- 标记 `.env`、SSH key、`.pypirc`、`.npmrc`、云凭据等敏感路径
- 识别 “ignore previous instructions” 这类注入模式
- 在发消息前把敏感 token 替换成 `[REDACTED:...]`

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.zh-CN.md (reported line 56)May include surrounding context.

md
## 典型能力

- 拦截 `rm -rf`、`git reset --hard`、`curl ... | sh` 等危险模式
- 标记 `.env`、SSH key、`.pypirc`、`.npmrc`、云凭据等敏感路径
- 识别 “ignore previous instructions” 这类注入模式
- 在发消息前把敏感 token 替换成 `[REDACTED:...]`

Instruction Override

High
Category
Prompt Injection
Confidence
80% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · README.md (reported line 81)May include surrounding context.

md
- 拦截 `rm -rf`、`git reset --hard`、`curl ... | sh` 等危险模式
- 标记 `.env`、SSH key、`.pypirc`、`.npmrc`、云凭据等敏感路径
- 识别 “ignore previous instructions” 这类注入模式
- 在发消息前把敏感 token 替换成 `[REDACTED:...]`
- 可选地只允许访问 allowlist 中的外部 host

Instruction Override

High
Category
Prompt Injection
Confidence
80% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · README.zh-CN.md (reported line 58)May include surrounding context.

md
- 拦截 `rm -rf`、`git reset --hard`、`curl ... | sh` 等危险模式
- 标记 `.env`、SSH key、`.pypirc`、`.npmrc`、云凭据等敏感路径
- 识别 “ignore previous instructions” 这类注入模式
- 在发消息前把敏感 token 替换成 `[REDACTED:...]`
- 可选地只允许访问 allowlist 中的外部 host

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk only exports advisory prompt text; it does not implement enforcement, detection, redaction, or logging. While the guidance text mentions avoiding destructive commands, prompt injection, and secret leakage, it is descriptive/instructional rather than an actual guardrail mechanism. The declared description claims concrete protective capabilities such as blocking commands, detecting injections, redacting secrets, and audit logging, none of which are implemented in this code.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 74)May include surrounding context.

json
{
  "toolName": "bash",
  "content": "rm -rf /Users/dawei/.ssh && cat ~/.pypirc",
  "redactPreview": true
}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.zh-CN.md (reported line 51)May include surrounding context.

json
{
  "toolName": "bash",
  "content": "rm -rf /Users/dawei/.ssh && cat ~/.pypirc",
  "redactPreview": true
}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · examples/manual-scan-example.md (reported line 8)May include surrounding context.

json
{
  "toolName": "bash",
  "content": "rm -rf /Users/dawei/.ssh && cat ~/.pypirc",
  "redactPreview": true
}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · tests/scan.test.ts (reported line 11)May include surrounding context.

ts
```json
{
  "toolName": "bash",
  "content": "rm -rf /Users/dawei/.ssh && cat ~/.pypirc",
  "redactPreview": true
}
```

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · examples/manual-scan-example.md (reported line 8)May include surrounding context.

json
{
  "toolName": "bash",
  "content": "rm -rf /Users/dawei/.ssh && cat ~/.pypirc",
  "redactPreview": true
}

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/config.ts (reported line 22)May include surrounding context.

ts
"\\.ssh(?:/|\\\\)",
  "id_rsa",
  "id_ed25519",
  "/etc/shadow",
  "/etc/sudoers",
  "Library/Keychains",
  "\\.openclaw/openclaw\\.json",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/config.ts (reported line 24)May include surrounding context.

ts
"id_ed25519",
  "/etc/shadow",
  "/etc/sudoers",
  "Library/Keychains",
  "\\.openclaw/openclaw\\.json",
  "\\.git/config",
  "\\.npmrc",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 80)May include surrounding context.

md
"Library/Keychains",
  "\\.openclaw/openclaw\\.json",
  "\\.git/config",
  "\\.npmrc",
  "\\.pypirc",
  "\\.aws/credentials",
];

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.zh-CN.md (reported line 57)May include surrounding context.

md
"Library/Keychains",
  "\\.openclaw/openclaw\\.json",
  "\\.git/config",
  "\\.npmrc",
  "\\.pypirc",
  "\\.aws/credentials",
];

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/config.ts (reported line 27)May include surrounding context.

ts
"Library/Keychains",
  "\\.openclaw/openclaw\\.json",
  "\\.git/config",
  "\\.npmrc",
  "\\.pypirc",
  "\\.aws/credentials",
];

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/config.ts (reported line 29)May include surrounding context.

ts
"\\.git/config",
  "\\.npmrc",
  "\\.pypirc",
  "\\.aws/credentials",
];

const DEFAULT_BLOCKED_COMMAND_PATTERNS = [

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · README.md (reported line 81)May include surrounding context.

md
severity: "high",
  },
  {
    label: "reveal system prompt",
    regex: /\b(reveal|show|print|dump)\s+(the\s+)?(system prompt|developer message|hidden prompt)\b/gi,
    severity: "high",
  },

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/scan.ts (reported line 32)May include surrounding context.

ts
severity: "high",
  },
  {
    label: "reveal system prompt",
    regex: /\b(reveal|show|print|dump)\s+(the\s+)?(system prompt|developer message|hidden prompt)\b/gi,
    severity: "high",
  },

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · tests/scan.test.ts (reported line 33)May include surrounding context.

ts
severity: "high",
  },
  {
    label: "reveal system prompt",
    regex: /\b(reveal|show|print|dump)\s+(the\s+)?(system prompt|developer message|hidden prompt)\b/gi,
    severity: "high",
  },