Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions content/docs/guides/firewall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ Private/custom registry packages and LPM.dev Registry packages are not sent to t

When a human-output materialization command has eligible packages to check, its progress line shows `🔥 LPM Firewall active`.

## Terminal output

Each warning or block shows the package name, version, and reason. If a report is available, its URL appears below the package:

```text
! LPM Firewall warned for 1 package:
› small-deploy@0.0.5 - warn: LPM static analysis flagged this version for review.
report: https://firewall.lpm.dev/npm/small-deploy/v/0.0.5
```

With color enabled, blocked package names and action labels are red. Warnings use yellow. Blocked packages appear under `LPM Firewall blocked`. Warnings appear under `LPM Firewall warned for` and let the command continue.

Report URLs are clickable in terminals that support hyperlinks. Links require interactive color output. The full URL stays visible in plain output, including with `--color never`.

## CI usage

Firewall checks run for `lpm install`, `lpm ci`, `lpm fetch`, `lpm download`, and the source-package download step of `lpm add`. Because the verdict check calls firewall.lpm.dev, an active firewall check cannot run under `--offline`.
Expand Down
4 changes: 2 additions & 2 deletions content/docs/infra/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ lpm config typosquat --set on

### Install-time source analysis

Source analysis is off by default. Enable scans as package bytes enter the local store:
Source analysis is off by default, including the local scan for the post-install summary. Enable source analysis during installation:

```bash
lpm config source-analysis --set true
```

The next install fills missing analysis caches from stored package bytes without another tarball download. [`lpm audit`](/docs/packages/audit) can scan installed source independently.
The next install fills missing analysis caches from stored package bytes without another tarball download. It also scans installed files for the post-install summary. With this setting disabled, the summary skips local source analysis even with `--verbose`. Registry insights and firewall checks use separate settings. [`lpm audit`](/docs/packages/audit) can scan installed source independently.

Disabling an approved source-analysis setting or typosquat guard requires security approval. Managed policy can prevent either change.

