Back to skill

Security audit

agentshield

Security checks for vulnerabilities and agentic risk

Overview

This security-audit skill is mostly purpose-aligned, but it needs Review because the inspected code sends audit identity data during dry-run despite saying no data will be submitted.

Review before installing. Do not rely on --dry-run as a no-network mode in this version; it already contacts the service and sends identity metadata plus a signed challenge. Avoid --yes for production or sensitive agents, and do not set AGENTSHIELD_API to any endpoint you do not control and trust. Treat peer verification as server-backed trust, not fully local cryptographic verification.

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

Warning
Location
initiate_audit.py:654
Finding

Dry-run mode performs remote API submissions despite claiming no data is submitted

Content
View full analysis

Vulnerability Details

File Location: initiate_audit.py, lines 654–695
Vulnerability Type: Privacy-control bypass caused by incorrect dry-run sequencing
Risk Level: Medium

Complete Code Snippet

python
session = client.initiate_audit(
    agent_name=agent_name,
    platform=platform,
    public_key=keys['public_key'],
    agent_version=version
)

audit_id = session.get('audit_id')
challenge = session.get('challenge')

print(f"✓ Audit initiated: {audit_id}")

# Step 3: Complete challenge (using client)
print(f"\n🔑 Authenticating...")
try:
    # Sign challenge locally
    signature = sign_challenge(keys['private_key'], challenge)
    # Submit via client (maintains session)
    auth_result = client.complete_challenge(audit_id, signature)
    print(f"✓ Authentication successful")
except Exception as e:
    print(f"✗ Authentication failed: {e}")
    sys.exit(1)

# Step 4: Run security tests
print(f"\n🧪 Running security tests...")
test_results = run_security_tests(audit_id, system_prompt=args.system_prompt)

# DRY-RUN MODE: Show what would be submitted, then exit
if args.dry_run:
    print("\n" + "="*70)
    print("🔍 DRY RUN MODE - NO DATA WILL BE SUBMITTED")

Technical Analysis

The --dry-run condition is evaluated only after the client initiates and authenticates a remote audit. Before reaching the condition, the program:

  1. Calls client.initiate_audit(), which sends the agent name, platform, optional version, and public key to the configured API.
  2. Receives a remote challenge.
  3. Signs that challenge with the locally stored private key.
  4. Calls client.complete_challenge(), sending the audit identifier and signature to the API.

This conflicts with the displayed claim that no data will be submitted and with the documented purpose of dry-run as a way to inspect the payload before making an API call.

The private key itself is not transmitted, and the detailed security-test results are not submitted on this path. The issue i ...[truncated 1726 chars]

Remediation
View remediation

Remediation Suggestions

  1. Check args.dry_run before creating remote audit state or invoking any network-capable client method.
  2. In dry-run mode, construct a local preview using a placeholder audit identifier and run the local tests without calling initiate_audit() or complete_challenge().
  3. Refactor the workflow into separate local-preview and remote-submission functions so the dry-run path cannot accidentally share network side effects.
  4. Add automated tests that replace the HTTP session with a failing mock and assert that zero requests occur when --dry-run is set.
  5. Update the displayed and documented guarantees if any network connectivity is intentionally retained. If a connectivity check is desired, expose it through a separate, explicitly named option requiring informed user choice.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (107)

