Tencent/WeKnora · error

sandbox is not configured

Error message

sandbox is not configured

What it means

ExecuteScript refuses to run when the skills manager was constructed without a sandbox manager (m.sandboxMgr == nil). Skill scripts only run inside the sandbox, so without that dependency the manager can list/read skills but cannot execute them. It is an internal invariant/availability check, not a user-input error.

Source

Thrown at internal/agent/skills/manager.go:349

		return "", false
	}
	dir = strings.TrimSpace(dir)
	return dir, dir != ""
}

// ExecuteScript executes a script from a skill in the sandbox
func (m *Manager) ExecuteScript(ctx context.Context, skillName, scriptPath string, args []string, stdin string) (*sandbox.ExecuteResult, error) {
	if !m.enabled {
		return nil, fmt.Errorf("skills are not enabled")
	}

	if !m.isSkillAllowed(skillName) {
		return nil, fmt.Errorf("skill not allowed: %s", skillName)
	}

	// Verify sandbox manager is available
	if m.sandboxMgr == nil {
		return nil, fmt.Errorf("sandbox is not configured")
	}

	source := m.resolveSource(skillName)

	// Get the skill base path
	basePath, err := source.GetSkillBasePath(skillName)
	if err != nil {
		return nil, err
	}

	// Prepare execution config
	logger.Info(ctx, "[Tool][ExecuteScript]:Prepare execution config")
	sessionID, _ := types.SessionIDFromContext(ctx)

	// Compute the artifact output directory. All skills share the same root
	// directory (/workspace/output/) to enable collaboration and file sharing
	// between different skill executions in the same session.
	// Skill scripts read the directory via WEKNORA_SKILL_OUTPUT_DIR; the

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Enable and correctly initialize the sandbox manager so it is injected into the skills manager before ExecuteScript is called
  2. Check startup logs for sandbox initialization failure and fix the underlying cause (Docker/runtime unavailable, bad sandbox config)
  3. Verify the skills manager is constructed with the sandbox dependency, not a zero-value or partially initialized Manager
  4. If sandbox execution is intentionally unavailable, surface capability to the model instead of calling execute_skill_script

Example fix

// before
mgr, _ := skills.NewManager(cfg) // sandboxMgr nil when sandbox disabled
mgr.ExecuteScript(ctx, "pdf", "scripts/run.py", nil, "")
// after
cfg.SandboxManager = sandboxMgr // ensure sandbox is wired in
mgr, _ := skills.NewManager(cfg)
if err := mgr.ExecuteScript(ctx, "pdf", "scripts/run.py", nil, ""); err != nil {
    log.Fatal(err)
}
Defensive patterns

Strategy: try-catch

Validate before calling

if mgr == nil || mgr.SandboxMgrMissing() { // or check capability before executing
    return fmt.Errorf("sandbox execution unavailable")
}

Type guard

func sandboxReady(m *skills.Manager) bool {
    return m != nil && m.SandboxManager() != nil
}

Try / catch

cfg, err := mgr.ExecuteScript(ctx, skill, path, args, stdin)
if err != nil {
    if strings.Contains(err.Error(), "sandbox is not configured") {
        // degrade: report capability unavailable, fall back to shell_exec
        return nil, errSandboxUnavailable
    }
    return err
}

Prevention

When it happens

Trigger: Calling Manager.ExecuteScript on a manager built via NewManager (or config path) that never received/wired a sandbox.Manager — e.g. skills enabled in config but sandbox subsystem disabled or failed to initialize.

Common situations: Deployments with skills enabled but sandbox execution disabled; partial startup where sandbox init failed silently; tests constructing a manager without a sandbox; running in a mode (e.g. no-Docker host) that leaves sandboxMgr nil.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/a205de5061510b22. Report an issue: GitHub.