Skip to content
OpenClaw 不踩坑恶意 Skills ,企业需 Skills Registry:Nacos 3.2 发布Know more

AI Publish Pipeline

AI Publish Pipeline Plugin

The AI publish pipeline runs review, scanning, or interception before an AI resource is published. It may approve or reject publication, but it cannot change the resource’s canonical identity, version, or visibility.

Its unified type is ai-pipeline, execution mode is CHAIN, load phase is STANDARD, and the type is non-critical. For each publication, Nacos selects enabled nodes supporting the resource type and runs them serially by getPreferOrder() in ascending order. A rejection stops the remaining nodes and persists the result.

Gate, State, and Loading

These controls have separate owners:

Configuration or stateResponsibility
nacos.plugin.ai-pipeline.enabledDynamic family gate owned by the AI module. When false, type loading is deferred; enabling discovers services, restores state, and applies configuration.
nacos.plugin.ai-pipeline.typeLegacy startup chain composition, used only to initialize implementation state when no persisted state exists.
ai-pipeline:{pipelineId} stateAuthoritative current chain membership. A disabled node remains in inventory but does not run.
nacos.plugin.ai-pipeline.{pipelineId}.{itemKey}Private configuration declared and consumed by the node through PluginConfigSpec.

When the family gate is off or no node matches, publication proceeds without interception. Service instances must remain lightweight and defer CLI, connection, or thread initialization until their first applyConfig.

Built-in Nodes

Nacos bundles two nodes. Both support SKILL, AGENTSPEC, and PROMPT:

pluginIdDefault statePurpose
ai-pipeline:skill-scannerEnabledInvokes the skill-scanner CLI.
ai-pipeline:skill-spectorEnabledInvokes the skill-spector CLI for static and optional LLM risk analysis.

skill-scanner definitions

The canonical prefix is nacos.plugin.ai-pipeline.skill-scanner.:

keyaliasestypedefaultsensitiveeffectMode
orderNoneNUMBER100NoRUNTIME
commandexecutable, pathSTRINGskill-scannerNoRESTART
use-llmuseLlmBOOLEANfalseNoRESTART
llm-api-keyllmApiKeySTRINGemptyYesRESTART
llm-modelllmModelSTRINGemptyNoRESTART
llm-providerllmProviderSTRINGemptyNoRESTART
enable-metaenableMetaBOOLEANfalseNoRESTART

Example:

nacos.plugin.ai-pipeline.enabled=true
nacos.plugin.ai-pipeline.skill-scanner.command=/opt/scanners/skill-scanner
nacos.plugin.ai-pipeline.skill-scanner.use-llm=true
nacos.plugin.ai-pipeline.skill-scanner.llm-api-key=${SKILL_SCANNER_API_KEY}

skill-spector definitions

The canonical prefix is nacos.plugin.ai-pipeline.skill-spector.:

keyaliasestypedefaultsensitiveeffectMode
orderNoneNUMBER90NoRUNTIME
commandexecutable, pathSTRINGskill-spectorNoRESTART
use-llmuseLlmBOOLEANfalseNoRESTART
providerNoneSTRINGemptyNoRESTART
modelNoneSTRINGemptyNoRESTART
api-keyapiKeySTRINGemptyYesRESTART
base-urlbaseUrlSTRINGemptyNoRESTART
log-levellogLevelSTRINGWARNINGNoRESTART
risk-score-thresholdriskScoreThresholdNUMBER50NoRESTART
max-findingsmaxFindingsNUMBER20NoRESTART

risk-score-threshold is clamped to 0..100. max-findings is capped at 100, and zero, negative, or invalid values use the default. Existing process environment variables take precedence over values copied from SkillSpector plugin configuration.

Except for order, both built-in nodes resolve their command and create immutable scan options on first configuration application, so these fields require restart. Sensitive API keys are masked in detail responses. If the command cannot be found, the node remains queryable, but an attempted scan rejects publication with an installation hint.

Develop a Custom Pipeline

Dependency:

<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-ai-plugin</artifactId>
<version>${project.version}</version>
</dependency>

Directly implement com.alibaba.nacos.plugin.ai.pipeline.spi.PublishPipelineService, provide a public no-argument constructor, and register it through:

META-INF/services/com.alibaba.nacos.plugin.ai.pipeline.spi.PublishPipelineService
MethodRequirement
pipelineId()Stable node name used in ai-pipeline:{pipelineId}.
execute(context)Run review and return approval or rejection.
getPreferOrder()Chain order; lower values run first.
pipelineResourceTypes()Supported resource types.
getConfigDefinitions()Declare definitions.
applyConfig(config)Atomically accept the complete effective item map.
getCurrentConfig()Return the accepted snapshot.

The former PublishPipelineServiceBuilder SPI and arbitrary Properties construction path have been removed. Existing plugins must migrate so the service itself implements PluginConfigSpec; replacing only the SPI registration while retaining a builder is insufficient.

Operations Guidance

  • Keep plugin JARs, CLIs, and RESTART configuration identical on all nodes. order can be changed through the unified PUT configuration API at runtime.
  • Set timeouts for external commands and return readable rejection reasons. Do not log full resources or credentials.
  • Use plugin detail to verify effectiveConfig, sources, and the accepted snapshot. Restart every node after changing RESTART fields.
  • Pipeline results are publication governance records; they do not replace authorization, visibility, or content storage.

Related reading: Plugin Operations, Plugin Development, and AI Resource Lifecycle.