Sulat.com / Writing on AISaturday, November 21, 2026
Developer Tools/21 November 2026

Bref v4 will use AWS Lambda’s new customer-managed runtimes to patch PHP without a redeploy

AWS made Lambda's customer-managed runtimes generally available on 18 November. Bref's Matthieu Napoli says v4 will use them to apply PHP security patches without a redeploy; the catch is who controls the timing.

Glossy 3D Bref logo beside the AWS Lambda symbol, with one glowing runtime block feeding many small server cubes

At a glance

  • AWS made customer-managed runtimes generally available on 18 November in all commercial Regions, with no extra charge beyond standard Lambda and Amazon ECR pricing.
  • Bref creator Matthieu Napoli says v4, planned for the end of 2026, replaces layers with a Bref-published runtime, so PHP patches reach functions at their next cold start with no redeploy.
  • His benchmark has the same PHP build starting in 197 ms as a runtime against 279 ms as a layer; it was a single run on ARM64, 1024 MB, in eu-west-1.
  • Functions can run in Auto, Function update or Manual mode, and AWS warns that a publisher can push code into your execution environments, so it says to trust the publisher.
  • AWS lists SnapStart as unsupported on customer-managed runtimes, while Napoli lists it as research for v4.

Bref, the open-source project that runs PHP on AWS Lambda, will move to AWS’s new customer-managed runtimes in version 4, and PHP security patches will then reach functions at their next cold start with no redeploy, its creator Matthieu Napoli says. AWS made the feature generally available in all commercial Regions on 18 November, with no extra charge beyond standard Lambda and Amazon ECR pricing.

Napoli, an AWS Serverless Hero, posted the plan on X at 13:01 UTC on 20 November (2:01am on 21 November NZ time) and published the details on the Bref site. He says he tested customer-managed runtimes privately with the AWS Lambda team for months and benchmarked dozens of runtime variants along the way. Bref has been installed more than 12 million times and serves 30 billion requests a month, he wrote in a Sentry blog post on 18 November. Bref v4 is planned for the end of the year, and Bref v3 keeps working until then.

Matthieu Napoli on X, 20 November: the four changes he says Bref v4 brings.

Why PHP needed a new delivery method

Bref ships PHP to Lambda as layers, zip files that Lambda unpacks into each new execution environment. A layer version is fixed, and a function points at one version by its ARN, its Amazon Resource Name. When PHP fixes a security hole, the function stays on the old PHP until someone updates Bref and redeploys.

Napoli’s account of October’s PHP release shows the gap. PHP shipped two critical remote code execution fixes, CVE-2026-109618 and CVE-2026-109619, on 21 October, and Bref published patched layers 31 minutes later. Applications still had to take them.

Time (UTC)What happened
13:35PHP releases 8.5.12, 8.4.27, 8.3.36 and 8.2.35
13:37Bref opens pull requests to update its layers
13:59Bref CI passes
14:06Patched layers and Docker images are live in every Region
AfterEach application runs composer update bref/bref -W and redeploys
Source: Bref, 21 October. 14:06 UTC was 3:06am on 22 October NZ time.

Some applications updated within the hour, some within the week, and some are probably still on a vulnerable PHP version, Napoli writes. PHP shipped another critical security release on 19 November, covering PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36, and he says every Bref application has to redeploy again to pick it up.

Sulat, 20 November: what the 19 November PHP release means for a Laravel app.
PHP patch path: with layers you redeploy, with a Bref v4 runtime the next cold start picks it up
With layers you redeploy to get a PHP patch; with a v4 runtime the next cold start does it.

What AWS shipped

Until now Lambda ran two kinds of runtime: the ones AWS maintains, such as Node.js and Python, and custom runtimes, where you bring a language in a layer or your deployment package on top of a bare operating system. AWS now calls that second route “bring your own language” and recommends customer-managed runtimes for most uses. The feature applies to Lambda Event Functions, the new name for standard Lambda functions.

A customer-managed runtime is a standalone Lambda resource built from a container image in Amazon ECR. The publisher builds the image once, with the operating system libraries, the language, a bootstrap script and a runtime interface client, the code that fetches invocations from Lambda and calls your handler. Functions then reference the runtime and keep deploying their code as .zip files. The AWS Compute Blog launch post draws PHP plus a monitoring extension as its worked example, and lists PHP, Bun and R as languages a publisher can package.

Layer
A zip file Lambda unpacks into a function’s execution environment. A function points at one fixed version.
Runtime
The language environment a function runs in. A customer-managed runtime is one a third party or your own team publishes.
Runtime version
One fixed container image. It can’t be changed, so an update means a new version.
Alias
A name that points at one runtime version. Functions point at the alias, not the version.
Cold start
Lambda starting a new execution environment for a function, including loading the runtime.
Runtime, version, alias: three functions point at one alias, and moving the alias moves them to the patched version
Functions only know the alias, so moving the alias moves every function.

