Every composer command in a scaffolded app fails with "packages are not trusted"
ERROR [3] packages are not trusted. Run [./vendor/bin/vet] in a terminal to pick the ones
that you trust.
- When
Any
sail composer install/update/requirein an application scaffolded withvetamong its quality tools — most often right after adding a package.- Why it happens
This is Vet working, not a failure.
laravel/vetruns as a composer plugin and gates every install onvet.json: a version the file does not record is shown as a diff and refused, so a package nobody has read cannot reachvendor/unnoticed. Composer writes the newcomposer.lockbefore the plugin stops it, so lock andvendor/can disagree afterwards — and Vet then refuses to record anything until they agree again.- Fix
Run
sail composer vetin a terminal. The plugin never asks — it can only report — so a script, a CI job or an agent driving the app non-interactively will always exit 1 here. The interactive run lists the packages, will hand each diff to a coding agent if you ask it to, and records the ones you accept. If it refuses with "composer would write N packages that vendor/ does not hold", runsail composer installfirst so the two agree, then vet again.Do not delete
vet.jsonto get past this: that discards every recorded version, and the nextvet --initre-trusts whatever is on disk unread — the one thing the file exists to prevent.
Still stuck? Open an issue with your --log transcript.