> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the OPA plugin

> Enforce policies in env zero deployments using the OPA plugin, which installs the opa binary and runs opa eval against a bundle path with a specified query.

## Overview

This plugin executes the Open Policy Agent engine (aka the `opa` CLI) and integrates [policy enforcement](https://docs.envzero.com/guides/policies-governance/policies.md) within your env zero deployments.

The plugin will install the `opa` binary and execute its `opa eval` command

For more information, check out the [OPA Plugin git repository](https://github.com/env0/env0-opa-plugin).

## Inputs

To use the OPA plugin, [reference it in your custom flow](https://docs.envzero.com/guides/integrations/plugins.md) and pass the following inputs:

1. `path` (**Required**) - the path to your bundle directory (the root folder is your project's root folder)
2. `query` (**Required**) - a query to eval with opa eval
3. `flags` - a string containing additional flags as one string

## Further reading

* [Using Open Policy Agent (OPA) with Terraform: tutorial and examples](https://www.envzero.com/blog/open-policy-agent)
* [How policy-as-code enhances infrastructure governance with OPA](https://www.envzero.com/blog/how-policy-as-code-enhances-infrastructure-governance-with-open-policy-agent-opa)

## Next steps

To start from prewritten guardrails instead of your own policy code, browse the [ready-to-use policies](https://docs.envzero.com/guides/policies-governance/ready-to-use-policies.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.