Ephemeral Storage
Temporary storage allocated to a compute instance, container, or agent session that is automatically deleted when the process or session ends—providing high-performance scratch space without persistent data retention.
**Ephemeral storage** is intentionally temporary. Data written to it disappears when the container or compute session ends—unlike a database, object store, or durable disk that retains data across restarts. In agent workflows, ephemeral storage provides the working surface where an agent can download files, run code, decompress archives, write intermediate results, and generally treat the file system as a scratchpad without any of that activity persisting after the task completes.
The design benefit is twofold: performance and cleanup. Ephemeral storage in containerized environments is typically backed by fast local NVMe, while durable storage goes through network calls. For tasks that read and write many small files—compiling code, processing documents, running tests—the latency difference is significant. Cleanup is equally important: because ephemeral storage is wiped at session end, it cannot accumulate leftover credentials, user data, or intermediate artifacts that could create [[confidentiality]] or [[data-residency]] problems. Each agent task starts from a clean environment, which also helps reproducibility.
A common misconception is conflating ephemeral storage with the agent's in-context [[agent-memory]]. The context window holds the agent's active reasoning; ephemeral storage holds file-system artifacts the agent creates during execution. Another misconception is that ephemeral storage is inherently less secure than durable storage. The opposite is often true: because it cannot be exfiltrated after the task ends and cannot persist unauthorized data between sessions, ephemeral storage is often required by [[sandboxing]] policies for coding agents, browser agents, and data-processing workflows. The trade-off is that any results the agent needs to persist—reports, code changes, database updates—must be explicitly written to durable storage before the session ends or they are lost. See [[mcp-from-first-principles-to-production]] for how ephemeral storage integrates with MCP server design for isolated, session-scoped tool environments.
## Related Terms
- [[glossary/agent-memory|Agent Memory]] — the persistence layer (working, episodic, semantic) that maintains agent continuity - [[glossary/memory-agent|Memory Agent]] — a specialized agent that manages long-term knowledge retrieval and storage - [[glossary/sandboxing|Sandboxing]] — the isolation mechanism that prevents agent code execution from affecting the host system - [[glossary/confidentiality|Confidentiality]] — the information-security property that data is accessible only to authorised parties - [[courses/mcp-from-first-principles-to-production|Course: MCP from First Principles to Production]] — hands-on practice with the concepts covered in this entry