Skip to content

Conversation

@tlecomte
Copy link
Contributor

This follows extism/extism#883 and Extism 1.13.0, which allows to create a CompiledPlugin with a fuel limit. Previously, we could only create a (non-compiled) Plugin with a fuel limit, or a CompiledPlugin without a fuel limit.

A CompiledPlugin with a fuel limit is interesting for the scenario where:

  • the host is instantiating many times the same wasm file (for example, a Python interpreter)
  • and needs a fuel limit to ensure resource usage is controlled while running untrusted scripts

On practical example is when using Extism to implement a Python sandbox in a .NET host, that is exposed as a tool to an LLM chatbot embedded in the app. The LLM can generate Python code that calls host functions or perform calculations to fulfill the user's request.

Setting a fuel limit is important for the security of the approach, since the executed code cannot be trusted, as it is produced by the LLM. The fuel limit ensures that resources stay in check, along with memory limits, time-based cancellation, and the isolation properties of WASM.

Until now, we could only use the non-compiled Plugin, since this one exposes the fuel limit. But it makes sense to use the CompiledPlugin, since the same wasm (the Python interpreter) is used over and over again.

@nilslice
Copy link
Member

Thank you! Will run CI and review over the a next few days.

@nilslice nilslice merged commit 67bc6b7 into extism:main Dec 1, 2025
3 checks passed
@nilslice
Copy link
Member

nilslice commented Dec 1, 2025

I'll publish a release once CI runs post-merge, thanks!

@nilslice
Copy link
Member

nilslice commented Dec 1, 2025

@tlecomte - the release is on its way out:
https://github.com/extism/dotnet-sdk/actions/runs/19838598857

@tlecomte tlecomte deleted the compiled-fuel branch December 5, 2025 07:15
@tlecomte
Copy link
Contributor Author

tlecomte commented Dec 5, 2025

Thank you very much @nilslice for the release! We have started using it, the new version works well.

@nilslice
Copy link
Member

nilslice commented Dec 5, 2025

Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants