import type { ResolvedSandboxPolicy, SandboxFilesystemPolicy, SandboxPathSet } from "#src/sandbox/types"; /** Canonical `sandbox.on-unavailable` values. */ export declare const SANDBOX_ON_UNAVAILABLE_VALUES: readonly ["refuse-spawn", "warn-and-spawn"]; /** Canonical `sandbox.network.default` values. */ export declare const SANDBOX_NETWORK_DEFAULT_VALUES: readonly ["allow", "deny"]; /** Hardcoded opt-in, fail-closed defaults (D2). */ export declare const DEFAULT_SANDBOX_POLICY: ResolvedSandboxPolicy; export interface SandboxPolicyResolution { policy: ResolvedSandboxPolicy; /** Invalid harmless scalars / ignored values — never block a spawn. */ warnings: string[]; /** * Security-relevant policy problems. An enabled policy with errors SHALL * refuse the role's spawn (checked by the spawner); `on-unavailable` does * NOT apply — it governs host capability, not malformed policy. */ errors: string[]; } /** POSIX-ish environment variable name. */ export declare function isValidEnvVarName(name: string): boolean; /** * V1 domain pattern: exact hostname, or ONE leading `*.` wildcard over a * registrable domain (>= 2 labels). No protocol, port, path, bare `*`, or * top-level-only wildcard (`*.com`). */ export declare function isValidDomainPattern(pattern: string): boolean; /** * Literal (glob-free) filesystem path entry. `~` / `~/...` expand to the real * user home later; `~user` forms and glob metacharacters are rejected. */ export declare function isLiteralPathEntry(entry: string): boolean; /** * Resolve the sandbox policy for one role from the raw canonical `sandbox` * blocks (`hardcoded ← subagent-global-defaults.sandbox ← role.sandbox`). * Pass the RAW canonical objects (kebab-case keys) or undefined. */ export declare function resolveSandboxPolicy(globalRaw: unknown, roleRaw: unknown, roleName?: string): SandboxPolicyResolution; /** * Expand and canonicalize the USER filesystem plane (task 2.4). * * - `~` / `~/...` expand against the REAL parent user's home (never a * harness's redirected child HOME). * - Relative entries resolve against the effective project/worktree dir. * - Existing paths are realpath-canonicalized through symlinks so precedence * and containment comparisons operate on real locations; nonexistent paths * keep their resolved absolute spelling (classified later — task 4.7). * * The returned canonical absolute paths are what audit persists — never the * user's original spelling. */ export declare function expandUserFilesystemPaths(filesystem: SandboxFilesystemPolicy, opts: { realHome?: string; effectiveProjectDir: string; }): { paths: SandboxPathSet; errors: string[]; }; //# sourceMappingURL=policy.d.ts.map