/**
 * SandboxStage - DefenseInDepthBox activation.
 *
 * Activates the defense-in-depth sandbox before script interpretation.
 * The handle is stored on the context for cleanup in the pipeline's
 * finally block.
 */
import { DefenseInDepthBox, } from "../../security/defense-in-depth-box.js";
export class SandboxStage {
    name = "sandbox";
    config;
    constructor(config) {
        this.config = config;
    }
    async execute(context) {
        if (this.config) {
            const box = DefenseInDepthBox.getInstance(this.config);
            context.defenseHandle = box.activate();
        }
        return { continue: true, context };
    }
}