Expand Down
20 changes: 11 additions & 9 deletions content/docs/packages/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,15 @@ lpm config source-analysis --set true # enable analysis
lpm config source-analysis --set false # default; approval required after an approved opt-in
```

The disabled setting skips new install-time scans and cache creation without deleting existing caches. [`lpm audit`](/docs/packages/audit) still scans installed package source when no usable cache exists and stores its fallback result in the project audit cache. Re-enabling source analysis makes the next install backfill any missing, malformed, or outdated store cache from the already-extracted package bytes; it does not need to download the tarball again.
The disabled setting skips source scans during extraction and during the post-install summary. It also skips analysis-cache creation and updates. Existing caches remain on disk, but the summary does not use them to report local findings. The `--verbose` flag does not enable source analysis.

At the end of an install, LPM CLI reads those cached results for every installed package. It does not upload package source during this summary step. For installs larger than 50 packages, progress is reported as `Checking cached security results for N packages` / `Checked cached security results for N packages`, reflecting that this phase reads analysis already produced during extraction rather than rescanning source.
[`lpm audit`](/docs/packages/audit) and separately enabled audit-after-install can still analyze installed source. After you enable source analysis again, the next install fills missing, malformed, or outdated store caches from existing package bytes. No additional tarball download is necessary.

A normal install keeps `Security summary` compact. It shows the total number of Critical, High, and Medium findings, then shows package details only for Critical findings. Run `lpm audit` for the complete report, or use `lpm --verbose install` to include High and Medium details plus exact query selectors.
When source analysis is enabled, the post-install summary scans the installed package files. It does not trust store analysis caches for this report or upload package source. For more than 50 packages, it shows `Scanning security behavior for N installed packages` and `Scanned security behavior for N installed packages`.

Info results describe common package capabilities or artifact traits. Examples include environment-variable access, URL literals, cryptography, and minified source. LPM CLI still detects and caches these signals, but a normal install does not show them as security findings.
When findings exist, a normal install keeps `Security summary` compact. It shows the total number of Critical, High, and Medium findings, then shows package details only for Critical findings. Run `lpm audit` for the complete report, or use `lpm --verbose install` to include High and Medium details plus exact query selectors.

Info results describe common package capabilities or artifact traits. Examples include environment-variable access, URL literals, cryptography, and minified source. With source analysis enabled, LPM CLI detects and caches these signals. A normal install does not show them as security findings.

Use one of these commands to inspect Info signals:

Expand All @@ -269,16 +271,16 @@ For a Swift package named in `lpm install`, audit-after-install adds findings fr

The request contains package names. It does not contain source bytes, local findings, versions, or filesystem paths.

This best-effort enrichment is enabled by default and is independent of the local scanner:
This best-effort enrichment is enabled by default. It can report registry findings even with local source analysis disabled:

```bash
lpm config lpm-insights --set false # keep local findings; skip enrichment
lpm config lpm-insights --set false # skip registry enrichment
lpm config lpm-insights --set true
```

The combined `lpm config lpm-dev` editor manages this setting alongside automatic LPM.dev package skills. npm-only installs still receive local analysis and actionable summaries. They do not trigger this LPM.dev Registry enrichment request. The separately configured [LPM Firewall](/docs/guides/firewall) can make its own verdict requests for npm packages.
The combined `lpm config lpm-dev` editor manages this setting alongside automatic LPM.dev package skills. With source analysis enabled, npm-only installs also receive local findings. They do not trigger this LPM.dev Registry enrichment request. The separately configured [LPM Firewall](/docs/guides/firewall) can make its own verdict requests for npm packages. Firewall mode does not enable or disable local source analysis.

`--no-security-summary` skips the post-install cache aggregation and human report. It does not change the install-time source-analysis setting or remove existing `.lpm-security.json` cache files.
`--no-security-summary` skips the post-install source scan, registry enrichment, and human report. It does not change the install-time source-analysis setting or remove existing `.lpm-security.json` cache files.

With `--json --timing`, source analysis from the authoritative fetch path appears under `timing.fetch_breakdown.source_scan` as `sum_ns` and `max_ns`. Fused overlap-prefetch tasks report the same counters under `timing.detail.fetch.overlap.breakdown.source_scan`, so use detail mode when measuring the complete cold-install scan attribution. Both paths scan while extraction is running: the work is already included in cold install wall time and `extract_ms`, and the counters must not be added to the total again.

Expand Down Expand Up @@ -1017,7 +1019,7 @@ The workspace-root preflight also runs for [`lpm rebuild`](/docs/packages/rebuil
| `--skills` | Install package-published LPM.dev skills for this invocation, overriding user config |
| `--no-skills` | Skip package-published LPM.dev skill auto-install for this invocation |
| `--no-editor-setup` | Accepted with no effect. Package skills do not create editor integrations. |
| `--no-security-summary` | Skip post-install security-cache aggregation and the human report; extraction-time local analysis still runs |
| `--no-security-summary` | Skip the post-install source scan, registry enrichment, and human report. Extraction analysis still follows the source-analysis setting. |
| `--timing` | Include install timing diagnostics in `--json` output |
| `--ignore-provenance-drift <PKG>` | Skip provenance-drift check for one package (repeatable) |
| `--ignore-provenance-drift-all` | Skip the check for every package |
Expand Down
6 changes: 4 additions & 2 deletions content/docs/packages/security-audit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The CLI surfaces are [`lpm audit`](/docs/packages/audit) (broad report), [`lpm q
| Layer | What it catches | Where it runs |
| ------------------------- | ------------------------------------------------------- | ------------------------------------------------------ |
| **Lifecycle script gate** | Postinstall script supply-chain attacks | At install time, blocks until approval |
| **Behavioral analysis** | Risky API usage, obfuscation, telemetry, license issues | At extract time when enabled, or during an explicit audit |
| **Behavioral analysis** | Risky API usage, obfuscation, telemetry, license issues | During install when enabled, or during an explicit audit |
| **Vulnerability data** | Known CVEs from OSV.dev + registry advisories | At `lpm audit` time |
| **Publisher trust + cooldown** | Recently-published direct versions, registry-signature failures, trust downgrades, or publisher-identity drift | At install time and via `lpm audit signatures` |
| **Triage** | Tiered automation for the script gate | At install time, per-package |
Expand All @@ -35,7 +35,9 @@ The dependency lifecycle phases that actually run during `lpm install`'s build p

