What Vet is
Laravel Vet is a dependency audit tool for PHP. It runs as a Composer plugin that shows the changescomposer 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 intovendor/ 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 installationPOST_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
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
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
requireandrequire-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 insidevendor/on purpose, such as configuration files that Laravel Vapor changes during deployment. They are left out of the hash and the diffs.
./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.
-
Update Composer to the latest version
-
Move
minimum-release-ageandminimum-release-age-excludefromvet.jsonintocomposer.json -
Remove Vet
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 thetimefield. - Exempt: dev versions such as
dev-main, platform packages, and packages with no publication date. - Temporary bypass:
composer update --no-cooldownskips the policy for one run.COMPOSER_POLICY_COOLDOWN_PERIOD=0also 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’scooldown. 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.
Related pages
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
laravel/vet(default branch0.x, archived)- README
composer.json(abandoned: true)src/Composer/Plugin.phpapp/Enums/AgentType.php- Composer configuration reference (
config.policy)