Agentshield security scanner

From Horonomos-laps/Yana-AI · View interactive version

Agentshield security scanner is an AI agent skill from the GitHub repository Horonomos-laps/Yana-AI. AI agent configuration security scanner — 102 rules across secrets, permissions, hooks, MCP servers, and agent definitions. Detects hardcoded secrets, permission misconfigurations, hook injection, MCP vulnerabilities, and prompt injection. Use before deploying any Claude Code/AI agent configuration.

How to use this skill

Skill file

AgentShield Security Scanner

102-rule scanner for Claude Code agent configurations, MCP servers, hooks, and agent definitions. Built at Claude Code Hackathon (Feb 2026).

Trigger phrases: "scan agent config", "agentshield", "audit .claude/", "check MCP security", "hook injection", "agent permission audit", "secrets in config", "agent security scan"


When to Use


5 Detection Categories (102 rules total)

1. Secrets (10 rules)

Detects: Anthropic keys (sk-ant-*), OpenAI (sk-proj-*), GitHub (ghp_*), AWS (AKIA*), Stripe, JWT tokens, private keys, DB connection strings, base64-obfuscated credentials.

# False positive filtering: env var refs ${VAR}, markdown fences, example contexts

2. Permissions (10 rules)

Detects:

3. Hooks (34 rules)

Injection patterns (CRITICAL):

HIGH: reverse shells, SSH key manipulation, credential store access, log tampering

MEDIUM: silent error suppression (2>/dev/null), 3+ chained shell commands, env var mutations

4. MCP Server Security (23 rules)

Risk levels:

Checks:

5. Agent Definitions (25 rules)


CLI Usage

# Install
npm install -g ecc-agentshield

# Scan current project
agentshield scan .

# Output formats
agentshield scan . --format json        # machine-readable
agentshield scan . --format sarif       # GitHub Code Scanning
agentshield scan . --format html        # executive report
agentshield scan . --format markdown    # PR comment

# Auto-fix safe findings
agentshield scan . --fix

# Deep Opus analysis (3-agent attacker/defender/auditor pipeline)
agentshield scan . --opus

# Supply chain verification (MCP package provenance)
agentshield scan . --supply-chain

# Generate secure baseline config
agentshield init

# Continuous monitoring
agentshield watch .

Output Format

{
  "findings": [{
    "id": "HOOK-INJECT-001",
    "severity": "critical",
    "category": "hooks",
    "title": "Shell injection via variable interpolation",
    "file": ".claude/hooks/pre-commit.sh",
    "line": 12,
    "runtimeConfidence": "active-runtime",
    "fix": {
      "description": "Quote the variable",
      "before": "eval $INPUT",
      "after": "eval \"$INPUT\"",
      "auto": false
    }
  }],
  "score": 72,
  "grade": "C",
  "summary": { "critical": 1, "high": 2, "medium": 4, "low": 1 }
}

Score 0–100, grade A–F based on finding counts.


GitHub Actions Integration

- uses: affaan-m/agentshield@v1
  with:
    path: "."
    format: "sarif"
    fail-on-findings: "true"
  permissions:
    contents: read
    security-events: write

YAMTAM Integration

agentshield complements strix-scan.sh:

| Tool | Target | When |

|------|--------|------|

| strix-scan.sh --mode rules | YAMTAM rule files (.ts, .py, *.sh) | Every commit |

| strix-scan.sh --mode experts | Source code vulnerability research | Pre-release |

| agentshield scan . | Claude Code config, hooks, MCP, agents | Before any config change |


Anti-Fake-Pass

❌ Skipping scan "because it's just a config change"
❌ Trusting auto-fix blindly — review before applying
❌ Not running --supply-chain when adding new MCP servers
❌ Ignoring MEDIUM findings — hook chaining can escalate
❌ One-time scan instead of CI gate
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.