Psalm 7 runs security analysis by default alongside PHP type checking. Developers no longer need a separate opt-in run to look for supported paths from untrusted input into sensitive operations. The upgrade can therefore expose security findings that an existing type-checking job never reported.

Maintainer Daniil Gentili’s November 2 announcement describes the release. The security-analysis documentation confirms the new default. Evidence status: a released defensive feature, not a newly disclosed compromise or a measured reduction in attacks.

Follow the input through the application

Taint analysis tracks data an application user can control. It follows that data through assignments and function calls toward sinks, operations where unsafe input could cause harm. Examples include a database query, shell command or HTML response.

Psalm 7 adds tracking for request-body streams and uploaded filenames, among other sources. The release also describes deeper tracking through closures, generators, traits and by-reference parameters. Those paths matter because a dangerous value may pass through several helpers before reaching the operation that uses it.

The new models include NoSQL query injection, URL components and large language model (LLM) prompts. Bundled library descriptions cover tools such as Guzzle, PSR-7, Monolog and MongoDB. A library description teaches the analyzer how data moves through APIs whose implementation it may not otherwise understand.

For custom wrappers, developers still need to describe relevant inputs and sensitive parameters. Merely upgrading a checker does not establish that every framework boundary or external data source has been modeled.

A prompt warning identifies a boundary to review

Psalm’s TaintedLlmPrompt documentation flags user-controlled input reaching a prompt parameter marked as sensitive. Its example explicitly annotates that parameter as an LLM-prompt sink.

That warning identifies a path worth examining. It cannot determine whether every possible message will redirect a model or make tool use safe. The documentation recommends separating user text from instructions, limiting accessible data and tools, and treating model output as untrusted.

Those controls need enforcement in the application around the model. A static warning is evidence of a modeled data flow, not a demonstrated successful prompt-injection attack.

Review new findings before regenerating a baseline

The upgrade guide gives several practical checks:

  • Check the analysis environment. Psalm 7 runs on 64-bit PHP 8.2 through 8.6. PHP 8.1 and 32-bit PHP are no longer supported for running it, although it can analyze code targeting older PHP versions.
  • Review new security reports. The default-on change can surface previously unchecked paths. Investigate the flow and context before suppressing a result.
  • Inspect baseline changes. A baseline records findings a team has chosen to set aside. The guide says --set-baseline regenerates it; --update-baseline only removes resolved entries. Blind regeneration can hide the newly visible work.
  • Check plugins separately. The plugin API now has its own compatibility package, psalm/psalm-plugin-api. Psalm minor and patch releases may change that API, so plugin compatibility needs an explicit check.

Trial the upgrade in a review branch, inspect dependency changes and keep security findings visible in the team’s normal review process. Where a warning is a false positive, narrow the model or suppression to the actual context.

Caveat: The release’s speed and coverage claims come from its maintainers; a clean analysis depends on the modeled code paths and cannot certify an application’s security.