feat: expose building a CompiledPlugin with a fuel limit#883
Merged
nilslice merged 2 commits intoextism:mainfrom Nov 25, 2025
Merged
feat: expose building a CompiledPlugin with a fuel limit#883nilslice merged 2 commits intoextism:mainfrom
nilslice merged 2 commits intoextism:mainfrom
Conversation
nilslice
approved these changes
Nov 25, 2025
Member
nilslice
left a comment
There was a problem hiding this comment.
LGTM - fine to accept this without exposing a Rust SDK wrapper function for now until someone needs it or I have time to follow-up.
nilslice
pushed a commit
to extism/dotnet-sdk
that referenced
this pull request
Dec 1, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose a new method
extism_compiled_plugin_new_with_fuel_limitto build a CompiledPlugin with a fuel limit.Fixes #882