LLM Prompting
Dagger can be used as a runtime for AI agents.
Prompt mode
Dagger Shell lets you interact with the attached LLM using natural language commands. Each input builds upon previous interactions, creating a prompt chain that lets you execute complex workflows without needing to know the exact syntax of the underlying Dagger API.
"Prompt mode" can be accessed at any time in the Dagger Shell by typing >
. Here's an example:
source=$(container | from node | with-mounted-directory /src https://github.com/dagger/hello-dagger | with-workdir /src)
You have a container with source code in /src. Describe the source code.
Does the application have unit tests?
Find all the unit tests. Deduce what the application does. Describe it in one paragraph.
Supported models
Dagger supports a wide range of popular language models, including those from OpenAI, Anthropic and Google. Dagger can access these models either through their respective cloud-based APIs or using local providers like Docker Model Runner or Ollama. Dagger uses your system's standard environment variables to route LLM requests.
Observability
Dagger provides end-to-end tracing of prompts, tool calls, and even low-level system operations. All agent state changes are observable in real time.