# 使用 Homebrew, apk, zypper, scoop 安装 opa

查看 opa 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:opa
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install opa
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add opa
```

  证据: Alpine Linux edge package indexes: opa from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- zypper (92%):

```sh
sudo zypper install opa
```

  证据: openSUSE Tumbleweed package metadata: opa from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/opa
```

  证据: Scoop official bucket manifest trees: bucket/opa.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:opa
- **软件包管理器:** Homebrew
- **版本:** 1.19.0
- **来源摘要:** Open source, general-purpose policy engine
- **主页:** <https://www.openpolicyagent.org>
- **仓库:** <https://github.com/open-policy-agent/opa>
- **最后更新:** 2026-07-30T21:12:07Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- opa (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.19.0
## 项目历史与用法

Open Policy Agent, usually invoked as opa, is a general-purpose policy engine for policy-as-code. It lets teams move authorization and operational policy out of application code into Rego policies evaluated by a standalone binary, sidecar, library, or service integration.

### 项目历史

OPA was created to provide a unified policy decision point across the stack. The official docs describe it as an open-source, general-purpose policy engine with simple APIs for offloading policy decisions and a high-level declarative language, Rego, for writing policies against structured data.

OPA entered the Cloud Native Computing Foundation on March 29, 2018, moved to Incubating on April 2, 2019, and reached Graduated maturity on January 29, 2021. CNCF's graduation announcement emphasized open governance, feature maturity, sustainability, and production use across cloud-native environments.

### 采用历史

By the 2021 CNCF graduation announcement, OPA had more than 90 contributors from roughly 30 organizations, maintainers from Google, Microsoft, VMware, and Styra, and production adoption at organizations including Goldman Sachs, Netflix, Pinterest, and T-Mobile. CNCF also reported survey data from more than 150 organizations, with 91% using OPA in some stage from QA to production.

OPA's ecosystem expanded through Kubernetes admission control, Envoy authorization, CI/CD checks, API gateways, service meshes, and infrastructure-as-code validation. Gatekeeper became the Kubernetes-native policy-controller companion, while related tools such as Conftest and OPA's official ecosystem entries made the opa binary useful both in clusters and in developer workflows.

### 使用方式

Developers write Rego policies and feed OPA JSON-like input and data. The opa CLI is used to run policies locally, test Rego, build bundles, evaluate decisions, and support CI checks; services can call OPA over APIs or embed policy evaluation into a broader control plane.

Platform and security teams use OPA to enforce Kubernetes admission rules, API authorization, deployment guardrails, configuration rules, and audit policies without hard-coding every rule in each application. The same policy language can be reused from local command-line checks to production admission controllers.

### 为什么软件包爱好者会关心

OPA is one of the canonical examples of a single CLI package representing a much larger cloud-native control-plane concept. The Homebrew formula is just opa, but the binary brings a policy language, evaluator, test runner, bundle format, server mode, WebAssembly targets, and a CNCF ecosystem with it.

### 时间线

- 2018-03-29: OPA was accepted into the CNCF.
- 2019-04-02: OPA moved to CNCF Incubating maturity.
- 2019: Kubernetes Gatekeeper work helped make OPA a common choice for admission control and cluster policy.
- 2021-01-29: OPA reached CNCF Graduated maturity.
- 2021-02-04: CNCF announced OPA's graduation and summarized contributor, maintainer, and adopter data.

### Related projects

- Related projects include OPA Gatekeeper, Conftest, Rego Playground, Kubernetes admission webhooks, Envoy external authorization integrations, SPIFFE/SPIRE, Helm, CoreDNS, and other policy-as-code tooling.

### 来源

- <https://formulae.brew.sh/formula/opa>
- <https://kubernetes.io/blog/2019/08/06/opa-gatekeeper-policy-and-governance-for-kubernetes/>
- <https://openpolicyagent.org/ecosystem/entry/gatekeeper>
- <https://www.cncf.io/announcements/2021/02/04/cloud-native-computing-foundation-announces-open-policy-agent-graduation/>
- <https://www.cncf.io/projects/open-policy-agent-opa/>
- <https://www.openpolicyagent.org/docs>
- <https://www.openpolicyagent.org/docs/policy-language>


## 安全说明

没有找到 opa 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 其他软件包管理器记录

- apk - opa - 1.15.2-r2: normalized package name match | Alpine Linux edge package indexes: opa from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Open source, general-purpose policy engine | https://www.openpolicyagent.org/
- apk - opa-bash-completion - 1.15.2-r2: normalized package name match | Alpine Linux edge package indexes: opa-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Bash completions for opa | https://www.openpolicyagent.org/
- apk - opa-doc - 1.15.2-r2: normalized package name match | Alpine Linux edge package indexes: opa-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Open source, general-purpose policy engine (documentation) | https://www.openpolicyagent.org/
- apk - opa-fish-completion - 1.15.2-r2: normalized package name match | Alpine Linux edge package indexes: opa-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Fish completions for opa | https://www.openpolicyagent.org/
- apk - opa-zsh-completion - 1.15.2-r2: normalized package name match | Alpine Linux edge package indexes: opa-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Zsh completions for opa | https://www.openpolicyagent.org/
- zypper - opa - 1.19.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: opa from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Open source, general-purpose policy engine | https://github.com/open-policy-agent/opa
- zypper - opa-bash-completion - 1.19.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: opa-bash-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Bash Completion for opa | https://github.com/open-policy-agent/opa
- zypper - opa-fish-completion - 1.19.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: opa-fish-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Fish Completion for opa | https://github.com/open-policy-agent/opa
- zypper - opa-zsh-completion - 1.19.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: opa-zsh-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Zsh Completion for opa | https://github.com/open-policy-agent/opa
- Scoop - main/opa: normalized package name match | Scoop official bucket manifest trees: bucket/opa.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/opa.yml](https://github.com/mxcl/pkgdb/blob/main/combined/opa.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
