Skip to main content
laravel/vet is currently archived and no longer updated. The README recommends migrating to Composer’s built-in features. Read this as material for deciding how to handle existing projects, not as a guide for new adoption.

What Vet is

Laravel Vet is a dependency audit tool for PHP. It runs as a Composer plugin that shows the changes composer update is about to write into vendor/, package by package, and lets you approve them before Composer writes. Packages you trust are recorded in vet.json, so the next update only asks you about what changed. It requires PHP 8.4 or later.

The problem it addresses

When Composer fetches a dependency, it writes the contents into vendor/ without anyone reading them. In a supply chain attack, a malicious release published shortly before an automatic update can get in. Vet guards against this from two directions.
  • Read before it lands: review the diff of each changed file before it is written
  • Wait for new releases: exclude releases younger than a set number of days from candidates

How it works

src/Composer/Plugin.php subscribes to these events.
  • PRE_POOL_CREATE: removes releases younger than the configured age from the candidates (minimum-release-age)
  • PRE_OPERATIONS_EXEC: checks untrusted packages before installation
  • POST_INSTALL_CMD / POST_UPDATE_CMD: runs the audit after install and update

Installation and setup

vet --init records every currently installed package as trusted and creates vet.json. With --minimum-release-age=7, releases younger than seven days are excluded from candidates. Running composer update afterward moves each package to the newest release that is old enough. Commit vet.json.

Daily auditing

The first command exits with a non-zero status when a package is not trusted. In a terminal, it asks interactively which packages to trust. The second command shows every change for one package.

Reviewing with an agent

When you run vet in a terminal, it can ask one of these coding agents to read the changes.
  • Claude
  • Codex
  • Gemini
  • opencode
The agent reads each package’s changes and returns PASS or FAIL. WARN means part of the review is left to a person, for example when a file is too large for the prompt. According to the README, the agent reads and you decide. The agent is never called from the Composer plugin. It runs only when you ask for it.

The vet.json structure

  • require and require-dev: the version you reviewed and a hash of its files. If the same version ships different bytes, vet asks you to review the difference again.
  • minimum-release-age: the number of days a release waits before it is allowed.
  • minimum-release-age-exclude: packages exempt from the wait. * matches any part of a name.
  • ignore: paths that a tool rewrites inside vendor/ on purpose, such as configuration files that Laravel Vapor changes during deployment. They are left out of the hash and the diffs.
To reset the trust records, run ./vendor/bin/vet --fresh. It keeps your settings and records what vendor/ contains now.

Migrating to Composer

The README says that from Composer ^2.11, Composer handles this work itself, and recommends the following migration.
  1. Update Composer to the latest version
  2. Move minimum-release-age and minimum-release-age-exclude from vet.json into composer.json
  3. Remove Vet
The behavior of these settings in Composer’s official documentation (doc/06-config.md) is as follows.
  • period: a string such as "7 days" or "24 hours", or an integer number of seconds. Relative phrases such as "tomorrow" are rejected.
  • Publication time: determined from published-time, which Packagist.org provides. VCS, path, and artifact repositories fall back to the time field.
  • Exempt: dev versions such as dev-main, platform packages, and packages with no publication date.
  • Temporary bypass: composer update --no-cooldown skips the policy for one run. COMPOSER_POLICY_COOLDOWN_PERIOD=0 also disables it.
  • Malware policy: enabled by default. Versions flagged as malware are blocked. Packagist.org takes these flags from Aikido.
The README’s migration steps only cover minimum-release-age. They do not address the hash-based trust records that vet.json keeps in require. Composer’s malware policy is on by default. If you plan to replace Vet’s trust records entirely, consider this gap before deciding.

Summary

Laravel Vet was a Composer plugin that combined per-package diff review with trust records under a “read before it lands” model. It is now archived, and the release waiting period can be handled by Composer’s cooldown. For new projects, adopting it is no longer the practical choice. It is more useful as a reference for migrating an existing vet.json into Composer’s configuration.

Laravel Doctor

Introduces a tool that diagnoses a project’s environment and configuration.

Laravel Passkeys initial investigation

An initial investigation of a passwordless authentication package.

Primary sources

Last modified on November 30, 2026