import os
from polos import (
Agent, max_steps, MaxStepsConfig,
sandbox_tools, SandboxToolsConfig, LocalEnvironmentConfig,
)
workspace_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "workspace")
# Create sandbox tools that run locally on the host
tools = sandbox_tools(
SandboxToolsConfig(
env="local",
local=LocalEnvironmentConfig(
cwd=workspace_dir,
path_restriction=workspace_dir, # prevent file access outside workspace
),
# Exec defaults to 'approval-always' for local mode.
# Write and edit also require approval (file_approval defaults to 'always').
# You can override these defaults:
#
# exec=ExecToolConfig(
# security="allowlist",
# allowlist=["node *", "cat *", "ls *", "ls", "echo *"],
# ),
# file_approval="none", # disable write/edit approval
)
)