Install-time source analysis is off by default. When enabled, LPM CLI analyzes package source as extracted bytes enter the store. Results are cached in a schema-versioned `.lpm-security.json` next to the package files. Cache identity includes package source and integrity, so the same `name@version` from different registries does not share findings.

Use `lpm config source-analysis` to manage install-time analysis. The disabled setting skips new install-time scans and cache writes without deleting existing caches. Disabling a previously approved source-analysis setting requires security approval. [`lpm audit`](/docs/packages/audit) still scans installed source when it cannot use a cache. After analysis is re-enabled, the next install backfills any missing, malformed, or outdated store cache from the already-extracted bytes without downloading the tarball again.
Use `lpm config source-analysis` to manage install-time analysis. The disabled setting skips source scans during extraction and the post-install summary, plus analysis-cache writes. Existing caches remain on disk. The summary does not use those caches for local findings. Registry enrichment and firewall checks retain their separate settings.

Disabling a previously approved source-analysis setting requires security approval. [`lpm audit`](/docs/packages/audit) still scans installed source when it cannot use a cache. After analysis is re-enabled, the next install backfills any missing, malformed, or outdated store cache from the already-extracted bytes without downloading the tarball again.

Three groups of tags — source behavior (what the code does), supply-chain signals (what the artifact looks like), and manifest declarations (what `package.json` declares):

