import React from "react"; import { Shield, FileText, Upload, Network, AlertTriangle } from "lucide-react"; import { Card } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { Badge } from "@/components/ui/badge"; import { type Agent } from "@/lib/api"; import { cn } from "@/lib/utils"; interface AgentSandboxSettingsProps { agent: Agent; onUpdate: (updates: Partial) => void; className?: string; } /** * Component for managing per-agent sandbox permissions * Provides simple toggles for sandbox enable/disable and file/network permissions */ export const AgentSandboxSettings: React.FC = ({ agent, onUpdate, className }) => { const handleToggle = (field: keyof Agent, value: boolean) => { onUpdate({ [field]: value }); }; return (

Sandbox Permissions

{!agent.sandbox_enabled && ( Disabled )}
{/* Master sandbox toggle */}

Run this agent in a secure sandbox environment

handleToggle('sandbox_enabled', checked)} />
{/* Permission toggles - only visible when sandbox is enabled */} {agent.sandbox_enabled && (

Allow reading files and directories

handleToggle('enable_file_read', checked)} />

Allow creating and modifying files

handleToggle('enable_file_write', checked)} />

Allow outbound network connections

handleToggle('enable_network', checked)} />
)} {/* Warning when sandbox is disabled */} {!agent.sandbox_enabled && (

Sandbox Disabled

This agent will run with full system access. Use with caution.

)}
); };