REPOSITORY ANALYSIS

pkg-gate

Pre-install security gate for npm lifecycle scripts using TypeSafe System One. Evaluates preinstall, install, and postinstall hooks across intent, threat severity, secret access, and remote execution to intercept supply-chain attacks before execution.

E2 · source reviewedPublic material or source evidence was reviewed. A fixed-version source review requires checking a pinned revision; this is not a reproduction, performance endorsement, or safety guarantee.
Stars
0
Forks
0
License
MIT
Last commit
2026-09-21

What Jev does here

pkg-gate uses `@typesafe-ai/sdk` to evaluate lifecycle scripts in parallel across intent (Choice), threat severity (Score), secret exfiltration (Noul), and remote execution (Noul).

Adds structured choices or scores to the workflow; performance and cost benefits have not been independently verified.

Pinned lifecycle policy and simulator reviewed. Missing keys or provider failures can produce simulated answers; the final report keeps an offline-simulator model marker but drops the intermediate fallbackReason. The site did not install packages, test threat detection or run live Jev.

What task does this project fit?

Review npm lifecycle scripts before installation without confusing a local simulator with a hosted security check.

Material analysed:

From input to action

  1. Resolve preinstall/install/postinstall script contents.
  2. Ask intent, severity, secret-access and remote-execution questions, or enter the simulator path.
  3. Aggregate allow/warn/block and retain the per-script model marker; the final report does not preserve fallbackReason.

Implementation details that matter

Fallback provenance is only partly retained

gate.js adds fallbackReason to an intermediate result, but drops it when building findings/structured output. The simulator's model marker identifies offline simulation; callers cannot recover the failure reason from the final report.

Inspect the supporting source ↗

The weakest question can trigger human review

The policy tracks maximum severity/secret/remote signals and minimum intent/severity confidence. A low minimum confidence routes to warn rather than treating a top label as sufficient.

Inspect the supporting source ↗

No lifecycle scripts is a narrow manifest check

The fast path allows a manifest with no lifecycle hooks. It does not examine every dependency or establish that installing the full dependency tree cannot execute code.

Inspect the supporting source ↗

Missing confidence does not become uncertainty

The aggregation code defaults missing intent/severity confidence to 1 and missing severity/secret/remote signals to 0. The low-confidence warning only catches actual low values; an integrator must verify the SDK or injected client's full response validation before relying on this policy.

Inspect the supporting source ↗

When to choose it

Use it to inspect supply-chain rubrics alongside deterministic package inspection. Preserve result provenance and failure reasons in the integrator; simulated reports should not authorize installation.

How to inspect it yourself

Trace evaluations into findings and report.structured.scripts. Check the model='jev-latest (offline simulator)' marker and verify that fallbackReason is absent; use a fake failed provider rather than untrusted scripts. Inject an incomplete response in a local test and require a strict shape error before aggregation; do not treat numeric defaults as a model verdict.

Limits of this review

  • No package was installed or executed by this site.
  • No supply-chain detection rate, false-positive rate or live Jev latency was measured.
Primary material used in this analysis