agentsclimarketplace

Netbox validation

Skill netboxlabs/skills/skills/netbox-validation

NetBox Validation plugin — declarative policy-based validation of network infrastructure data. Use when working with validation policies, compliance checks, findings, compliance scores, pre-change validation, or agentic safety nets.From its SKILL.md

Install
npx -y skills add netboxlabs/skills --skill netbox-validation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

16.4 KB, as published. Nobody here has run it

NetBox Validation

NetBox Validation continuously validates infrastructure data against declarative policies using three engines — intent (NetBox data), config analysis (rendered configurations), and graph analysis (infrastructure dependencies). It produces per-device results, aggregated findings, and compliance scores.

Your knowledge of NetBox Validation may be outdated. Check names, API fields, policy pack contents, and engine capabilities evolve between releases. Prefer retrieval over pre-trained knowledge.

Retrieval Sources

SourceURL / MethodUse for
Validation docshttps://netboxlabs.com/docs/extensions/validation/Full reference, engines, check catalog
Validation REST APIhttps://netboxlabs.com/docs/extensions/validation/rest-api/Endpoint details
NetBox Platform MCPIf configured — 5 validation toolsRun validation, query compliance, manage policies
NetBox MCP serverIf configured — read-only accessVerify devices, policies, scores

FIRST: Verify Connectivity

Confirm the Validation plugin is installed and your token has access:

curl -s -H "Authorization: Bearer $NETBOX_TOKEN" \
  "$NETBOX_URL/api/plugins/validation/policies/" | python -m json.tool

You should see a paginated list of policies (or empty results). If you get 404, the Validation plugin is not installed. If 403, your token lacks validation permissions.


Core Concepts

Object Hierarchy

Policy (scope + rules + triggers)
  -> Run (execution of a policy against devices)
    -> Results (per-device, per-check pass/fail)
      -> Findings (aggregated failures, actionable items)
        -> Compliance Scores (per-device, per-policy, 0-100%)

Policy

A Validation Policy defines what to check and where. Scope filters: sites, regions, site groups, device roles, platforms, tags. Contains rules and controls engine toggles, triggers, and cron schedule.

Rules

Each rule specifies:

FieldDescription
engineintent, config, or graph
categoryCheck grouping (addressing, redundancy, topology, etc.)
check_nameSpecific check to run (e.g., no_duplicate_ips)
severitycritical, high, medium, low, or info
parametersCheck-specific config (thresholds, patterns, expected values)

Rules can optionally override the policy scope with their own roles and platforms filters.

Three Engines

EngineChecksEvaluatesData SourceKey Strength
Intent42NetBox data relationshipsNetBox ORMFast, no external dependencies
Config35Rendered device configurationsConfig analysis engineStructural analysis, reachability
Graph16Infrastructure dependency graphNetBox ORMBlast radius, failure domains

All three can coexist in a single policy. Config and graph engines are available to Premium tier customers.

Run Statuses

StatusMeaning
pendingCreated, waiting for execution
runningChecks are executing
passedAll checks passed
failedOne or more checks failed
errorEngine error during execution

Result Statuses

Each per-device, per-check result: pass, fail, skip, warning, or error.

Finding Lifecycle

open -> acknowledged -> resolved
                    \-> suppressed
StatusWhen to use
openNew, needs review
acknowledgedReviewed, remediation planned
resolvedFixed and confirmed by passing run
suppressedIntentional exception, risk accepted

Compliance Score

score = passed / (passed + failed + error) x 100

Skipped checks excluded. Scores are per (device, policy, run) and tracked over time.


Quick Reference — Common Workflows

Create and Execute a Run

Creating a run does NOT execute it. Two-step process:

# Step 1: Create the run
RUN=$(curl -s -X POST "$NETBOX_URL/api/plugins/validation/runs/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"policy": 1, "trigger": "manual"}')

RUN_ID=$(echo $RUN | python -c "import sys,json; print(json.load(sys.stdin)['id'])")

# Step 2: Execute it (synchronous — returns when complete)
curl -X POST "$NETBOX_URL/api/plugins/validation/runs/$RUN_ID/execute/" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

The execute endpoint is synchronous — it returns results when the run completes. Do not poll.

Install a Policy Pack

# List available packs
curl "$NETBOX_URL/api/plugins/validation/policy-packs/" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

# Install a pack (creates policy + all rules)
curl -X POST "$NETBOX_URL/api/plugins/validation/policy-packs/addressing-ipam/install/" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

Query Compliance Scores

# Fleet-wide latest scores
curl "$NETBOX_URL/api/plugins/validation/compliance/" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

# Scores for a specific device, newest first
curl "$NETBOX_URL/api/plugins/validation/compliance/?device_id=10&ordering=-measured_at" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

# Scores for a specific policy
curl "$NETBOX_URL/api/plugins/validation/compliance/?policy_id=1" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

Filter Findings

# Open critical findings
curl "$NETBOX_URL/api/plugins/validation/findings/?status=open&severity=critical" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

# Acknowledge a finding
curl -X PATCH "$NETBOX_URL/api/plugins/validation/findings/42/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "acknowledged"}'

Run Against a Branch

curl -X POST "$NETBOX_URL/api/plugins/validation/runs/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"policy": 1, "trigger": "manual", "branch_id": 5}'

The validation engines read rules from main and execute checks in branch context, seeing branch-overlay data.

Targeted Run (Narrow Scope)

# Target specific site(s)
curl -X POST "$NETBOX_URL/api/plugins/validation/runs/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"policy": 1, "trigger": "api", "target_sites": [9]}'

# Validate a single device across all matching policies
curl -X POST "$NETBOX_URL/api/plugins/validation/runs/validate-device/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"device": 101}'

YAML Import/Export

# Export a single policy
curl -X POST "$NETBOX_URL/api/plugins/validation/policies/1/export/" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

# Import a policy from YAML
curl -X POST "$NETBOX_URL/api/plugins/validation/policies/import/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d @my-policy.yaml

Policy Management

Policy Scoping

Policies scope devices via any combination of:

Scope FieldEffect
SitesOnly devices at these sites
RegionsOnly devices at sites in these regions
Site GroupsOnly devices at sites in these groups
Device RolesOnly devices with these roles
PlatformsOnly devices on these platforms
TagsOnly devices with these tags

Scope fields are AND-combined. An empty scope means all active devices.

Engine Toggles

Policy FieldDefaultEffect
enable_config_enginefalseEnable config analysis checks for this policy
enable_graph_enginefalseEnable graph resilience checks for this policy

Intent checks always run. Config and graph checks require their engine to be enabled on the policy AND available at the deployment level.

Policy Packs

Pre-built policy packs provide one-click installation:

  • 14 starter packs — addressing, cabling, data quality, naming, redundancy, security, leaf/spine baselines, config analysis, pre-change, BGP attributes, power/network/full resilience
  • 9 compliance frameworks — CLOS Fabric, TIA-942, NIS2/DORA, NIST 800-53, NERC CIP, PCI-DSS, MANRS, ISO 27001, HIPAA Security Rule (2026)

Installed packs create regular policies and rules. After installation, customize scope, parameters, triggers, and schedule. See references/policy-packs.md.

Clone and Import

# Clone a policy (copies all rules and scoping)
curl -X POST "$NETBOX_URL/api/plugins/validation/policies/1/clone/" \
  -H "Authorization: Bearer $NETBOX_TOKEN"

# Import from YAML
curl -X POST "$NETBOX_URL/api/plugins/validation/policies/import/" \
  -H "Authorization: Bearer $NETBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d @my-policy.yaml

Validation Triggers

Manual

Create a run via API or click "Run Now" in the UI. Two-step: create run, then execute.

Branch Merge

Set trigger_on_branch_merge: true on the policy. Validation runs automatically when a NetBox Branching branch is merged to main. Catches regressions in the merged data.

Change Request Submit

Set trigger_on_cr_submit: true on the policy. Validation runs when a NetBox Changes change request is submitted for review. The run targets the CR's branch, providing pre-merge safety.

Scheduled

Set a cron expression on the policy's schedule field:

ExpressionMeaning
0 2 * * *Daily at 2:00 AM
0 */6 * * *Every 6 hours
0 0 * * 0Weekly on Sunday at midnight

Scheduled runs target main (no branch context).

Run Scoping

All runs support optional target narrowing:

FieldTypeEffect
target_sitesList of site IDsOnly devices at these sites
target_devicesList of device IDsOnly these specific devices
target_tagsList of tag slugsOnly devices with these tags

Target fields AND-combine with the policy scope. They can only narrow, never widen.


Compliance and Findings

Score Calculation

score = passed / (passed + failed + error) x 100

Skipped checks excluded. Scores enable trend tracking, audit reporting, change request gating, and executive dashboards.

Score Dimensions

Compliance scores can be queried by:

  • Device — per-device compliance across policies
  • Policy — per-policy compliance across devices
  • Time — trend over 7d/30d/90d via the compliance dashboard

Finding Aggregation

Findings group related failures into actionable items. For example, if no_duplicate_ips fails for 5 devices, one finding groups all 5. Graph engine findings group by failure point (one finding per power feed or shared failure domain).

Severity Escalation

Graph engine findings automatically escalate severity based on blast radius:

Unprotected DevicesEscalation
1--2No change
3--5medium -> high
6--10high -> critical
10+Always critical

Finding Triage

  1. Filter findings by severity (critical first)
  2. Review detail: affected devices, expected vs. actual, remediation
  3. For graph findings, check blast radius card
  4. Acknowledge findings you plan to fix
  5. Fix the underlying issue in NetBox
  6. Re-run validation to confirm
  7. Mark finding as resolved

Integration Patterns

Pre-Change Validation Pipeline

1. Create Branch          (netbox-branching)
2. Make changes           (normal NetBox API with X-NetBox-Branch header)
3. Submit Change Request  (netbox-changes) -> validation auto-runs
4. Review validation results
5. Approve CR, merge branch
6. Post-merge validation auto-runs (optional)

Set trigger_on_cr_submit: true for pre-merge safety. Set trigger_on_branch_merge: true for post-merge verification.

Branch Context

When running validation against a branch, pass branch_id on the run. The engines read rules from main and execute checks in branch context (seeing proposed additions, modifications, deletions).

Config analysis renders configs from both main and branch for differential analysis (lost reachability, broken BGP sessions, routing regressions).

Agentic Integration via MCP

The NetBox Labs Platform MCP Server provides 5 validation tools:

ToolPurpose
run_validationCreate + execute a run for a policy, optionally targeting a branch or devices
get_compliance_analyticsCompliance scores, trends, score-by-dimension
get_findings_analyticsFindings filtered by severity, status, category, policy
import_validation_policyImport policy from YAML
clone_validation_policyClone policy with all rules and scoping

Agents that prefer direct API access can use the REST endpoints with bearer token authentication.

Agentic Workflow Pattern

Agent creates branch -> makes changes -> runs validation
  Pass -> creates change request for human review
  Fail -> reads findings, self-corrects, re-validates

Validation provides the automated safety net ensuring agents operate within the same policy framework as human engineers.


Anti-Patterns

MistakeWhy It FailsDo This Instead
Create a run and assume it executesCreating a run sets status to pendingPOST to /runs/{id}/execute/ after creation
Omit trigger field when creating runstrigger is requiredSet trigger to "manual", "api", or "schedule"
Use branch integer ID for branch validationbranch_id on run creation expects the branch's integer ID, but X-NetBox-Branch header uses schema_idUse the correct identifier for each context
Install config/graph packs without enabling engineConfig/graph rules produce skip resultsSet enable_config_engine / enable_graph_engine on the policy
Expect target scoping to widen policy scopeTarget fields AND-combine with policy scopeTargets can only narrow — devices outside policy scope are excluded
Poll for run completion after executeExecute is synchronous — returns when doneRead the response directly; no polling needed
Run graph checks with device targeting expecting savingsGraph engine loads all site devices regardlessUse site-scoped runs for graph-heavy policies

API Endpoints Summary

EndpointMethodsPurpose
/policies/GET, POSTList and create policies
/policies/{id}/GET, PUT, PATCH, DELETEManage a policy
/policies/{id}/clone/POSTClone with all rules and scoping
/policies/{id}/export/POSTExport as YAML
/policies/import/POSTImport from YAML
/policies/export-all/POSTExport all policies
/policies/{id}/run-for-site/POSTTargeted run for site(s)
/policies/{id}/run-for-devices/POSTTargeted run for device(s)
/rules/GET, POSTList and create rules
/rules/{id}/GET, PUT, PATCH, DELETEManage a rule
/runs/GET, POSTList and create runs
/runs/{id}/GETRun status and summary
/runs/{id}/execute/POSTExecute a pending run
/runs/validate-device/POSTRun all matching policies for a device
/results/GETResults (filter by run, device, status)
/findings/GET, POSTFindings (filter by run, severity, status)
/findings/{id}/GET, PUT, PATCHUpdate finding status
/compliance/GETCompliance scores (filter by device, policy)
/policy-packs/GETList available policy packs
/policy-packs/{slug}/GETPack details with rule list
/policy-packs/{slug}/install/POSTInstall a pack
/policy-packs/{slug}/uninstall/POSTUninstall a pack

All endpoints under /api/plugins/validation/.


References

ReferenceWhen to Load
references/api-patterns.mdNeed full API examples for policy/run/result lifecycle
references/check-reference.mdNeed check names, parameters, or engine details
references/policy-packs.mdNeed pack catalog, install/customize guidance, framework details

Keep looking

Skills are one crate of 628,853. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.