Updates work by moving an alias. When the publisher points an alias at a new version, functions on the default Auto setting move to it at their next cold start. Warm execution environments keep the old version until Lambda replaces them, so for a while invocations run on both versions. AWS’s documentation says customer-managed runtimes skip the two-phase rollout Lambda uses for its own runtimes, and the publisher sets the pace by choosing when each alias changes.

every function picks it up at its next cold start.

Matthieu Napoli, Bref news, 20 November

Napoli compares it to how AWS treats Node.js and Python, where AWS patches the runtime and functions get the patch. Layers and container images work the other way round.

Delivery modelHow PHP gets inFunction deploys asA PHP patch reaches a function
Layer (bring your own language)Zip layer, one fixed version per function.zipWhen you update the layer and redeploy each function
Container imageInside the function’s own imageContainer imageWhen you rebuild the image and redeploy
Customer-managed runtimeImage published by the runtime publisher, referenced by alias.zipWhen the publisher moves the alias, at the next cold start
Source: AWS Lambda documentation, which compares the models.
The AWS CLI calls behind a runtime update

From the AWS launch post: publish a new version from a rebuilt image, then point the alias at it. A function names the runtime and alias instead of an identifier such as python3.14.

Code
aws lambda-core create-runtime-version \
    --runtime-name my-runtime \
    --name v2 \
    --image-uri 111122223333.dkr.ecr.us-east-1.amazonaws.com/my-runtime:v2

aws lambda-core update-runtime-alias \
    --runtime-name my-runtime \
    --name production \
    --runtime-version v2

aws lambda create-function \
    --function-name my-function \
    --runtime custom \
    --runtime-config RuntimeArn=arn:aws:lambda:us-east-1:111122223333:runtime/my-runtime,RuntimeAlias=production \
    --handler index.handler \
    --zip-file fileb://function.zip \
    --role arn:aws:iam::111122223333:role/my-lambda-role

Napoli says Bref handles this configuration, and that serverless.yml stays the same as in Bref v3.

What Bref v4 changes

Napoli’s roadmap has six points. Each is a plan for v4, not a shipped feature.

  • Runtimes instead of layers. One runtime per PHP version, in the Regions Bref supports today. A release becomes one image per PHP version, with x86 and ARM in the same image, published as a new runtime version in each Region. Today every release publishes hundreds of layer versions, one for each PHP version, CPU type and Region, and the bref/bref package carries the layer list for every Region.
  • Ubuntu 26.04 LTS instead of Amazon Linux 2023. Napoli says he measured the same PHP build on Amazon Linux 2023, Ubuntu and Debian and found no difference in cold starts or execution time. His case is familiarity and newer libraries: ICU 78 instead of 67 for intl, ImageMagick 7 instead of 6, and an apt install for almost every extension’s dependencies. Ubuntu 26.04 is supported until 2031, he writes, and Bref still compiles PHP itself.
  • More extensions built in, installed but disabled by default, and switched on with one line in php.ini. Extensions requested by Bref sponsors and by Bref Pro and Enterprise customers go first, and custom Lambda layers still work for the rest. Napoli says image size has little effect on cold starts, because Lambda loads only the files a function reads.
  • One image everywhere. The same image would run on Lambda and locally in Docker, and Napoli says it opens the door to running Bref applications as ordinary containers on ECS. He asks readers to say if they want that.
  • PHP 8.6, which was released on 19 November.
  • Container-image deployments stay. PHP is part of the application image there, so a PHP update still means a rebuild.
Sulat, 19 November: what PHP 8.6 adds.

−29%

Cold start for the same PHP 8.5 build: 279 ms as a layer, 197 ms as a runtime

−24%

Bref v3 layer at 240 ms against a v4 prototype at 183 ms

59 MB

PHP-FPM memory on a Laravel app in the prototype, against 72 MB on v3

31 min

Bref’s publish time after the 21 October PHP release, on layers

To separate the delivery method from everything else, Napoli took the Bref v3 layer for PHP 8.5 and shipped it as a runtime without changing a binary. He attributes the 82 ms saving to Lambda no longer downloading and extracting a zip in each new environment: it caches the image and loads files lazily as they’re read. On a Laravel application the v4 prototype started about 100 ms faster than v3.

The setup was ARM64, 1024 MB, eu-west-1, 30 cold starts per variant run in an interleaved order, taking the median of initialisation plus the first request. Each comparison was a single run, and the figures are Napoli’s own.

Where the cold-start time goes

