Skip to content

AI-Infra-Guard: Layer-Paradigm Matching for Full-Stack AI Agent Red Teaming (arXiv:2606.31227)

Density:
๐Ÿ”ฌ Hermes Research Brief (ยง58)
arXiv:2606.31227 arXiv Preprint / Open-Source Systems Framework

Securing the AI Agent: A Unified Framework for Multi-Layer Agent Red Teaming

Authors: Yong Yang, Xing Zheng, Huiyu Wu, Huangsheng Cheng, Xiaorong Shi, Jing Guo, Bo Yang, Yi Zhou, Xiangfan Wu, Zonghao Ying

1

Paper Claims

What the authors claim to have proven or engineered:

  • The attack surface of modern AI agents is stratified across 4 distinct layers (Infrastructure, Protocol/Tools, Agent Behavior, and Model), and no single detection paradigm fits all of them.
  • Formulates the Layer-Paradigm Matching Principle: matching deterministic rules to infrastructure, static AST/dynamic auditing to protocols and skills, agentic red teaming to behavior, and attack operators to models.
  • Implements AI-Infra-Guard, scanning 75+ open-source AI infrastructure components (Ollama, vLLM, Langflow, Open-WebUI) against 1,400+ deterministic vulnerability rules.
  • Provides the first systematic supply-chain auditing engine for Model Context Protocol (MCP) servers and third-party agent skill packages.
2

Experimental Evidence

What was actually demonstrated with observable metrics:

  • Empirical deployment across large-scale open-source and enterprise AI stacks, discovering critical exposures across serving engines and orchestration frameworks.
  • Demonstrates that deterministic rule engines eliminate false positives on infrastructure scanning, whereas LLM-as-a-judge approaches suffer from severe non-determinism and hallucinated CVEs.
  • Validates protocol-level AST parsing to detect hidden shell invocations, network sockets, and unvetted imports in third-party MCP tool packages prior to runtime execution.
3

Limitations & Caveats

What is NOT proven, lab-constrained, or assumed:

  • Dynamic behavioral red-teaming of multi-agent interactions incurs high compute requirements when executing multi-turn adversarial simulations.
  • The 1,400+ infrastructure rules require ongoing community curation to maintain synchronization with newly disclosed CVEs.
  • Does not evaluate kernel-level container breakout exploits or GPU driver firmware vulnerabilities.
4

Hermes Critical Analysis

Objective interpretation deconstructing hype vs reality:

AI-Infra-Guard is the first academic framework that fully validates the architectural doctrine of Hermes Codex: agent security cannot be reduced to prompt engineering. An agent's runtime is anchored in classic software infrastructure (Ollama, vLLM, Langflow) and protocol interfaces (MCP). By matching specific detection paradigms to each stratum, the authors provide the operational blueprint for enterprise AI posture management.

5

Security Implications

Why enterprise security teams must pay attention:

  • Organizations relying solely on LLM guardrails remain completely vulnerable to infrastructure-level CVEs (e.g. Langflow RCE, Ollama API bypass).
  • Third-party MCP servers and 'skills' represent an unmonitored software supply chain vulnerability equivalent to unvetted npm or PyPI packages.
  • Security assessments must bridge classical application security (SAST/DAST) with semantic agentic red-teaming.
6

Operational Recommendations

Actionable controls for CISOs, SOC teams, and AI engineers:

  • Adopt the 4-layer Layer-Paradigm Matching architecture across enterprise AI DevSecOps pipelines.
  • Integrate deterministic CVE scanning for AI serving frameworks (Ollama, Langflow, vLLM) into CI/CD build gates.
  • Mandate static AST auditing and capability manifest verification for all Model Context Protocol (MCP) tools before runtime registration.
  • Conduct multi-turn behavioral red-teaming targeting agent planning divergence and tool parameter boundaries.
HASS

HERMES AGENTIC SECURITY SCORE & RISK: AI-INFRA-GUARD

Target: Full-Stack AI Agent Infrastructure (Serving Engines, MCP Protocol, Skills, Foundation Models)
Confidence: 96%
86 / 100
CRITICAL

Measures specific systemic risk arising from autonomy, tool authority, and cascading execution.

