# AGENTS.md Instructions for OPA Rego Policy Gateway for MCP (`opa-rego-mcp-policy-gateway`)

> Enforce deterministic Open Policy Agent (Rego) allowlists, RBAC, and argument validation in front of MCP servers.

## Authorized Defensive Scope
Canonicalize filesystem paths before Rego string prefix checks (`filepath.Clean`) so `../` traversal cannot bypass `startswith`.

## Standard Operating Workflow
1. Author a default-deny Rego policy enumerating exact allowed tool names and canonical path prefixes.
2. Run `opa test` verifying path traversal and unlisted tools evaluate to `false`.
3. Log every policy decision cleanly for SOC audit compliance.

