---
title: "One Package Security Policy for Developer Machines and Pull Requests"
description: "PMG protects one machine for free. Cloud Policy gives a security team one set of package rules for every developer machine, CI runner and pull request."
url: "https://safedep.io/blog/cloud-policy-package-security-policy"
author: "SafeDep Team"
published: "2026-11-26"
---

# One Package Security Policy for Developer Machines and Pull Requests

On one machine, package security is a solved problem. Install [PMG](https://safedep.io/blog/introducing-package-manager-guard), and it blocks malicious packages before they install. Add a [dependency cooldown](https://safedep.io/blog/pmg-dependency-cooldown) to its configuration file, and new versions wait a few days before that machine can pick them up. PMG is open source, and none of this needs an account.

A security engineer has a different job. You answer for hundreds of developer machines and the CI runners that build your services. Coding agents run `npm install` on those machines, and each repository takes pull requests. You need one set of rules to hold on all of them and a change to reach them within minutes. You also need an answer when someone asks why an install failed. SafeDep Cloud Policy is that set of rules. You write it once in SafeDep Cloud, and PMG on each machine and the pull request check on each repository apply it. Cloud Policy is part of the SafeDep Cloud Team and Enterprise plans.

## Rules that live on each machine

Teams that run PMG across a fleet ship its configuration through MDM. A new cooldown or one more blocked package means a new MDM package and a rollout, and some machines keep the old rules for days. The pull request check keeps its own settings, so the rules on a developer machine and the gate on a repository drift apart. After an incident, you cannot tell which rules each machine had on which day.

| Job | Configuration on each machine | Cloud Policy |
| --- | --- | --- |
| Block a malicious package across the company | Days (a new MDM package and a rollout) | Minutes (one rule, picked up on the next policy fetch) |
| Unblock a false positive | Risky (turn a check off, then remember to turn it back on) | Scoped (trust one package with a reason and an expiry) |
| Stricter rules for critical services | Manual (a separate configuration per team) | By label (one policy override for each service with the label) |
| Explain a blocked install | Guesswork (read the file on that machine) | Cited (the block names the rule and the policy revision) |
| Answer an auditor | Unclear (no history of what applied) | Recorded (numbered revisions and an audit log) |

## One policy for machines, repositories and agents

Each tenant has one policy in SafeDep Cloud. The policy base sets the values for all endpoints and projects, such as a seven-day cooldown and the lowest vulnerability severity that fails a pull request. Policy overrides change some of those values for a group. Package rules block a package, or trust one after a review.

PMG reads the policy on developer machines and CI runners, including the installs that coding agents run through PMG. The pull request check reads the same policy for each repository that the SafeDep GitHub App or Bitbucket app scans. The Policy page in SafeDep Cloud shows the values in force and the layer that set each one. In the example below, the cooldown is seven days for most of the company and longer for the payment services.

![The Cloud Policy overview in SafeDep Cloud, with the values in force, the package rule counts and two policy overrides](https://safedep.io/_next/static/immutable/media/cloud-policy-overview.1sb5cgpjl78gy.png)

## Blocking a package across the company

Say a malicious version of an npm package goes live and your team confirms it within the hour. You select **Block Package** in SafeDep Cloud, or run one command:

```console
$ safedep policy rule create --block pkg:npm/color-string-utils --vers '>=1.2.0' --reason "IR-2291 credential stealer" --ticket IR-2291
```

The block publishes at once. Pull request checks apply it from their next run, and PMG on each machine picks it up on its next policy fetch, at most five minutes later. PMG shows the developer your reason and a rule id to send you.

PMG checks the block when a package downloads through its proxy. If the npm or pip cache on a machine already holds the file, the install can still go through. After an urgent block, ask developers to run `pmg cloud sync` and then clear the cache.

## Unblocking a false positive without turning protection off

When a verdict is wrong for one team and a release waits on it, the usual workaround is to switch a check off and hope someone switches it back. A trust entry waives one check for one package instead. It needs a reason and expires within 90 days. A trust entry never waives verified malware, and a block on the same package wins over it.

![The Package Rules tab, with two block entries and two trust entries, each with its reason, scope and expiry](https://safedep.io/_next/static/immutable/media/cloud-policy-package-rules.1b-6xv4wh3jos.png)

The Package Rules tab lists each block and trust entry with its author, its reason and its expiry, and a filter shows the trust entries close to their expiry date.

## Stricter rules for the teams that need them

The payments team may want pull requests to fail on medium severity vulnerabilities and new versions to wait two weeks, while the rest of the company keeps the default. You give their projects and machines a label, such as `custom/criticality=high`, from the Endpoints & Projects page or the CLI:

```console
$ safedep project label set acme/payments-api acme/billing-service --label custom/criticality=high
```

Then you write one policy override that selects the label and sets only the values that differ. A new payments service gets the stricter rules once someone adds the label, with no change to the policy. The Endpoints & Projects page shows the labels of each project and the overrides that apply to it.

![The Endpoints & Projects page, with each project's custom labels and the policy override that matches it](https://safedep.io/_next/static/immutable/media/cloud-policy-projects-labels.2ui51nsykfobl.png)

## Reviewing and undoing changes

Each settings change starts as a draft. The preview lists each field that changes and marks it as a change that tightens or loosens the policy. It also counts the endpoints and projects the change reaches. A change that loosens the policy asks for confirmation, and SafeDep Cloud emails the Owners and Admins about it.

Each publish creates a numbered revision. To undo a change, you restore an older revision as a new change, and the history keeps both. The Decisions page lists what PMG and the pull request checks decided and the rule or setting behind each decision, and the Audit Log records who changed what. Owners and Admins change the policy, and the ReadOnly role and above can read it.

## Get started

You need a SafeDep Cloud Team or Enterprise plan, and the Owner or Admin role in the tenant.

1. **Publish a first policy.** In [SafeDep Cloud](https://app.safedep.io), open **Settings › Cloud Policy › Policy**, go to the **Configuration** tab, and set the dependency cooldown and the severity that fails a pull request in the policy base. Select **Preview & Publish**. From a terminal, `safedep policy edit` does the same with the `safedep` CLI v0.11.0 or later.
2. **Turn on the cloud policy in PMG.** PMG v0.35.0 or later applies it. On each machine, connect PMG to the tenant with an API key from **Settings › API Keys**, then turn the policy on:

   ```console
   $ pmg config set cloud.enabled true
   $ pmg cloud login
   $ pmg config set cloud.policy true
   $ pmg cloud sync
   ```

   `pmg setup doctor` shows the tenant and the policy revision that PMG applied.
3. **Check pull requests.** Repositories that the SafeDep GitHub App or Bitbucket app scans apply the policy from their next pull request check.

The [Cloud Policy quickstart](https://docs.safedep.io/governance/cloud/policy/quickstart) walks through the same steps, and the [Cloud Policy docs](https://docs.safedep.io/governance/cloud/policy/overview) cover each task in the console and the CLI. vet does not read Cloud Policy yet, and the pull request check does not apply the dependency cooldown. The [limits page](https://docs.safedep.io/reference/cloud-policy-limits) lists the other gaps.

Later posts in this series cover incident blocks, the cooldown across a fleet, targeting groups with labels, and explaining and rolling back decisions.
