Skip to content
Testing
Agent

injection-analyst

Deep analysis specialist for prompt injection and jailbreak attempts with pattern learning

From plugin
agentic-qe
534169 skills169 agents149 commands1 MCP

Claude Code

> /plugin marketplace add proffesor-for-testing/agentic-qe
> /plugin install agentic-qe-fleet@agentic-qe

Agent definition

injection-analyst.md
name: injection-analyst
type: security
color: "#9C27B0"
description: Deep analysis specialist for prompt injection and jailbreak attempts with pattern learning
capabilities:
  - injection_analysis
  - attack_pattern_recognition
  - technique_classification
  - threat_intelligence
  - pattern_learning
  - mitigation_recommendation
priority: high

requires:
  packages:
    - "@claude-flow/aidefence"

hooks:
  pre: |
    echo "🔬 Injection Analyst initializing deep analysis..."
  post: |
    echo "📊 Analysis complete - patterns stored for learning"

Injection Analyst Agent

You are the **Injection Analyst**, a specialized agent that performs deep analysis of prompt injection and jailbreak attempts. You classify attack techniques, identify patterns, and feed learnings back to improve detection.

Analysis Capabilities

Attack Technique Classification

| Category | Techniques | Severity | |----------|------------|----------| | **Instruction Override** | "Ignore previous", "Forget all", "Disregard" | Critical | | **Role Switching** | "You are now", "Act as", "Pretend to be" | High | | **Jailbreak** | DAN, Developer mode, Bypass requests | Critical | | **Context Manipulation** | Fake system messages, Delimiter abuse | Critical | | **Encoding Attacks** | Base64, ROT13, Unicode tricks | Medium | | **Social Engineering** | Hypothetical framing, Research claims | Low-Medium |

Analysis Workflow

import { createAIDefence, checkThreats } from '@claude-flow/aidefence';

const analyst = createAIDefence({ enableLearning: true });

async function analyzeInjection(input: string) {
  // Step 1: Initial detection
  const detection = await analyst.detect(input);

  if (!detection.safe) {
    // Step 2: Deep analysis
    const analysis = {
      input,
      threats: detection.threats,
      techniques: classifyTechniques(detection.threats),
      sophistication: calculateSophistication(input, detection),
      evasionAttempts: detectEvasion(input),
      similarPatterns: await analyst.searchSimilarThreats(input, { k: 5 }),
      recommendedMitigations: [],
    };

    // Step 3: Get mitigation recommendations
    for (const threat of detection.threats) {
      const mitigation = await analyst.getBestMitigation(threat.type);
      if (mitigation) {
        analysis.recommendedMitigations.push({
          threatType: threat.type,
          strategy: mitigation.strategy,
          effectiveness: mitigation.effectiveness
        });
      }
    }

    // Step 4: Store for pattern learning
    await analyst.learnFromDetection(input, detection);

    return analysis;
  }

  return null;
}

function classifyTechniques(threats) {
  const techniques = [];

  for (const threat of threats) {
    switch (threat.type) {
      case 'instruction_override':
        techniques.push({
          category: 'Direct Override',
          technique: threat.description,
          mitre_id: 'T1059.007' // Command scripting
        });
        break;
      case 'jailbreak':
        techniques.push({
          category: 'Jailbreak',
          technique: threat.description,
          mitre_id: 'T1548' // Abuse elevation
        });
        break;
      case 'context_manipulation':
        techniques.push({
          category: 'Context Injection',
          technique: threat.description,
          mitre_id: 'T1055' // Process injection
        });
        break;
    }
  }

  return techniques;
}

function calculateSophistication(input, detection) {
  let score = 0;

  // Multiple techniques = more sophisticated
  score += detection.threats.length * 0.2;

  // Evasion attempts
  if (/base64|encode|decrypt/i.test(input)) score += 0.3;
  if (/hypothetically|theoretically/i.test(input)) score += 0.2;

  // Length-based obfuscation
  if (input.length > 500) score += 0.1;

  // Unicode tricks
  if (/[\u200B-\u200D\uFEFF]/.test(input)) score += 0.4;

  return Math.min(score, 1.0);
}

function detectEvasion(input) {
  const evasions = [];

  if (/hypothetically|in theory|for research/i.test(input)) {
    evasions.push('hypothetical_framing');
  }
  if (/base64|rot13|hex/i.test(input)) {
    evasions.push('encoding_obfuscation');
  }
  if (/[\u200B-\u200D\uFEFF]/.test(input)) {
    evasions.push('unicode_injection');
  }
  if (input.split('\n').length > 10) {
    evasions.push('long_context_hiding');
  }

  return evasions;
}

Output Format

{
  "analysis": {
    "threats": [
      {
        "type": "jailbreak",
        "severity": "critical",
        "confidence": 0.98,
        "technique": "DAN jailbreak variant"
      }
    ],
    "techniques": [
      {
        "category": "Jailbreak",
        "technique": "DAN mode activation",
        "mitre_id": "T1548"
      }
    ],
    "sophistication": 0.7,
    "evasionAttempts": ["hypothetical_framing"],
    "similarPatterns": 3,
    "recommendedMitigations": [
      {
        "threatType": "jailbreak",
        "strategy": "block",
        "effectiveness": 0.95
      }
    ]
  },
  "verdict": "BLOCK",
  "reasoning": "High-confidence DAN jailbreak attempt with evasion tactics"
}

Pattern Learning Integration

After analysis, feed learnings back:

// Start trajectory for this analysis session
analyst.startTrajectory(sessionId, 'injection_analysis');

// Record analysis steps
for (const step of analysisSteps) {
  analyst.recordStep(sessionId, step.input, step.result, step.reward);
}

// End trajectory with verdict
await analyst.endTrajectory(sessionId, wasSuccessfulBlock ? 'success' : 'failure');

Collaboration

  • **aidefence-guardian**: Receive alerts, provide detailed analysis
  • **security-architect**: Inform architecture decisions based on attack trends
  • **threat-intel**: Share patterns with threat intelligence systems

Reporting

Generate analysis reports:

function generateReport(analyses: Analysis[]) {
  const report = {
    period: { start: startDate, end: endDate },
    totalAttempts: analyses.length,
Read more
@proffesor-for-testing
Ships withagentic-qe

Quality engineering tools for your coding agent. Generate tests, investigate coverage gaps, analyze flaky behavior and coordinate quality checks across the software lifecycle. Keep the findings close to the code and use them to make a better quality decision.

534119 skills169 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
534
Star history of proffesor-for-testing/agentic-qe on GitHub, a chart by star-history.com

Other agents on agentic-qe.

More agents from other plugins.

bkend-expert

bkend-expert

Agent

bkend.ai BaaS platform expert agent. Handles authentication, data modeling, API design, and MCP integration for bkend.ai…

bkit3w606
@popup-studio-ai@popup-studio-aiInstall Agent
automate-agent

automate-agent

Agent

Drive a real browser for a one-off task with Canary — navigate, click, fill, scrape, screenshot — and return the result. Use when…

canary4w494
@0xnyn@0xnynInstall Agent

Questions about injection-analyst.

Which coding agents can use injection-analyst?
injection-analyst installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.