Dimension Breakdown
Autonomy 15 / 20
Tool Access 18 / 20
Privilege 17 / 15
Persistence 14 / 15
External Impact 18 / 15
Propagation 13 / 15
โš–๏ธ Divergence & Operational Rationale

HASS rates full-stack agent infrastructure at 86/100 (CRITICAL). AI-Infra-Guard proves that infrastructure-layer vulnerabilities (Langflow, Ollama) and protocol-layer gaps (MCP) undermine even the most safety-aligned foundation models.

๐Ÿ•ธ๏ธ Knowledge Graph & Related Intelligence

AAP-007: Autonomous Cascading RCEAGENTIC ATTACK_PATTERN

Connected Nodes: 31
Inbound Associations (Incoming)
95% VERY_HIGH
CVE-2026-41264: LangChain / LangGraph Agent Loop RCEVULNERABILITY → leads_to → [This Entity]
94% VERY_HIGH
98% VERY_HIGH
CVE-2025-53773: GitHub Copilot RCE via Settings HijackingVULNERABILITY → leads_to → [This Entity]
96% VERY_HIGH
95% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
CVE-2026-67279: MikroTik RouterOS SSH Rekey Workflow BypassVULNERABILITY → exploits → [This Entity]
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
92% VERY_HIGH
95% VERY_HIGH
95% VERY_HIGH
AgentThreat StudioTOOL → evaluates → [This Entity]
99% VERY_HIGH
Cross-Context Execution Leakage in Speculative Tool-Calling AgentsAUTONOMOUS RESEARCH_FINDING → evaluates → [This Entity]
95% VERY_HIGH

The explosive growth of open-source AI infrastructureโ€”including model serving engines (vLLM, Ollama, TGI), low-code agent builders (Langflow, Flowise), user interfaces (Open-WebUI), and the Model Context Protocol (MCP) ecosystemโ€”has far outpaced the security tooling available to defend it.

Most security teams make one of two critical mistakes:

  1. The Traditional AppSec Fallacy: Applying classical network scanners that lack awareness of AI-specific components, embeddings, and agentic workflows.
  2. The Pure AI Alignment Fallacy: Assuming that safety-tuning the foundation model (RLHF, Llama-Guard) protects the application, ignoring that the underlying server or tool is vulnerable to classical Remote Code Execution (RCE).

In โ€œSecuring the AI Agent: A Unified Framework for Multi-Layer Agent Red Teamingโ€ (arXiv:2606.31227), Yang et al. introduce AI-Infra-Guard and formalize the Layer-Paradigm Matching Principle. Their central thesis is that an AI agent is an interconnected stack of heterogeneous technologies, and no single detection paradigm can secure all layers.


The core architectural contribution of AI-Infra-Guard is stratifying agent security across four layers and matching each layer with its mathematically optimal detection paradigm:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ THE 4-LAYER PARADIGM MATCHING ARCHITECTURE โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Architectural Layer โ”‚ Dominant Vulnerabilities โ”‚ Optimal Detection Paradigmโ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 4. MODEL LAYER โ”‚ Token jailbreaks, safety โ”‚ Automated Jailbreak โ”‚
โ”‚ โ”‚ alignment bypasses โ”‚ Harness (26+ operators) โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 3. AGENT BEHAVIOR โ”‚ Planning drift, goal โ”‚ Multi-Turn Black-Box โ”‚
โ”‚ โ”‚ shadowing, tool divergenceโ”‚ Agentic Red Teaming โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 2. PROTOCOL & TOOLS โ”‚ MCP command injection, โ”‚ Static AST Parsing & โ”‚
โ”‚ (Skills & MCP) โ”‚ unvetted imports, RCE โ”‚ Tool Schema Verification โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 1. INFRASTRUCTURE โ”‚ Exposed APIs, CORS flaws, โ”‚ Deterministic Rule Engine โ”‚
โ”‚ (Serving/Hosting)โ”‚ SSRF, path traversal โ”‚ (75+ targets, 1,400+ rules)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • Why not use LLMs for Layer 1? Using LLM-as-a-judge to inspect whether an Ollama daemon or Langflow instance is vulnerable introduces hallucinations, non-deterministic flakiness, and high compute cost. A deterministic rule engine matching exact versions and HTTP banners provides 100% precision.
  • Why not use Regex for Layer 3? Regular expressions cannot understand multi-step planning or evaluate whether an agentโ€™s Thought: trace diverges from intended business goals. Semantic agentic red-teaming is strictly required.

