AbpSandbox 0.2.1

dotnet add package AbpSandbox --version 0.2.1
                    
NuGet\Install-Package AbpSandbox -Version 0.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AbpSandbox" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AbpSandbox" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="AbpSandbox" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AbpSandbox --version 0.2.1
                    
#r "nuget: AbpSandbox, 0.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AbpSandbox@0.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AbpSandbox&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=AbpSandbox&version=0.2.1
                    
Install as a Cake Tool

AbpSandbox

Untrusted work in containers, for ABP applications on .NET 10. Unpack and check an uploaded package, run a script an agent wrote, convert a file someone brought in: in a container that has no network, a read-only root, no privileges and a user that isn't root, within limits of time, memory, CPU, processes and bytes, and that is removed when it's done.

Preview. 0.x versions may change their API in any minor version (SemVer). Pin an exact version.

Not a Volosoft project. ABP Framework is made and owned by Volosoft. AbpSandbox is an independent enhancement that works on ABP: this repository and its packages don't belong to Volosoft, and aren't affiliated with or endorsed by them.

What it does

  • Runs, thrown away: a container gets files, runs one command, gives back its exit code, its output and the files asked for, and is removed whatever happened. Past its time it's killed.
  • Sessions, kept: a container kept for an owner under a key (an agent's chat, say), where commands run and files go in and out between calls, until it's closed, idle too long, or past its lifetime.
  • Prepared images, cached: a request may name preparation steps; the first time they run they're saved as an image, and later requests with the same base, steps, files and owner start from it.
  • A warm pool, kept running: containers started ahead of need, so a run doesn't wait for one; each serves one run and is replaced, so nothing one run left reaches the next.
  • The operator's rules: images are names the settings map to pinned references, never something a request or an upload chooses; limits have defaults and maxima; the sweep removes what's past its time, even another server's.

Why and how: docs/adr/0001. Coming from ABP's module template? Where ABP's layers are in this repository.

Packages

Package What it holds
AbpSandbox.Contracts ISandbox, requests and results, and the provider seam (ISandboxProvider). Nothing but .NET.
AbpSandbox The ABP module: the policy, runs, sessions, prepared images and the sweep.
AbpSandbox.Docker The Docker provider, through the Engine API (Unix socket, Windows named pipe or TCP).
AbpSandbox.Remote The base for cloud providers: a runner beside the work in each task, jobs through object storage (ADR 0002).
AbpSandbox.Fargate The AWS Fargate provider: ECS tasks, jobs through S3. deploy/aws makes the closed network it needs.
AbpSandbox.Agents Tools for AbpAgent: sandbox_run, sandbox_exec, sandbox_put, sandbox_get, opt-in and asking first. Depends only on AbpAgent.Contracts.

An Azure (Container Instances) provider fits the same base, and Kubernetes comes later. Docker's containers share the server's kernel: use it for development and a host's own checks; code from strangers belongs on Fargate, whose tasks are each their own small virtual machine.

Use it

[DependsOn(typeof(AbpSandboxDockerModule))]
public class MyModule : AbpModule { }

Nothing runs until the settings name a provider (docker, fargate); a host may load several and pick by site. ISandbox.CheckAsync says whether the sandbox can run now, and why not.

"AbpSandbox": {
  "Provider": "docker",
  "Images": { "alpine": "alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc" },
  "MaxTime": "00:05:00"
}
SandboxResult result = await sandbox.RunAsync(new SandboxRequest
{
    Owner = "review:" + versionId,
    Image = "alpine",
    Command = ["sh", "-c", "unzip -q package.zip -d out && ls -R out"],
    Files = [new("package.zip", bytes)],
});

Build and test

dotnet build and dotnet test. The Docker provider's tests run against a real engine when ABP_SANDBOX_DOCKER=1 (and ABP_SANDBOX_DOCKER_ENDPOINT for one that isn't the platform's own).

Releasing

The version is VersionPrefix and VersionSuffix in Directory.Build.props, and CHANGELOG.md needs an entry for it. Pushing the tag v<version>, such as v0.1.0, runs the checks. GitHub Actions then pushes the packages to nuget.org through Trusted Publishing, with no stored key, and makes a GitHub release. Set it up once:

  1. On nuget.org, signed in as the account that will own the packages: Trusted Publishing, add a policy with owner tekthar, repository abp-sandbox, workflow file ci.yml and environment release.
  2. On GitHub, in the repository's Settings: an environment release, and the Actions variable NUGET_USER, the nuget.org profile name of the account in step 1.
  3. Release: git tag v<version> && git push origin v<version>.

License

Apache License 2.0: see LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on AbpSandbox:

Package Downloads
AbpSandbox.Remote

AbpSandbox's base for cloud providers (AWS Fargate, Azure Container Instances): a task of three containers, a runner beside the work, and jobs through object storage with signed links.

AbpSandbox.Agents

AbpSandbox for AbpAgent: tools that give an agent a computer with no network (run a command, keep a session, put and get files), opt-in and asking first.

AbpSandbox.Docker

AbpSandbox's Docker provider: containers through the Docker Engine API (a Unix socket, a Windows named pipe or TCP), with no network, a read-only root, no capabilities and a user that isn't root.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.1 133 11/16/2026
0.2.0 154 11/13/2026
0.1.0 134 11/13/2026