Skip to main content

Managed Files

Castari provides zero-configuration file storage for your agents. Upload files, attach them to agents, and they automatically appear in the sandbox.

Why Managed Files?

Your agents often need access to:
  • Data files (CSV, JSON, etc.)
  • Configuration files
  • Documents for processing
  • Reference materials
Managed files let you provide these simply without:
  • Setting up cloud storage buckets
  • Managing credentials
  • Configuring mount paths manually

How It Works

  1. Upload β€” Files go to Castari’s managed storage
  2. Attach β€” Link files to specific agents
  3. Mount β€” Files automatically appear at /files/agent/ in the sandbox

File Scopes

Files can be scoped for different uses:
ScopeDescriptionMount Path
userYour personal filesAvailable to attach
agentAttached to a specific agent/files/agent/
sessionPer-invocation outputs/files/session/

Uploading Files

Via CLI

cast files upload data.csv --description "Training data"

Via Dashboard

  1. Navigate to Files in the sidebar
  2. Click Upload File
  3. Select file and add optional description/tags

Via SDK

const result = await client.files.upload(fileBlob, 'data.csv', {
  description: 'Training data',
  tags: ['dataset', 'csv'],
});
console.log(result.file_id); // file_abc123

Attaching Files to Agents

Once uploaded, attach files to agents:

Via CLI

cast agents files add my-agent file_abc123

Via Dashboard

  1. Go to Agents β†’ your agent
  2. Find the Attached Files section
  3. Click Attach File and select from your files

Via SDK

await client.files.attachToAgent('my-agent', {
  fileId: 'file_abc123',
  readOnly: true,
});

Using Files in Agents

Attached files are available at /files/agent/:
import { readFileSync } from 'fs';

// Read attached file
const data = readFileSync('/files/agent/data.csv', 'utf-8');

// Parse and process
const rows = data.split('\n').map(line => line.split(','));
Files are read-only by default. Use --writable flag or set readOnly: false to allow writes.

Storage Limits

PlanStorage Limit
Free100 MB
Pro10 GB
EnterpriseCustom
Check your usage:
cast files usage
Total Files    12
Total Size     45.2 MB
Quota Used     45.2%
Quota Limit    100 MB

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 45.2%

Managed vs. BYO Storage

Castari supports both managed files and bring-your-own storage buckets:
FeatureManaged FilesBYO Buckets
SetupZero configConfigure credentials
StorageCastari hostedYour S3/GCS/R2
CostIncluded in planYour cloud costs
Use caseSimple filesLarge datasets
Use managed files for simplicity. Use Storage Buckets for large datasets or when you need files in your own cloud.

File Metadata

Each file tracks:
  • Filename β€” Original name
  • Size β€” File size in bytes
  • Content Type β€” MIME type
  • SHA256 Hash β€” Integrity verification
  • Description β€” Optional description
  • Tags β€” Optional tags for organization

Best Practices

Organization

  • Use descriptions β€” Document what each file is for
  • Tag consistently β€” Use tags like dataset, config, reference
  • Clean up β€” Delete files you no longer need

Security

  • Don’t upload secrets β€” Use Secrets for credentials
  • Verify hashes β€” Check SHA256 for critical files
  • Review attachments β€” Only attach files agents actually need

Performance

  • Keep files small β€” For large datasets, use BYO storage
  • Use appropriate formats β€” CSV/JSON for structured data
  • Consider caching β€” Files are cached in the sandbox

See Also