# Types of Analysis Custom Analyzers Can Perform in NVIDIA SkillSpector

> Discover the five analysis types custom analyzers perform in NVIDIA SkillSpector including static code matching YARA rule evaluation behavioral AST taint tracking MCP enforcement and LLM reasoning

- Repository: [NVIDIA Corporation/SkillSpector](https://github.com/NVIDIA/SkillSpector)
- Tags: how-to-guide
- Published: 2026-06-14

---

**Custom analyzers in SkillSpector can perform five distinct types of analysis: static code-pattern matching, YARA rule evaluation, behavioral AST and taint tracking, malicious-code-policy (MCP) enforcement, and semantic LLM-driven reasoning.**

NVIDIA SkillSpector provides an extensible framework for analyzing AI skills and codebases through composable analyzer nodes. Understanding the types of analysis custom analyzers perform in SkillSpector helps security teams extend the tool beyond its built-in capabilities. The framework supports everything from regex-based static analysis to LLM-powered semantic review, all registered through a centralized node system in `src/skillspector/nodes/analyzers/`.

## Built-in Analysis Domains

SkillSpector ships with analyzers covering five broad domains. Custom analyzers can implement any of these patterns or combine them.

### Static Code-Pattern Analysis

**Static code-pattern analysis** detects literal keywords or regular-expression patterns known to indicate security vulnerabilities. Built-in analyzers like `static_patterns_prompt_injection`, `static_patterns_data_exfiltration`, and `static_patterns_supply_chain` scan for strings such as prompt-injection payloads, exfiltration URLs, and supply-chain backdoors. These analyzers reside in files like [`src/skillspector/nodes/analyzers/static_patterns_prompt_injection.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/static_patterns_prompt_injection.py) and follow a simple pattern-matching implementation.

### YARA Rule Analysis

**YARA rule analysis** extends pattern matching beyond hard-coded checks by applying user-supplied YARA rules to source files. The `static_yara` analyzer node, implemented in [`src/skillspector/nodes/analyzers/static_yara.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/static_yara.py), enables security teams to write custom signatures for malware-like behaviors or organizational policy violations without modifying the core codebase.

### Behavioral AST and Taint Analysis

**Behavioral analysis** traverses the abstract syntax tree (AST) to locate dangerous API usage and insecure constructs. The `behavioral_ast` analyzer identifies risky code structures, while `behavioral_taint_tracking` follows data-flow to detect potential privilege misuse or data leakage. These analyzers are implemented in [`src/skillspector/nodes/analyzers/behavioral_ast.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/behavioral_ast.py) and [`src/skillspector/nodes/analyzers/behavioral_taint_tracking.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/behavioral_taint_tracking.py), respectively.

### Malicious-Code-Policy (MCP) Checks

**MCP checks** enforce higher-level security policies such as "least privilege" and detection of tool-poisoning techniques. Analyzers like `mcp_least_privilege`, `mcp_tool_poisoning`, and `mcp_rug_pull` evaluate code against organizational policy rules rather than specific code patterns. These implementations reside in [`src/skillspector/nodes/analyzers/mcp_least_privilege.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/mcp_least_privilege.py) and related files.

### Semantic LLM-Driven Analysis

**Semantic analysis** uses large language models to reason about developer intent, narrative consistency, and policy compliance where static patterns fail. Nodes like `semantic_security_discovery`, `semantic_developer_intent`, and `semantic_quality_policy` flag novel attack phrasing, semantic prompt-injection, and mismatches between a skill's manifest and its implementation. These analyzers leverage the shared `LLMAnalyzerBase` class from [`src/skillspector/llm_analyzer_base.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/llm_analyzer_base.py) to handle batch processing and response collection.

## Creating a Custom Analyzer

To add a custom analyzer, create a Python module under `src/skillspector/nodes/analyzers/` that defines a `node` function with the following signature:

```python
def node(state: SkillspectorState) -> AnalyzerNodeResponse:
    ...

```

The function receives a `SkillspectorState` object containing the file cache and configuration, and must return an `AnalyzerNodeResponse` dictionary with a `findings` key. According to the source code in [`src/skillspector/state.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/state.py), these types define the contract between the graph execution engine and individual analyzers.

## Example: Custom SQL Injection Analyzer

The following custom analyzer demonstrates how to implement LLM-driven semantic analysis for detecting SQL injection vulnerabilities:

```python

# src/skillspector/nodes/analyzers/custom_sql_injection.py

from __future__ import annotations
from skillspector.state import AnalyzerNodeResponse, SkillspectorState
from skillspector.logging_config import get_logger

ANALYZER_ID = "custom_sql_injection"
logger = get_logger(__name__)

ANALYZER_PROMPT = """\
You are a security analyst. Scan the supplied Python files for any SQL statements
that are constructed via string concatenation or f-strings, which could lead to
SQL injection. Report the filename and line number for each risky occurrence.
"""

def node(state: SkillspectorState) -> AnalyzerNodeResponse:
    if not state.get("use_llm", True):
        return {"findings": []}
    file_cache = state.get("file_cache") or {}
    if not file_cache:
        return {"findings": []}
    
    # Use the generic LLM analyzer to ask the model to find risky patterns.

    from skillspector.llm_analyzer_base import LLMAnalyzerBase
    analyzer = LLMAnalyzerBase(base_prompt=ANALYZER_PROMPT, model="gpt-4")
    batches = analyzer.get_batches(sorted(file_cache), file_cache)
    results = analyzer.run_batches(batches)
    findings = analyzer.collect_findings(results)
    logger.info("%s: %d findings", ANALYZER_ID, len(findings))
    return {"findings": findings}

```

This example imports `LLMAnalyzerBase` from [`src/skillspector/llm_analyzer_base.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/llm_analyzer_base.py) to handle the LLM interaction, demonstrating how custom analyzers can reuse the same utilities as built-in semantic analyzers.

## Registering Your Analyzer

After creating the module, register the analyzer in [`src/skillspector/nodes/analyzers/__init__.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/__init__.py) by importing the node and adding it to the registry lists:

```python

# src/skillspector/nodes/analyzers/__init__.py

from skillspector.nodes.analyzers.custom_sql_injection import node as custom_sql_injection_node

ANALYZER_NODE_IDS.append("custom_sql_injection")
ANALYZER_NODES["custom_sql_injection"] = custom_sql_injection_node

```

The `ANALYZER_NODE_IDS` list makes the analyzer discoverable by the graph execution engine, while `ANALYZER_NODES` maps the identifier to the callable function. Once registered, the custom analyzer runs automatically alongside built-in analyzers during SkillSpector execution.

## Summary

- **Five analysis types** are available in SkillSpector: static code-pattern, YARA rule, behavioral AST/taint, MCP policy, and semantic LLM-driven analysis.
- **Custom analyzers** implement a standard `node(state: SkillspectorState) -> AnalyzerNodeResponse` interface defined in [`src/skillspector/state.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/state.py).
- **Registration** requires updating `ANALYZER_NODE_IDS` and `ANALYZER_NODES` in [`src/skillspector/nodes/analyzers/__init__.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/__init__.py).
- **LLM capabilities** are accessible through `LLMAnalyzerBase` in [`src/skillspector/llm_analyzer_base.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/llm_analyzer_base.py) for semantic analysis tasks.
- **File locations** follow the convention `src/skillspector/nodes/analyzers/{analyzer_name}.py` for code organization and maintainability.

## Frequently Asked Questions

### What is the required function signature for a SkillSpector custom analyzer?

A custom analyzer must define a `node` function accepting `state: SkillspectorState` and returning `AnalyzerNodeResponse`. The `SkillspectorState` type contains the file cache and runtime configuration, while the response is a dictionary containing a `findings` list. This contract is enforced by the graph execution engine that imports analyzers from [`src/skillspector/nodes/analyzers/__init__.py`](https://github.com/NVIDIA/SkillSpector/blob/main/src/skillspector/nodes/analyzers/__init__.py).

### How do I enable or disable LLM usage in my custom analyzer?

Check the `use_llm` key in the `SkillspectorState` object before invoking LLM-dependent logic. If `state.get("use_llm", True)` returns `False`, return an empty findings list to skip processing. This pattern ensures your analyzer respects the user's runtime configuration for LLM-based analysis.

### Can custom analyzers access the same AST parsing capabilities as built-in behavioral analyzers?

Yes. Custom analyzers can import and utilize the same AST traversal utilities used by [`behavioral_ast.py`](https://github.com/NVIDIA/SkillSpector/blob/main/behavioral_ast.py) and [`behavioral_taint_tracking.py`](https://github.com/NVIDIA/SkillSpector/blob/main/behavioral_taint_tracking.py). Since analyzers run as standard Python modules within the SkillSpector environment, they have access to the full Python standard library and any project-internal utilities for code analysis.

### What is the difference between static pattern analysis and semantic analysis in SkillSpector?

**Static pattern analysis** uses regular expressions and literal string matching to find known-bad code patterns, while **semantic analysis** employs large language models to understand context, intent, and novel variations of attacks. Static analysis is faster and deterministic, whereas semantic analysis can detect sophisticated attacks that lack fixed signatures but require LLM credits and have higher latency.