TL;DR: Teleport describes Phases as a forkable, rebased filesystem model for containers, letting saved work persist while base layers continue to update. That shifts container governance from one-time image builds to controlled state inheritance, which matters as agentic and human workflows increasingly share mutable environments.
At a glance
What this is: NHI Mgmt Group's analysis, drawing on Teleport's blog post: Phases turns container filesystems into forkable, rebased state, allowing persistent workspaces to keep pace with upstream patching.
Why it matters: This matters because container state, build provenance, and workload identity increasingly intersect, and practitioners need a model that separates durable work from rebuilt runtime layers.
👉 Read Teleport's blog post on Phases for container filesystem state and rebasing
Context
Container builds usually blur three different questions: what should persist, what should be regenerated, and what should be updated from upstream. That becomes a governance problem when the same environment must support long-lived developer work, repeatable builds, and periodic security patching without turning every change into a full rebuild.
In Teleport's model, the key shift is that filesystem state is no longer treated as one opaque image history. Instead, mutable workspace state, rebuilt runtime layers, and copied files are governed separately, which is a useful lens for secrets in container images and other persistent artefacts that outlive a single build.
Key questions
Q: How do container image layers differ from Git commits?
A: Container image layers are addressable filesystem snapshots, not a linear history of every change. A manifest points to the layers that make up the final image, and those layers can be reused or replaced independently. That is why rebuilds, rebases, and caching behave differently from a Git branch history.
Q: How should teams separate persistent workspace state from rebuilt layers?
A: Persistent workspace state should live in dedicated volumes or mounted directories, while rebuilt layers stay immutable and disposable in the image or container filesystem. Separate config, cache and data paths from code and dependency layers, then mount only the needed paths back into the runtime. That keeps rebuilds predictable and avoids overwriting state during image replacement.
Q: What is the difference between snapshot layers and rebuild layers?
A: Snapshot layers capture a filesystem point in time, usually for storage, backup or clone purposes, while rebuild layers are produced again from a definition such as a container image or build recipe. Snapshot layers preserve existing state. Rebuild layers are meant to be recreated from source, which makes them easier to replace and verify.
Q: Why do container rebuilds need explicit path boundaries?
A: Container rebuilds need explicit path boundaries so the build process only reads and writes the intended source, cache and output locations. Without clear boundaries, a rebuild can pick up host files, write outside the build context, or overwrite data that should stay persistent. Path boundaries also make mounts, bind paths and exclusions predictable during repeatable builds.
Technical breakdown
Why container layers are not Git commits
Container image layers are content-addressed snapshots, but they are not a linear commit history. A manifest points to a set of layers, and those layers can be reused, replaced, or combined without cryptographically chaining every change to the previous one. That flexibility is what makes rebasing possible, but it also means build assumptions about “what changed when” are weaker than many teams assume. For identity and security teams, the important point is that persistence and provenance are separate questions. A layer can remain available long after the command that created it is no longer the right source of truth.
Practical implication: Treat image assembly as a governed state model, not a sequential audit trail.
How rebuild, snapshot, and copy phases split responsibility
Phases separates filesystem responsibility into three patterns. Snapshot phases preserve writable workspace state, rebuild phases rerun commands to refresh everything outside the saved home path, and copy phases inject fixed files or overlays that can be reused across environments. This gives a container the feel of a forkable workspace while still allowing upstream patching. The architecture matters because the same path can be owned by different phase types, so the system has to prevent collisions and corruption when mutable and regenerated content overlap. That is a stronger model than a single monolithic build step.
Practical implication: Define which paths are durable workspace state and which must always be rebuilt.
Why rebasing changes patching economics for long-lived workloads
Rebasing lets a new base image flow underneath existing application and workspace layers without forcing a complete rebuild of everything above it. That reduces the operational penalty of patching, especially when many workloads share the same base but differ in their upper layers. The security value is not just speed. It is the ability to keep environments current while preserving saved work, which is the same tension that shows up in persistent developer environments, agentic runtimes, and other systems where state cannot simply be thrown away. The model only works if rebuild boundaries are explicit and controlled. Read Top 10 Container Security Risks.
Practical implication: Use rebase boundaries to keep runtime patching separate from user state.
Threat narrative
Attacker objective: Preserve or exploit durable container state across rebuilds so stale artefacts, copied files, or embedded secrets survive longer than intended.
- Entry begins with a mutable container environment that can absorb copied files, rebuilt layers, and saved workspace state without a single immutable boundary.
- Credential and state access then concentrate in the persistent home layer and surrounding filesystem paths, where long-lived content can outlast the build that created it.
- Escalation happens when a stale or overbroad layer model allows old dependencies, copied artefacts, or persisted secrets to remain trusted after the base changes.
- Impact is a container estate whose runtime state, rebuild state, and persistence state are no longer cleanly separated, increasing the blast radius of patching and workspace reuse.
Breaches seen in the wild
- EmeraldWhale Git config credential theft: Tokens in exposed .git/config files let EMERALDWHALE clone private repositories and steal more than 15,000 cloud credentials.
- CI/CD pipeline exploitation case study: Credentials in an exposed .git/config let a researcher edit a Bitbucket pipeline so it planted their SSH key on the server. No victim was named.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
State separation becomes the real control plane: the important question is no longer whether a container is immutable or mutable, but which parts of its filesystem are allowed to persist across rebuilds. That is a governance problem for modern developer and agentic environments because saved work, copied files, and rebuilt layers each carry different trust assumptions. Practitioners should map those state classes explicitly before they let environments fork or rebase.
Persistent container state creates a secrets problem as much as a build problem: once credentials, configuration files, or copied artefacts live inside reusable layers, the environment can keep trusting them after the original context has changed. That is why persistence boundaries matter for secrets in container images and for any workload that keeps local state between sessions. Security teams need to treat leftover state as an ownership and lifecycle issue, not just a hygiene issue.
Rebasing is only safe when rebuild boundaries are explicit: automatic base updates sound simple, but the harder question is what remains untouched when the base changes underneath a saved workspace. The model is useful precisely because it exposes that trade-off instead of hiding it. Practitioners should decide which layers are allowed to drift, which must refresh, and which state must be forked away from the refresh path.
Agentic and human workflows now share the same persistence risk: once a runtime supports interactive state, long-lived workspaces, and service-backed execution, identity governance starts to matter inside the container itself. Access scope, filesystem persistence, and runtime rebuild rules become intertwined. That makes the environment a governance object, not just an execution target, and teams should manage it as such.
What this signals
Filesystem state is now a governance object: once a platform supports forkable workspaces, periodic rebuilds, and copied overlays, the control question shifts to ownership of persisted paths. That is where identity, workload lifecycle, and container security start to overlap, especially when developers or agents can resume work in a previously saved environment.
Security teams should expect more pressure to distinguish runtime refresh from user persistence as container platforms move toward editable, long-lived environments. The next failure mode is not just stale software, but stale trust in files, layers, and saved workspace content that should have been retired.
For practitioners
- Define filesystem ownership boundaries Separate durable workspace paths from rebuilt runtime paths before you adopt any forkable container model, so state cannot drift into the wrong lifecycle.
- Inventory copied and persisted artefacts Track which files, credentials, and configuration items enter containers through copy phases or interactive writes, then treat them as governed state.
- Set explicit rebuild scopes Limit which directories and dependencies can be refreshed automatically, and document the paths that must remain outside the rebuild path.
- Separate runtime state from build provenance Require a clear handoff between the layer that captures user changes and the layer that refreshes dependencies, so patching cannot overwrite saved work.
- Review persistence for agentic workspaces If agents or developers can fork environments, make sure the saved state is tied to a named owner and an offboarding point rather than an open-ended snapshot.
Key takeaways
- Phases addresses a real container governance problem: how to let work persist without letting stale state, copied artefacts, or old dependencies linger unchecked.
- The model matters because rebuilds, snapshots, and copies carry different trust assumptions, and those assumptions have to be separated before environments are reused at scale.
- Practitioners should define ownership and lifecycle boundaries for every persistent path, then keep rebuild scopes narrow enough that patching does not corrupt saved work.
Related NHI Mgmt Group resources: Secrets in Container Images and Build Artefacts Guide · Top 10 Container Security Risks · Guide to SPIFFE and SPIRE
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Persistent container layers can retain secrets and copied artefacts after the original context changes. |
| NHI-07 — Long-Lived Secrets | The post's persistence model is directly about content that remains trusted longer than its original session. | |
| Recommendation — Scan reused filesystem layers for retained secrets and revoke anything that survives beyond its intended lifecycle. Shorten the lifetime of persisted container state and rotate credentials that outlive their intended workspace. | ||
| MITRE ATT&CK | TA0006;TA0008 — Credential Access; Lateral Movement | Stale container state can preserve access paths that support credential abuse and spread across workloads. |
| Recommendation — Map persistent layer abuse to credential access and lateral movement techniques in your detection rules. | ||
| NIST CSF 2.0 | PR.DS-01 — Data-at-Rest Is Protected | Saved workspace content and copied artefacts are data at rest that needs explicit protection boundaries. |
| Recommendation — Protect persisted workspace data with clear storage controls and lifecycle rules for retained container state. | ||
| CIS Controls v8 | CIS-5 — Account Management | Long-lived interactive workspaces need explicit ownership and offboarding of access to saved environments. |
| Recommendation — Tie container workspace access to named owners and revoke dormant access when the environment is no longer needed. | ||
Key terms
- Container Image Layer: A container image layer is one step in the stacked filesystem that makes up an image. Layers can preserve files, secrets, and configuration from earlier build steps even when those items are no longer visible in the final image state. That persistence is why layer-level inspection matters for identity and secret governance.
- Rebase: Rebase is the process of changing a branch or code line so its commits are replayed onto a different base commit or upstream branch. In version control, it rewrites the commit chain to make history appear as if the work started from the new base, which can affect merges and shared repository history.
- OverlayFS: OverlayFS is a union filesystem that presents two or more directories as a single view. It uses a lower, read-only layer and an upper, writable layer, then merges them at runtime so files appear combined. In Linux containers and images, it helps isolate filesystem changes while keeping the base layer intact.
- Pivot Root: Pivot Root is a Linux system call and mounting operation that changes a process's apparent root filesystem to a new location. It is used in container setup and chroot-like isolation, where the old root can be unmounted after the switch to reduce filesystem exposure.
What's in the full article
Teleport's full blog post covers the implementation detail this post intentionally leaves at the architectural level:
- How Phases maps rebuild, snapshot, and copy responsibilities into separate filesystem lifecycles
- How the Beams runtime uses Kubernetes, Kata Containers, and Cloud Hypervisor to isolate builds
- How the builder uses OverlayFS, pivot_root, and cgroup freezing to capture state safely
- How registry metadata updates drive rebasing without forcing a full rebuild of every layer
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity, and secrets management. It helps practitioners connect identity controls to the broader security programme they operate.
Published by the NHIMG editorial team on November 16, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org