Core Dagger Types
Core Dagger types are the vocabulary of module APIs. They represent values the engine understands deeply: content, execution, services, secrets, generated changes, environment, and model interaction.
Use these types to make boundaries explicit and composition natural.
Types Every Module Author Should Know​
Container: a filesystem, environment, execution, and publish pipeline.Directory: a content-addressed tree.File: a content-addressed file.Secret: sensitive data passed without exposing plaintext.Service: a long-running endpoint for other work to use.Changeset: a proposed diff against a directory or workspace.Env: a set of values and resources that can pass through workflows.LLM: model interaction when enabled for a module.
Type Design Principles​
| Prefer | Because |
|---|---|
Directory or File over string paths. | Dagger can track content, cache accurately, and make host boundaries explicit. |
Secret over string credentials. | Callers and traces can preserve secrecy by construction. |
Service over localhost strings. | Startup, ports, and dependencies become part of the graph. |
Changeset over silent writes. | Generated changes become reviewable and composable. |
| Structured objects over JSON strings. | Callers can discover fields and compose results without parsing. |
Reference Boundary​
This chapter should teach how module authors think with core types. It should not duplicate every field from the Types Reference.
TODO: Link each core type to its reference page and add author-focused guidance for when to accept it, when to return it, and common mistakes.