Tainted flow: 'status_url' from os.getenv (line 63, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · complete_handshake.py (reported line 64)May include surrounding context.

python
print(f"Agent ID: {agent_id}")

    status_url = f"{API}/api/trust-handshake/status/{args.handshake_id}"
    status_res = requests.get(status_url, timeout=30)
    if status_res.status_code != 200 or not status_res.headers.get("content-type", "").startswith("application/json"):
        print(f"Cannot read handshake status ({status_res.status_code}).")
        print(status_res.text[:300])

Tainted flow: 'API' from os.getenv (line 21, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

This POST sends a signed challenge, handshake ID, and agent ID to a server whose base URL is fully controlled by the AGENTSHIELD_API environment variable. If an attacker can influence that environment variable, they can redirect the trust-handshake flow to an attacker-controlled endpoint and collect authentication material or manipulate trust establishment, expanding the trust boundary beyond the intended service.

Content

Scanner excerpt · complete_handshake.py (reported line 88)May include surrounding context.

python
sys.exit(1)

    signature = base64.b64encode(key.sign(challenge.encode("utf-8"))).decode()
    complete = requests.post(
        f"{API}/api/trust-handshake/complete",
        json={
            "handshake_id": args.handshake_id,

Tainted flow: 'AGENTSHIELD_API' from os.environ.get (line 20, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The code posts audit initiation data, including agent name, platform, version, and public key, to a URL derived from AGENTSHIELD_API without validation. If an attacker can set the environment variable, they can silently redirect the audit workflow to a malicious server and capture identity and attestation-related data.

Content

Scanner excerpt · initiate_audit.py (reported line 422)May include surrounding context.

python
payload["agent_version"] = agent_version
    
    try:
        response = requests.post(
            f"{AGENTSHIELD_API}/api/agent-audit/initiate",
            json=payload,
            timeout=30

Tainted flow: 'AGENTSHIELD_API' from os.environ.get (line 20, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The destination URL is taken from the AGENTSHIELD_API environment variable and used to send the challenge response signature over the network. In an untrusted or adversary-influenced runtime, this allows redirection of authentication material and audit metadata to an attacker-controlled endpoint, undermining the trust model and enabling SSRF-style exfiltration.

Content

Scanner excerpt · initiate_audit.py (reported line 454)May include surrounding context.

python
"challenge_response": signature
    }
    
    response = requests.post(
        f"{AGENTSHIELD_API}/api/agent-audit/challenge",
        json=payload,
        timeout=30

Tainted flow: 'AGENTSHIELD_API' from os.environ.get (line 14, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · verify_peer.py (reported line 99)May include surrounding context.

python
import requests
    
    try:
        response = requests.get(
            f"{AGENTSHIELD_API}/api/verify/{agent_id}",
            timeout=30  # Increased for Heroku cold starts
        )

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · CHANGELOG.md (reported line 123)May include surrounding context.

md
- Lists safe/unsafe use cases
  - 3-second pause for user to read
  - Reference to code-level sanitization (audit_client.py line 108+)
  - Skip warning: Set `AGENTSHIELD_YES_ACKNOWLEDGED=1` env var

### Documentation - ClawHub Scanner Recommendations
- **clawhub.json:**

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
91% confidence
Finding

The changelog documents an environment variable that suppresses the safety warning for --yes, which reduces friction for fully automated operation and weakens the human-in-the-loop safeguard. In a security-audit skill that can submit results to a remote API, bypassing prominent warnings increases the chance users or automation pipelines run high-trust mode without adequate review, especially if later code changes broaden what is transmitted.

Content

Scanner excerpt · CHANGELOG_v1.0.31.md (reported line 155)May include surrounding context.

md
**Skip Warning:** Set `AGENTSHIELD_YES_ACKNOWLEDGED=1` environment variable

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This changelog confirms that the prior implementation violated its own privacy promise by sending unsanitized detailed audit data, including attack payloads, responses, pattern matches, and errors. That kind of leakage can expose sensitive prompts, secrets, internal agent behavior, or exploit traces to a remote service, making it a substantial confidentiality issue.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

The command 'rm -rf ~/.openclaw/workspace/skills/agentshield-audit' is a forceful recursive deletion command presented in installation instructions. Even though the target is scoped, users may execute it without understanding the consequences, and any typo, path confusion, or unexpected symlink behavior could delete more than intended or remove local work irreversibly.

Content

Scanner excerpt · INSTALLATION.md (reported line 242)May include surrounding context.

  1. Remove old version:

    bash
    rm -rf ~/.openclaw/workspace/skills/agentshield-audit
    
  2. Install new version:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

The command 'rm -rf ~/.openclaw/workspace/skills/agentshield-audit' is a forceful recursive deletion command presented in installation instructions. Even though the target is scoped, users may execute it without understanding the consequences, and any typo, path confusion, or unexpected symlink behavior could delete more than intended or remove local work irreversibly.

Content

Scanner excerpt · INSTALLATION.md (reported line 242)May include surrounding context.

  1. Remove old version:

    bash
    rm -rf ~/.openclaw/workspace/skills/agentshield-audit
    
  2. Install new version:

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 3)May include surrounding context.

md
# AgentShield Audit - ClawHub Skill

🔒 **Audit your AI agent's security and obtain verifiable trust certificates for inter-agent communication.**

![AgentShield](https://img.shields.io/badge/AgentShield-Security%20Audit-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![Python](https://img.shields.io/badge/python-3.8+-blue)
![OpenClaw](https://img.shields.io/badge/OpenClaw-✓-brightgreen)
![Hermes](https://img.shields.io/badge/Hermes_Agent-✓-brightgreen)

---

## What is AgentShield?

AgentShield is a **security audit framework** for AI agents. It tests your agent against common attack vectors, generates cryptographic identit

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
90% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

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

md
| Test | Description | Risk Level |
|------|-------------|------------|
| **System Prompt Extraction** | Attempts to extract the agent's system prompt | High |
| **Instruction Override** | Tries to override safety instructions | Critical |
| **Tool Permission Check** | Verifies proper tool access controls | High |
| **Memory Isolation** | Tests for context leakage between sessions | Medium |
| **Secret Leakage** | Scans for exposed API keys, tokens, passwords | Critical |

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 75)May include surrounding context.

md
| Test | Description | Risk Level |
|------|-------------|------------|
| **System Prompt Extraction** | Attempts to extract the agent's system prompt | High |
| **Instruction Override** | Tries to override safety instructions | Critical |
| **Tool Permission Check** | Verifies proper tool access controls | High |
| **Memory Isolation** | Tests for context leakage between sessions | Medium |
| **Secret Leakage** | Scans for exposed API keys, tokens, passwords | Critical |

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If certificate signature verification is stubbed or trust checks rely on an external service without robust local validation, users may falsely trust remote agents or certificates. In the context of a security-verification skill, weak or misleading verification semantics are especially dangerous because they invert trust decisions rather than merely causing functionality bugs.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 4)May include surrounding context.

md
---
name: agentshield
version: 1.5.13
description: Privacy-First security audit with 77 local tests (52 live + 25 static). Works with OpenClaw, Hermes Agent, n8n (auto-detected), LangChain, and any AI agent platform. Ed25519 private keys stay local. All scripts bundled.
triggers: ["audit my agent", "get security certificate", "verify agent", "activate AgentShield", "security audit", "trust handshake", "verify peer agent", "check agent security"]
---

# AgentShield - Trust Infrastructure for AI Agents

**The trust layer for the agent economy. Like SSL/TLS, but for AI agents.**

🔐 **Cryptographic Identity** - Ed25519 signing keys  
🤝 **Trust Handshake Protocol** - Mutual verification before communication  
📋 **Public Trust Registry** - Reputation scores & track records  
✅ **77

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 238)May include surrounding context.

md
| `initiate_audit.py` | Run 77 security tests & get certified |

Static analysis

Detected: suspicious.destructive_delete_command, suspicious.prompt_injection_instructions

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
INSTALLATION.md:242

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
SKILL.md:379