Interface ISandbox
- Namespace
- JD.AI.Sandbox.Abstractions
- Assembly
- JD.AI.Sandbox.dll
Contract for a process isolation layer that enforces capability restrictions on a child process based on a SandboxPolicy.
public interface ISandbox
Properties
Platform
Which platform this sandbox targets.
SandboxPlatform Platform { get; }
Property Value
Policy
The policy this sandbox enforces.
SandboxPolicy Policy { get; }
Property Value
Methods
RunAsync(string, string, CancellationToken)
Runs the sandboxed process to completion and returns the result.
Task<SandboxExecutionResult> RunAsync(string executablePath, string arguments = "", CancellationToken ct = default)
Parameters
executablePathstringargumentsstringctCancellationToken
Returns
StartAsync(string, string, CancellationToken)
Starts a new sandboxed process using the configured policy.
Task<SandboxedProcess> StartAsync(string executablePath, string arguments = "", CancellationToken ct = default)
Parameters
executablePathstringPath to the executable to run.
argumentsstringCommand-line arguments.
ctCancellationTokenCancellation token.
Returns
- Task<SandboxedProcess>
A handle to the running sandboxed process.