# Policy as Code for the Network: Guardrails with Open Policy Agent

DevFeed: [Policy as Code for the Network: Guardrails with Open Policy Agent](<https://devfeed.tech/articles/policy-as-code-for-the-network-guardrails-with-open-policy-agent-100517.md>)

Original publisher: [Read original article](<https://blogs.cisco.com/cisco-devnet/network-guardrails-as-code-opa>)

Author: Lori Jakab

Published: 2026-10-26T14:00:03Z

Content type: article

Language: en

Sources: [Cisco Blogs](<https://devfeed.tech/sources/cisco-blogs.md>)

Topics: [Open Policy Agent](<https://devfeed.tech/topics/open-policy-agent.md>), [policy-as-code](<https://devfeed.tech/topics/policy-as-code.md>), [rego](<https://devfeed.tech/topics/rego.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [ssh](<https://devfeed.tech/topics/ssh.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [automated-remediation](<https://devfeed.tech/tags/automated-remediation.md>), [ci](<https://devfeed.tech/tags/ci.md>), [cisco-devnet](<https://devfeed.tech/tags/cisco-devnet.md>), [cisco-meraki](<https://devfeed.tech/tags/cisco-meraki.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [devnet](<https://devfeed.tech/tags/devnet.md>), [enterprise](<https://devfeed.tech/tags/enterprise.md>), [guardrails](<https://devfeed.tech/tags/guardrails.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ios-xe](<https://devfeed.tech/tags/ios-xe.md>), [network](<https://devfeed.tech/tags/network.md>), [network-automation](<https://devfeed.tech/tags/network-automation.md>), [opa](<https://devfeed.tech/tags/opa.md>), [open-policy-agent](<https://devfeed.tech/tags/open-policy-agent.md>), [policy](<https://devfeed.tech/tags/policy.md>), [policy-as-code](<https://devfeed.tech/tags/policy-as-code.md>), [security](<https://devfeed.tech/tags/security.md>), [security-posture](<https://devfeed.tech/tags/security-posture.md>)

## AI overview

OPA evaluates network configurations provided as JSON against versioned, testable Rego rules and returns structured violations; it does not access or change systems itself. The examples use IOS XE configuration from RESTCONF to flag telnet access and an enabled plain HTTP server, and Meraki SSID data to flag enabled open networks. Per-domain packages handle different configuration models while a shared report combines findings, enabling consistent checks across domains. Teams can test policies with `opa test`, run reports locally, and feed results into CI, tickets, or dashboards. The article suggests starting in report-only mode, then considering automated remediation once confident. Examples use OPA 1.x syntax and do not demonstrate SD-WAN implementation or automated remediation.

## Source excerpt

Learn how to use Open Policy Agent (OPA) to enforce network guardrails as code. Catch insecure configurations before deployment and maintain a unified security posture across your entire enterprise network.