Skip to main content
A policy is a security control you can apply to a channel or mirror to restrict the packages users can source from them. For general information about policies, see Policies.
Policy filters only work for conda repositories. If your channel contains Std Python or R packages, use the mirror filters.

Creating a policy

To create a policy, use --create along with configuration options. These options let you define filtering criteria such as platforms, licenses, CVEs, and package names:
Creating a policy doesn’t apply it to a channel. To apply it, assign the policy to a channel after you create it.
This command is formatted for readability. If your shell supports line continuation (bash, zsh), you can run it as shown. Otherwise, remove the backslashes (\) and combine it into a single line.

Basic configuration options

  • --name: Set the name of the policy
  • --description: (Optional) Provide a description for the policy

Platform filtering options

  • --platform: Include platforms, separated by commas
  • --platform-not: Exclude platforms, separated by commas
Available platforms: linux-32, linux-64, linux-aarch64, linux-armv6l, linux-armv7l, linux-ppc64, linux-ppc64le, linux-s390x, osx-64, osx-arm64, win-32, win-64, zos-znoarch

License filtering options

  • --license: Include licenses, separated by commas
  • --license-not: Exclude licenses, separated by commas
Supported licenses: AGPL, GPL, GPL2, GPL3, LGPL, BSD, MIT, APACHE, PSF, Public-Domain, Proprietary, MOZILLA, OTHER, None, CC

Package filtering options

  • --package-name: Include package names, separated by commas
  • --exclude-package-name: Exclude package names, separated by commas
  • --exclude-package-name-exception: Remove exclusions for specified packages, separated by commas
  • --include-dependencies: Include dependencies
  • --exclude-dependencies: Exclude dependencies
  • --only-signed-packages: Restrict to signed packages only
  • --keep-legacy-packages: Include both .conda and .tar.bz2 files for packages that contain them

Date-based filtering options

Date format: YYYY-MM-DD
  • --package-created-from: Filter packages created on or after the specified date
  • --package-created-to: Filter packages created on or before the specified date

CVE filtering options

  • --cve-score: Set a CVE score threshold for filtering
  • --cve-score-comparator: Comparator for CVE score (==, <=, >=, <, >; default: <=). Quote the value on the command line, for example "<=".
  • --cve-status: Include CVE statuses, separated by commas
  • --exclude-cve-status: Exclude CVE statuses, separated by commas
Supported statuses: active, reported, mitigated, cleared, disputed
  • --cve-link-status-and-score: Define the relationship between CVE status and score (and or or; default: and)
  • --cve-allowlist: Add specific CVE IDs to an allowlist, separated by commas (format: CVE-YYYY-#####)
  • --exclude-uncurated-cve-packages: Exclude uncurated CVE packages

Viewing policies

To view all policies:
To view a specific policy:

Assigning a policy

To assign a policy to a channel:
Policies can also be applied directly to mirrors. For more information, see Creating a mirror with a policy.

Unassigning a policy

Editing a policy

To edit an existing policy, use --edit with the same configuration options available for creating a policy, plus the policy ID:
Editing a filtering option clears the previous filter value. For example, if you create a policy with the win-32 platform filter, running conda repo policy --edit <POLICY_ID> --platform "win-64" replaces the win-32 filter with win-64—it does not add both.
To clear filters in a policy, provide an empty string for the filtering option using --edit. For example, to remove the platform filter, use --platform "". This works for platform and license filtering arguments.

Deleting a policy