Expand Down
8 changes: 5 additions & 3 deletions content/docs/reference/config-toml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ relay-url = "wss://relay.lpm.fyi/connect"
| `strict-peer-dependencies` | bool | `false` | Turn missing required peers, peer version mismatches, and peer-conflict warnings into install failures. Per-invocation overrides: `--strict-peer-dependencies` / `--no-strict-peer-dependencies`. Project override: `package.json > lpm.strictPeerDependencies`. |
| `auto-install-peers` | bool | `true` | Auto-install missing non-optional `peerDependencies` at the project root after the main resolve pass. Project override: `package.json > lpm.autoInstallPeers`. Set to `false` for npm-classic / pnpm-classic peer-warning-only behavior. |
| `auto-install-lpm-skills` | bool | `true` | Reconcile package-published skills from installed `@lpm.dev/*` packages. Set with [`lpm config lpm-skills`](/docs/infra/config#setup-wizards). Per-invocation overrides: `--skills` / `--no-skills` on `lpm install`, `lpm add`, and `lpm ci`. Disabling automatic installs does not delete existing `.lpm/skills/` content or affect explicit `lpm skills add`. |
| `install-time-source-analysis` | bool | `false` | Analyze npm, custom-registry, and LPM.dev package source while extracted bytes enter the store. Disabling an explicitly approved or managed source-analysis setting requires approval. Re-enabling it backfills missing, malformed, or outdated store caches from existing package bytes on the next install. Set with [`lpm config source-analysis`](/docs/infra/config#install-time-source-analysis). |
| `install-time-source-analysis` | bool | `false` | Analyze npm, custom-registry, and LPM.dev package source during extraction and for the post-install summary. Disabling an explicitly approved or managed source-analysis setting requires approval. Re-enabling it backfills missing, malformed, or outdated store caches from existing package bytes on the next install. Set with [`lpm config source-analysis`](/docs/infra/config#install-time-source-analysis). |
| `fetch-lpm-security-insights` | bool | `true` | Use Registry behavioral tags and lifecycle-script data in the normal install summary for `@lpm.dev/*` packages. For JavaScript packages, `lpm audit` and audit-after-install add Registry security findings and vulnerabilities. For explicit Swift packages, audit-after-install adds them. This setting is independent of local source analysis. Set with `lpm config lpm-insights` or manage it alongside package skills with [`lpm config lpm-dev`](/docs/infra/config#lpmdev-settings). |
| `workspace-concurrency` | positive integer | available parallelism | User default for concurrent workspace members in `lpm run`, `lpm test`, and `lpm bench` workspace mode. Per-invocation override: `--workspace-concurrency <N>`. Project override: `lpm.toml > [workspace].concurrency`. |
| `audit-after-install` | bool | `false` | Add an audit summary after every successful `lpm install`. JavaScript installs use the [`lpm audit`](/docs/packages/audit) scan. Explicit Swift installs use fetched Registry metadata. The summary includes severity counts and each Critical finding. Findings never fail the install. Per-invocation overrides: `--audit-after-install` / `--no-audit-after-install`. Per-process environment variable: `LPM_AUDIT_AFTER_INSTALL`. See [Audit after install](/docs/packages/install#audit-after-install). |
Expand Down Expand Up @@ -318,9 +318,11 @@ List-valued cooldown excludes are merged instead of replaced: CLI `--min-release

Package-published LPM.dev skill installation has its own compact chain: `--skills` / `--no-skills` wins over `auto-install-lpm-skills`, which wins over the inverted legacy `noSkills` key, then the built-in default `true`. `lpm config lpm-skills` writes the canonical boolean and removes the legacy key.

Install-time source analysis defaults to disabled. A permitted `install-time-source-analysis = false` skips new scans and cache writes without deleting existing caches. Re-enabling it makes install validate the analysis-cache schema and backfill missing, malformed, or outdated caches directly from already-extracted store bytes. Disabling an explicitly approved source-analysis setting requires approval. A configured `force-security-floor` or managed policy can prohibit that change.
Install-time source analysis defaults to disabled. A permitted `install-time-source-analysis = false` skips source scans during extraction and the post-install summary, plus analysis-cache writes. Existing caches remain on disk, but the summary does not use them for local findings. The `--verbose` flag does not override this setting. [`lpm audit`](/docs/packages/audit) and separately enabled audit-after-install can still scan source.

LPM.dev security enrichment also defaults to enabled. `fetch-lpm-security-insights = false` suppresses the install-time batch enrichment request without disabling local source analysis or cached local findings. Use `lpm config lpm-dev` to review this setting together with automatic LPM.dev package skills, or `lpm config lpm-insights` to change only enrichment.
Re-enabling it makes install validate the analysis-cache schema and backfill missing, malformed, or outdated caches directly from already-extracted store bytes. Disabling an explicitly approved source-analysis setting requires approval. A configured `force-security-floor` or managed policy can prohibit that change.

LPM.dev security enrichment also defaults to enabled. `fetch-lpm-security-insights = false` suppresses the install-time batch enrichment request. The separate source-analysis setting controls local scans. Registry findings can appear in the summary even with source analysis disabled. Use `lpm config lpm-dev` to review this setting together with automatic LPM.dev package skills, or `lpm config lpm-insights` to change only enrichment.

On `lpm install -g` the `package.json > lpm` tier is N/A — global installs synthesize their own package.json that doesn't carry user-edited keys. The chain collapses to CLI flag > `~/.lpm/config.toml` > built-in default for `script-policy`, `triage-advisor`, `minimum-release-age-secs`, `release-age-policy`, `strict-peer-dependencies`, `trust-policy`, `integrity`, and the script-policy aliases (`--yolo` / `--triage`). `minimum-release-age-exclude` still merges with repeated CLI `--min-release-age-exclude` flags. Registry signature verification uses `LPM_VERIFY_REGISTRY_SIGNATURES` > `signatures` > default `false`. Sigstore verification posture uses `LPM_PROVENANCE_ENFORCE` > `[sigstore].verify` > built-in default, with weaker env/config values guarded by the security approval layer. `[sigstore].scope` and `[sigstore].availability` are independent config-only axes; their defaults remain `"approved"` and `"best-effort"`.

Expand Down
Loading