from enum import Enum, auto
from dataclasses import dataclass, field
from typing import List, Optional

class NetworkPolicy(Enum):
    NONE = auto()       # No network access
    WHITELIST = auto()  # Only specific domains (e.g., Armorer APIs)
    OPEN = auto()       # Full internet access

class FilesystemPolicy(Enum):
    NONE = auto()       # No filesystem access
    ISOLATED = auto()   # Only a specific isolated volume
    SCOPED = auto()     # Specific host directories
    HOME = auto()       # Full home directory (High Risk)
    ROOT = auto()       # Full root access (Extreme Risk)

@dataclass
class RiskProfile:
    name: str
    description: str
    network_policy: NetworkPolicy
    filesystem_policy: FilesystemPolicy
    human_in_loop: bool = True
    allowed_paths: List[str] = field(default_factory=list)

    @property
    def is_safe(self) -> bool:
        return self.filesystem_policy in [FilesystemPolicy.NONE, FilesystemPolicy.ISOLATED]
