The cloud policy needs the SafeDep Cloud Team or Enterprise plan. See pricing.
Before you start
- You have the Admin role in a SafeDep Cloud tenant.
- The safedep CLI is installed.
- To see the effect in PMG: PMG is installed on a machine, and you have an API key of the tenant from app.safedep.io/settings/api-keys.
- To see the effect in a pull request check: the GitHub App or the Bitbucket app scans a repository for your tenant.
1
Log in
safedep auth status to see the tenant of the session.2
Show the policy
3
Edit the policy
# at the start of its line and of the lines of its parents. Make the base section of the document hold these values:4
Preview the change
scan_gate.fail_onchanges fromhigh, the value of the SafeDep default policy, tomedium. A lower severity fails more checks, so this field tightens.package_admission.cooldown.min_agehad no value before. A field with no value on one side counts as a change that loosens, because SafeDep Cloud cannot know what each tool did without it.
5
Publish the change
6
See the policy in PMG
On a machine with PMG, connect PMG to your tenant and turn on the cloud policy:The cloud policy check names your tenant and the revision that PMG applied. PMG now holds back each package version that is younger than 7 days. To see the revision that each endpoint applied, run
pmg cloud login asks for the tenant ID and the API key. pmg cloud sync fetches the policy at once.If pmg config set prints key not found, your config file has no cloud section. Run pmg setup install to add the missing keys of the PMG template to your config file, then run the pmg config set command again. You can also add the key by hand with pmg config edit.Then run:safedep endpoint list.7
See the policy in a pull request check
Open a pull request that adds a package with a vulnerability of medium severity, in a repository that the app scans. The check fails. The comment of the SafeDep app starts with a block titled SafeDep policy: failed. The block names your tenant revision, the
scan_gate.fail_on setting with the value MEDIUM, and the vulnerability that failed the check.Next steps
Block a Package
Block a package for the whole tenant.
Target a Group
Set other values for a group of endpoints or projects.
Policy Revisions and Changes
What happens between an edit and a publish.
Apply the cloud policy in PMG
Settings, cache and offline behavior of PMG.

