Skip to main content
Glama

Rego security audit

rego_security_audit

Audit Rego policy directories in bulk by running Regal bug and custom security rules, then report high/medium findings with remediation guidance and rule links.

Instructions

Run regal lint restricted to its bugs category plus any custom rules placed in a security category, across one or more policy directories, and return the findings grouped by severity (high/medium) with remediation guidance and a link to each rule. Use it for a periodic fleet-wide sweep rather than per-file style review. Modules that do not parse are listed in unparseable and the rest are audited. These are lint findings: a policy with none can still let a request through, so probe it with rego_eval inputs (absent, null and wrong-typed fields) for that. Requires regal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesPolicy directories or files to audit. Each must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). Pass the root of your policy fleet to scan everything at once.
configFileNoPath to a Regal config file. Useful when your repo has custom rule configuration.
ignoreFilesNoGlob patterns to exclude from the audit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.13

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses behavior beyond the annotations: the external dependency ('Requires regal'), handling of non-parsing modules via `unparseable`, output grouping by severity, and an important limitation caveat that clean lint findings do not guarantee a policy denies requests. With annotations only marking it openWorld and non-read-only, this added operational and epistemic context is valuable. Note the readOnlyHint=false annotation is arguably odd for an audit tool, but the description makes no contradicting read-only claim.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Information-dense and front-loaded, leading with what runs and what it returns before the usage guidance and the caveat. Slightly long with several clauses, but each sentence carries distinct, non-redundant content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema present, the description compensates by describing the return structure (severity grouping, remediation guidance, rule links, `unparseable` list), and it covers the external dependency and the tool's scope limits. An agent has everything needed to select and call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents `paths`, `configFile`, and `ignoreFiles` thoroughly, including the allowed-root constraint. The description only restates that paths may be multiple directories; it adds no syntax or semantics beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action (run regal lint restricted to the `bugs` category plus custom `security` category) over a specific resource (policy directories), and describes the return shape (findings grouped by high/medium severity with remediation links). It also differentiates itself from sibling linting tools by scoping to security-relevant categories rather than general style review.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly frames the intended use as a fleet-wide sweep 'rather than per-file style review,' giving both a when-to-use and an implicit when-not-to-use, and routes the agent to `rego_eval` for the gap this tool cannot cover (runtime behavior). It does not name `rego_lint` directly as the alternative, leaving the sibling routing slightly inferential.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.