Skip to content
Cisco AI Defense logo
CiscoAI Security

Policy engines — DefenseClaw

Overview

DefenseClaw has three policy surfaces, each serving a different enforcement point:

SurfaceLives inEvaluates atExample decision
Rego modules (OPA)policies/rego/*.regoAdmission, audit, firewall, guardrail hand-off"Block installing a skill whose scanner flagged severity: CRITICAL"
YAML rule packspolicies/guardrail/<profile>/rules/*.yamlGuardrail scanner path"Fire a SEC-AWS-KEY finding on AKIA[0-9A-Z]{16,}"
data.jsonpolicies/rego/data.jsonMerged into every Rego eval"Severity table, trust lists, action mappings"
Rendering diagram…

The Rego engine is embedded for runtime evaluation. The Python defenseclaw policy test command still shells out to the opa binary for unit tests, and live reload is exposed through defenseclaw-gateway policy reload.

When to use which

  • Rego — whenever the decision depends on structured input and you want something auditable, testable, and composable. Admission gates, audit severity routing, firewall egress rules, guardrail action mapping.
  • YAML rule packs — whenever the decision is "does this text match this pattern." Content scanning in the guardrail.
  • data.json — configuration input to Rego, not a policy by itself. Severity mappings, trust lists, org-specific thresholds.

A full enforcement path usually touches all three: a guardrail YAML rule pack fires → the verdict is handed to guardrail.regoguardrail.rego consults data.json for the action map → it returns a decision that the gateway enforces.

Section map

PagePurpose
LifecycleHow policies load, reload, and version
Actions matrixSeverity × direction → action table
Writing RegoAuthoring modules, testing, style
data.jsonStatic input shape and overrides
Scanner policiesRego that gates scanner findings
Testing policiesopa test, in-repo fixtures, CI
Hot reloadSafely swapping policies without restart
ExamplesReal-world recipe gallery

Related