Agent anatomy

Every agent created by Cast lives at ~/.cast/agents/<name>/. The directory is both the agent’s source of truth and its working tree — when you edit an agent with edit and the Builder writes changes, those changes show up as files on disk.

~/.cast/agents/email-assistant/
├── agent.yaml             # the agent's config
├── instructions.md        # the agent's system prompt ("the brain")
├── tools/                 # custom Python tools
│   └── summarize_thread.py
├── mcp/                   # MCP server configs (one YAML per server)
│   └── gmail.yaml
├── tests/
│   ├── cli/               # TypeScript CLI tests
│   └── agent/             # Python agent tests
│       └── scenarios/
│           └── triage.yaml
├── .cast/                 # Cast-managed metadata (do not hand-edit)
│   ├── changes/           # automatic snapshots
│   │   ├── changes.json
│   │   ├── 001.tar.gz
│   │   └── 002.tar.gz
│   └── releases/          # semantic releases
│       ├── releases.json
│       ├── 1.0.tar.gz
│       └── 1.6.tar.gz
├── .git/                  # if cast git init was run
├── Dockerfile             # written by cast deploy --provider docker
├── requirements.txt       # written by cast deploy
└── README.md              # written by cast git init

The files you own

The files Cast owns

What agent.yaml controls

SectionControls
descriptionone-line summary shown in cast list and the TUI
versioncurrent semantic version; cast release writes here
repositorygit remote, used by cast git push
brain.modelthe LLM the runtime agent calls
brain.instructions_filerelative path to the system prompt
tools.builtinwhich of bash / read / glob to expose
tools.mcplist of MCP server YAMLs to load
tools.customlist of tools/*.py modules to load
harness.permissionsper-tool permission level (always-allow / ask / deny)
harness.principlesconstitutional principles appended to the system prompt
runtime.python_versionPython version in the deployment image
runtime.requirementsextra pip packages to install in the image

Use cast describe <name> to see the full rendered file with defaults filled in. Use cast update <name> --<flag> ... to mutate it from the CLI without opening a text editor.