PolicyCheck — YAML Policy Validator
PolicyCheck is a VS Code extension that validates YAML configuration files in real time using your existing Rego (OPA) policy files.
🚀 Features
- 🧩 Runs Open Policy Agent rules directly inside VS Code
- 🧠 Highlights YAML policy violations inline with red or yellow squiggles
- 📋 Displays rule IDs and messages in the Problems panel
- ⚙️ Detects and loads
.rego policies automatically from your workspace policies/ folder
- 💾 Re-checks automatically when you save or manually via a “PolicyCheck: Validate YAML” command

⚙️ Requirements
- OPA CLI installed and available in your system path
- Rego policies placed under
./policies/ in your workspace (configurable)
- YAML files must follow your organization’s structure conventions
🧰 Extension Settings
This extension contributes the following settings:
Setting |
Description |
Default |
policyChecker.policiesPath |
Path to your folder containing .rego files |
"policies" |
policyChecker.runOnSave |
Run automatically when YAML is saved |
true |
Example .vscode/settings.json :
{
"policyChecker.policiesPath": "policies",
"policyChecker.runOnSave": true
}
| |