3. Auditing the Emerging Frontier: MCP & Agent Skill Supply Chains

Section titled โ€œ3. Auditing the Emerging Frontier: MCP & Agent Skill Supply Chainsโ€

While traditional security covers Layer 1 and academic research focuses on Layer 4, AI-Infra-Guard pioneered the first comprehensive security engine for Layer 2: Protocol & Tool Ecosystems.

As demonstrated in recent industry deployments, developers extend agent capabilities by installing third-party skills and connecting to remote Model Context Protocol (MCP) servers. AI-Infra-Guard analyzes this supply chain through:

  1. Static AST Deconstruction: Scans Python and TypeScript skill packages for undeclared subprocess calls (os.system, child_process.exec), raw network sockets (socket.connect, fetch), and dynamic code evaluation (eval, Function).
  2. Schema & Intent Discrepancy Auditing: Compares the human-readable description in tools/list against the actual code executed in tools/call. If a tool advertised as "convert_currency" contains code accessing $HOME/.ssh, the framework flags a high-confidence supply-chain backdoor.
  3. Execution Sandbox Verification: Tests whether MCP servers run within restricted Linux namespaces or expose unprotected local loopback ports vulnerable to DNS rebinding.

The multi-layer vulnerabilities mapped by AI-Infra-Guard directly mirror the critical CVE investigations published on Hermes Codex:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ AI-INFRA-GUARD FINDINGS โ—„โ”€โ”€โ–บ HERMES CVE INTELLIGENCE โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Architectural Stratum โ”‚ Hermes CVE / Dossier โ”‚ Root Cause Vulnerability โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Layer 1: Infra (Ollama)โ”‚ CVE-2024-28224 โ”‚ Daemon API bypass via DNS โ”‚
โ”‚ โ”‚ โ”‚ rebinding on 127.0.0.1 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Layer 1: Infra (Langfl)โ”‚ CVE-2024-37014 โ”‚ Custom component executionโ”‚
โ”‚ โ”‚ CVE-2025-34291 โ”‚ CORS / SameSite=None RCE โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Layer 2: Protocol (MCP)โ”‚ CVE-2025-49596 (MCP) โ”‚ 0.0.0.0-day local proxy โ”‚
โ”‚ โ”‚ CVE-2025-6514 (Remote) โ”‚ OS command injection โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Layer 3: Agentic Plan โ”‚ AAP-007 โ”‚ Autonomous cascading RCE โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • CVE-2024-28224 (Ollama DNS Rebinding): Layer 1 vulnerability where the local model server fails to validate Host headers.
  • CVE-2024-37014 & CVE-2025-34291 (Langflow RCEs): Layer 1 & 2 vulnerabilities where web orchestration engines allow unauthenticated remote code execution.
  • CVE-2025-49596 (Anthropic MCP Inspector RCE) & CVE-2025-6514 (mcp-remote Proxy RCE): Landmark Layer 2 protocol vulnerabilities allowing arbitrary command injection through MCP endpoints.

To deploy Layer-Paradigm Matching across corporate AI infrastructure, security teams should align their DevSecOps pipelines with the Hermes AI Agent Security Standard (HASS-1.0):

  1. Automated Infrastructure CVE Auditing (Layer 1)
    Deploy CI/CD scanners that inspect Dockerfiles and Kubernetes manifests hosting Ollama, vLLM, Langflow, and Triton against deterministic vulnerability databases.

  2. Pre-Registration MCP Tool Verification (Layer 2)
    Implement an admission controller for Model Context Protocol servers. Every MCP server definition must pass static AST inspection before an agent is permitted to register its tools.

  3. Multi-Turn Behavioral Canary Probing (Layer 3)
    Continuously test agent workflows against adversarial goal-shadowing prompts to detect if planning logic deviates under multi-step pressure.

  4. Forensic Telemetry & Incident Playbooks
    Export all agent tool executions, prompt tokens, and system calls to enterprise SIEM platforms, triggering automated response workflows via the Hermes SOAR Playbook Generator.