{"record":{"id":"1fac62092204bfd7","repo":"sipeed/picoclaw","slug":"windows-isolation-does-not-yet-support-expose-path","errorCode":null,"errorMessage":"windows isolation does not yet support expose_paths filesystem rules","messagePattern":"windows isolation does not yet support expose_paths filesystem rules","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/isolation/runtime.go","lineNumber":304,"sourceCode":"}\n\n// BuildWindowsAccessRules derives the host-path access policy used by the\n// Windows restricted-token backend.\nfunc BuildWindowsAccessRules(root string, overrides []config.ExposePath) []AccessRule {\n\tmerged := MergeExposePaths(nil, overrides)\n\trules := make([]AccessRule, 0, len(merged)+1)\n\trules = append(rules, AccessRule{Path: root, Mode: \"rw\"})\n\tfor _, item := range merged {\n\t\trules = append(rules, AccessRule{Path: item.Source, Mode: item.Mode})\n\t}\n\treturn rules\n}\n\nfunc validateWindowsExposePaths(items []config.ExposePath) error {\n\tif len(items) == 0 {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"windows isolation does not yet support expose_paths filesystem rules\")\n}\n\n// IsSupported reports whether the current platform has an implemented isolation\n// backend.\nfunc IsSupported() bool {\n\treturn isSupportedOn(runtime.GOOS)\n}\n\nfunc isSupportedOn(goos string) bool {\n\tswitch goos {\n\tcase \"linux\", \"windows\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// Preflight validates the configured isolation state and prepares the instance","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/isolation/runtime.go#L286-L322","documentation":"validateWindowsExposePaths returns this error whenever isolation.expose_paths is non-empty and the platform is Windows. The Windows backend currently enforces restricted token, low integrity and job-object limits only — it has no filesystem remapping for expose rules (see the note logged in platform_windows.go), so configuring any expose_paths entry on Windows aborts preflight rather than silently ignoring the rules.","triggerScenarios":"Enabling isolation on a Windows host with any expose_paths entry in the config — the check is a hard platform gate in Preflight (validateWindowsExposePaths receives the merged ExposePaths and errors if len(items) > 0).","commonSituations":"A config authored and validated on Linux carried over to a Windows deployment; CI matrix runs hitting the Windows leg; users assuming cross-platform parity of isolation features.","solutions":["Remove expose_paths from the config used on Windows hosts","Maintain per-OS config files/overrides so only Linux configs carry expose rules","Track the feature and re-enable once the Windows backend implements path exposure","If the paths must be reachable, rely on the instance root rw rule the backend already creates instead of expose_paths"],"exampleFix":"# before (config used on Windows)\nisolation:\n  enabled: true\n  expose_paths:\n    - {source: D:\\work, mode: rw}\n\n# after\nisolation:\n  enabled: true\n  expose_paths: []","handlingStrategy":"validation","validationCode":"// strip expose rules when generating config for windows hosts\nif runtime.GOOS == \"windows\" && len(cfg.Isolation.ExposePaths) > 0 {\n    return fmt.Errorf(\"expose_paths is linux-only; config for windows must not define it\")\n}","typeGuard":null,"tryCatchPattern":"if err := isolation.Preflight(); err != nil {\n    if runtime.GOOS == \"windows\" && strings.Contains(err.Error(), \"does not yet support expose_paths\") {\n        // config drift: windows host picked up linux isolation config\n        return fmt.Errorf(\"remove expose_paths from windows config: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep isolation config split per OS instead of one shared baseline","Run preflight in CI per target OS so a windows build catches expose_paths immediately"],"tags":["windows","platform-limitation","expose-paths","isolation"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}