Overview
Filesystem is used to manage files and directories inside the sandbox. Agents commonly use it to write input files, generate code, read test results, upload large files, and download artifacts.
Common capabilities
sandbox.files.read()/sandbox.files.write(): read and write files.sandbox.files.list(): list directory contents.sandbox.files.exists(): check whether a path exists.sandbox.files.getInfo(): get file or directory metadata.sandbox.files.makeDir(): create directories.sandbox.files.remove(): delete files or directories.sandbox.files.rename(): move or rename files or directories.Custom file metadata: not currently supported by FC Agent Sandbox.
sandbox.uploadUrl()/sandbox.downloadUrl(): generate upload or download URLs.
Recommended path
Use the Filesystem API first for small files, binary content, streams, and agent-generated code. Use upload and download URLs when a browser or another environment without SDK credentials needs to upload or download files. Data that must be retained across sandboxes should be written to external persistent storage.
Directory watching can be used to wait for agent output files or sync task artifacts. For details, see Watch for Changes.