In a separate experiment published on 13 November, Napoli measured a warm Laravel request on PHP-FPM at 5.9 ms in total. Laravel took 4.65 ms, sending the response to Lambda 0.54 ms, FastCGI and PHP-FPM overhead 0.36 ms and Bref’s own PHP code 0.35 ms. On a cold start, Bref’s PHP code took about 9 ms and starting PHP-FPM took 80 ms.

That experiment tested whether rewriting Bref’s runtime in Rust would be faster, and Napoli’s answer was no: the runtime stays in PHP in v4. It also puts the layer result in scale. The 82 ms the same PHP build gained by moving from a layer to a runtime is about the size of PHP-FPM’s own startup, and nine times Bref’s PHP code. The two experiments are separate runs, so the comparison is between his published figures, not one measurement.

Napoli says v4 will carry other performance work and hasn’t detailed it. In a follow-up post on X he called the announcement “just the tip of the iceberg” for v4.

Who controls the timing

Auto is the default, and AWS’s documentation states what it means: the function receives runtime updates, including security patches, as soon as the publisher releases them. For a Bref user that moves the timing of a PHP patch from the user’s redeploy to Bref’s decision to publish and move an alias.

AWS says a publisher can push updates into the execution environments of every function that uses its runtime, that the code runs with the permissions of each function’s execution role, and that a publisher can ship an update that breaks functions or delete the runtime.

Only use customer-managed runtimes from publishers that you trust.

AWS Lambda documentation
Update modes: Auto lands at next cold start, Function update at deploy, Manual pins a version with no patches
Three settings decide when a function takes a runtime update, and Manual stops patches too.

A consumer can change the default per function. Function update mode resolves the alias only when the function is created or updated, so runtime updates arrive with the team’s own deploys. Manual mode ignores the alias and pins a specific runtime version, which needs the lambda:AssociateRuntimeVersion permission. AWS recommends Manual only for a short time, because a pinned function gets no security patches. Organisation administrators can use service control policies to allow only runtimes from trusted accounts, and for third-party runtimes AWS suggests copying the publisher’s images into your own Amazon ECR repository and building your own runtime from them.

AWS’s documentation also describes alias layouts a publisher can use: one alias for everything, one per environment such as dev, test and prod, or one per minor version such as php8.3 and php8.4. Napoli hasn’t said which layout Bref will use.

Napoli raises the same concerns himself. Some teams will want to pin a runtime version, roll back, test a new version in staging, or run the Bref runtime from their own AWS account, he writes, and he’s exploring what Bref could offer. He hasn’t said whether Bref will publish its runtime images for copying.

Check which runtime version a function is running

Lambda writes the runtime name and version to the INIT_START log line each time it creates an execution environment. This example is from the AWS documentation:

Code
INIT_START Runtime Version: companyphp8:v8.3.2 Runtime Version ARN: arn:aws:lambda:us-east-1:123456789012:runtime/companyphp8/version/v8.3.2

To roll one function back, set Manual mode and pin the earlier version’s ARN. To roll everyone back, the publisher points the alias at the previous version.

Limits and guardrails

  • Customer-managed runtimes work with Lambda Event Functions only, not Lambda Web Functions.
  • A function on a customer-managed runtime can’t use Lambda SnapStart or Lambda@Edge. Response streaming and Lambda Managed Instances work only if the runtime implements them.
  • Runtimes are Regional. A publisher creates the runtime, versions and aliases in each Region and keeps each version’s image in ECR for as long as the version exists.
  • Publishers can’t encrypt runtime resources with a customer managed KMS key, can’t code-sign runtime images and can’t publish runtimes with AWS SAM. Consumer functions keep KMS and code signing.
  • Deletion isn’t immediate. A publisher schedules it with a waiting period of 7 to 30 days, and a runtime version can’t be deleted while an alias points to it. If an alias or version is deleted, functions that use it go Inactive and invocations that need a cold start fail. Restoring the resource during the waiting period recovers them.

SnapStart is where AWS’s documentation and Napoli’s roadmap meet. AWS lists it as unsupported on customer-managed runtimes, while Napoli lists SnapStart, response streaming and Lambda Web Functions as research for v4 and says early SnapStart tests show it doesn’t help PHP as much as expected.


What to do now

  • On Bref v3: nothing changes. A PHP patch still means updating Bref and redeploying; October’s instruction was composer update bref/bref -W. Napoli says an upgrade guide will explain the switch when v4 is released.
  • Deploying PHP as a container image: a PHP update still means rebuilding the image, and Napoli says that stays true in v4.
  • Needing a pin, a staging step or the runtime in your own account: Napoli asks for feedback on the Bref Slack, and says this is the moment to say what layers do that runtimes don’t.
  • Running a platform team without Bref: AWS’s launch post says any language can be packaged, so a PHP runtime of your own is possible, with the patching and rollout falling to you.

Bref v4 is planned for the end of 2026 and hasn’t been released.


Sources


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.