<a href="https://validity.readthedocs.io"><img src="https://raw.githubusercontent.com/amyasnikov/validity/master/docs/images/validity_logo.png" alt="Click to view Validity docs"/></a>
<h1>Validity: vendor-agnostic configuration compliance</h1>
<img src="https://github.com/amyasnikov/validity/actions/workflows/ci.yml/badge.svg" alt="CI">
<img src="https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/amyasnikov/9e518ae8babd18b7edd8ee5aad58146b/raw/cov.json" alt="Coverage">
<img src="https://img.shields.io/badge/Python-3.12+-blue.svg" alt="Python version">
<img src="https://img.shields.io/badge/NetBox-4.4|4.5|4.6-blue.svg" alt="NetBox version">
Validity is the NetBox plugin to write "auto tests" for your network devices. You define compliance tests and Validity checks device state or configuration against these tests. The two most obvious use cases for such a functionality include:
Validity usage workflow:
Gather state/config of your devices. Pull it from Git repository or poll the devices directly.
Define serialization method (the way to translate your raw data into JSON-like structure).
Write compliance test as a Python expression, e.g.
device.config["ntp-servers"] == ["1.2.3.4", "5.6.7.8"]
or
device.state.sh_ospf_neighbors["10.1.1.1"]["state"] == "Up"
Validity helps you to concentrate on what really matters - defining the criteria of healthy and valid network and following these criteria.
Validity completely separates compliance test code from all the other things like data collection, parsing and storage. It encourages you to write short, clean and understandable compliance tests together with the mandatory description.
Unlike many other plugins, Validity supports multiple NetBox versions inside one single release.
Validity aims to support the latest 3 major/minor releases of NetBox.
For example, if latest NetBox version is 4.1, then latest Validity is going to support NetBox 4.1, 4.0 and 3.7.
Check out compatibility matrix for the details.
You can download Validity via pip
pip install netbox-validity
After that follow the installation guide to correctly add Validity to your NetBox.
Read the full documentation on validity.readthedocs.io
A short video about first steps with Validity:
Feel free to ask a Question, report an Issue or even make a PR. Read more about contribution in the CONTRIBUTING guide.




$ claude mcp add validity \
-- python -m otcore.mcp_server <graph>