After understanding Vault's position in the ecosystem, it's time to dissect Vault's internals: how the storage backend and Vault Core work, the request flow, the initialization and unsealing process with Shamir's Secret Sharing, and the root token risk.

In episode 2, we mapped the entire secret management ecosystem and concluded that Vault is the right choice when the needs are complex: multi-cloud, dynamic secrets, encryption-as-a-service, PKI, and strict audit. Now, in episode 3, we'll open the hood and dissect Vault's core architecture and security concepts — from the storage backend, Vault Core, request flow, to the initialization and unsealing process.
Why is this episode important? Because Vault differs from other tools in one fundamental way: Vault locks itself down to protect its data. Every time the server restarts, Vault refuses to serve requests until it's "unsealed" — and understanding why this is designed that way will change how you view system security as a whole. In the real world, failure to understand this architecture is the root of nearly every operational mistake: operators who lose unseal keys, root tokens left in production, or incorrectly configured storage backends.
In this episode we'll cover: first, the core architecture — storage backend vs Vault Core (Barrier) and the request flow; second, initialization & unsealing with Shamir's Secret Sharing, including manual unseal and an introduction to auto-unseal; third, the root token risk and production best practices. Get your Vault CLI ready, because this episode is full of hands-on practice.
Before looking at the request flow, we need to understand Vault's two main layers: the storage backend and the Vault Core (Barrier). The two are often mistakenly treated as the same thing — yet their difference defines Vault's security model.
The storage backend is Vault's raw data storage location. It can be a file on disk, Consul, or Raft integrated storage. Think of it as a warehouse — the place where all items (encrypted data) are stored. The crucial point: the storage backend never stores data in plaintext. All data written to the storage backend has already been encrypted by Vault Core.
Vault Core is Vault's brain — specifically the part called the Barrier. The Barrier is the encryption layer that protects all data entering and leaving the storage backend. Every write is encrypted with the data encryption key, and every read is decrypted before being passed on to the secrets engine. Think of the Barrier as a warehouse guard who padlocks every item coming in and unlocks every item going out — without the key (the unsealed master key), this guard refuses to operate at all.
┌────────────────────────────────────────────────┐
│ VAULT CORE │
│ Auth Methods → Policies → Secrets Engines │
│ ───────────────────────────── │
│ BARRIER (encrypt/decrypt all data) │
└──────────────────────┬─────────────────────────┘
│ encrypted data
┌──────────────────────▼─────────────────────────┐
│ STORAGE BACKEND │
│ File / Consul / Raft (encrypted data, not │
│ plaintext) │
└─────────────────────────────────────────────────┘Important
The most important consequence of this design: even an attacker who steals the entire contents of the storage backend gets nothing readable — all they get is ciphertext. This is called defense in depth: secure in layers, not at a single point. The key to opening it lives outside the storage, held by the unseal key holders.
Now let's trace the journey of a request — for example vault kv get secret/api/database — from the client and back. The flow involves several security layers that work in sequence:
Client
│ (1) send token + request
▼
Auth Method ← (2) "Who are you?" — validates identity
│
▼
Policy Check ← (3) "What can you do?" — evaluates HCL policy
│
▼
Secrets Engine ← (4) "What data are you asking for?" — processes & returns data
│
▼
Storage Backend ← (5) "Store/read encrypted data" (through the Barrier)Let's break down these five steps:
Tip
An easy way to remember this flow: Auth = identity, Policy = permission, Engine = data type, Storage = storage. Every request passes through all four layers in sequence — none of them can be skipped. This is why Vault can promise "every access is audited": because there's no shortcut.
Now we enter the most distinctive part of Vault — and the one that surprises beginners the most: Vault is born in a locked state. Let's understand the process from the start.
When the Vault server first runs (for example, the production mode we set up in episode 0), it's in an uninitialized state — no keys yet, nothing yet. We must initialize Vault to create its first "cryptographic identity":
vault operator init
Unseal Key 1: 4fBvZ0QvK9hHlVY1Aq2mC3xE5rT6uI7oL8pM9nB0cV
Unseal Key 2: dE5rT6uI7oL8pM9nB0cV4fBvZ0QvK9hHlVY1Aq2mC3x
Unseal Key 3: mC3xE5rT6uI7oL8pM9nB0cV4fBvZ0QvK9hHlVY1Aq2mC
Unseal Key 4: pM9nB0cV4fBvZ0QvK9hHlVY1Aq2mC3xE5rT6uI7oL8
Unseal Key 5: t6uI7oL8pM9nB0cV4fBvZ0QvK9hHlVY1Aq2mC3xE5rT
Initial Root Token: hvs.Ga4y9JkL2mQ8zXcV1bN5wK3pR7dF6sH8jT0uY4aZ
Success! Vault is initializedThe output above is the most decisive moment in a Vault's life. There are two kinds of secret material here:
hvs.Ga4y...) — a token with total access to Vault. The only token that can do anything, including disabling secrets engines and creating other tokens.Caution
The output above appears only once and will never be shown again. If you lose the unseal keys and root token after Vault is restarted, all data in Vault is permanently lost and unrecoverable — that's the consequence of the "Vault never stores its keys" design. Store them securely in separate places (e.g. a password manager or HSM), and never keep them together.
Behind the output above is an algorithm called Shamir's Secret Sharing (SSS), invented by Adi Shamir in 1979. Its principle is elegant: a secret (the master key) is split into N parts (shares), and reconstructing the secret requires a minimum of K parts (threshold).
Master Key
│ split by Shamir's Secret Sharing
├──► Share 1 (Unseal Key 1)
├──► Share 2 (Unseal Key 2)
├──► Share 3 (Unseal Key 3)
├──► Share 4 (Unseal Key 4)
└──► Share 5 (Unseal Key 5)
Threshold = 3 → a MINIMUM of 3 shares is needed to unseal VaultWhy is this design so clever?
Warning
This is the concept beginners most often misunderstand: unseal keys are not encryption keys used directly to unlock data. They are puzzle pieces that, when enough are combined, reconstruct the master key — and the master key is what opens the Barrier. Collecting more shares gets closer to "enough" — not "better".
Every time Vault is restarted, it returns to the sealed state: the Barrier is locked, and all requests are rejected. The operator's job is to collect K shares in sequence to reconstruct the master key. This is called manual unseal:
vault operator unseal
Unseal Key (will be hidden): 4fBvZ0QvK9hHlVY1Aq2mC3xE5rT6uI7oL8pM9nB0cV
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 5
Threshold 3
Unseal Progress 1/3
Unseal Nonce a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5dNotice the transition: Unseal Progress 1/3 → 2/3 → when the third share is entered, Sealed changes to false and Vault starts accepting requests. This process must be repeated every time Vault restarts — and this is why manual unseal becomes a real operational challenge in production (imagine 3 servers in a data center, a power reboot, and the entire team having to gather and type in shares).
Note
In production practice, this manual unseal is performed by different operators from different locations — one share from person A's laptop, one from B, one from C. This ensures no single person can unseal Vault alone, and the entire process can be audited. Let's compare the sealed vs unsealed states:
vault status
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 5
Threshold 3
Version 1.18.3vault status
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 5
Threshold 3
Version 1.18.3The operational challenge of manual unseal gave birth to a modern solution: auto-unseal. Instead of humans collecting shares, Vault entrusts opening its Barrier to the cloud KMS services we already know from episode 2 — AWS KMS, GCP Cloud KMS, or Azure Key Vault.
storage "raft" {
path = "/vault/data"
}
seal "awskms" {
region = "ap-southeast-1"
kms_key_id = "arn:aws:kms:ap-southeast-1:123456789012:key/abc-1234"
}
listener "tcp" {
address = "0.0.0.0:8200"
}How it works: on boot, Vault calls the cloud KMS to decrypt the master key stored in encrypted form. No human intervention — server restarts, Vault automatically unseals, requests are served immediately. We'll cover auto-unseal in depth in episode 21.
| Aspect | Manual Unseal | Auto-Unseal |
|---|---|---|
| Human involvement | Required every restart | Not needed |
| Risk | Lost share = Vault permanently dead | Lost KMS access = Vault permanently dead |
| Recovery mode | Can be used when KMS has issues | Requires cloud KMS access |
| Operational effort | High (coordination of many operators) | Low |
| Best for | On-premise, air-gapped, no KMS | Cloud, HA clusters, auto-scaling |
Tip
The underlying principle is the same: Vault still doesn't store its unlock key in its own storage. Auto-unseal simply moves the "key guardian" from humans to the cloud KMS. Also note: manual unseal has a recovery mode advantage — if KMS is down, an auto-unseal Vault can be completely paralyzed, whereas a manual one can still be opened by humans. A trade-off to weigh wisely.
The second piece of secret material from the init process is the root token (hvs.Ga4y... at the start). It's a token with absolute access — it can do anything in Vault without being blocked by any policy. Let's discuss its risks and best practices.
# A root token can be regenerated by operators as long as valid
# unseal keys still exist — this is why access to unseal keys
# is also highly sensitive
vault operator generate-root -init
Nonce: a1b2c3d4-...
Started: truevault operator generate-root as long as unseal keys still exist — so revoking it doesn't mean "losing access forever," it means "closing the wide-open door temporarily."export VAULT_TOKEN='hvs.Ga4y9JkL2mQ8zXcV1bN5wK3pR7dF6sH8jT0uY4aZ'
vault token revoke hvs.Ga4y9JkL2mQ8zXcV1bN5wK3pR7dF6sH8jT0uY4aZ
Success! Revoked token (if it existed)Warning
If the root token leaks and isn't revoked promptly, the attacker holds the master key to every secret in the company. This is why in a mature production environment, the root token is revoked right after the initial setup, and all administrative activity moves to policy-based tokens. Build this habit now — even in your lab.
As a technical closer, these are the mistakes that most often haunt beginner Vault operators:
| # | Mistake | Consequence | Prevention |
|---|---|---|---|
| 1 | Storing unseal keys together in one place | One point of compromise = full access | Distribute across people/locations; threshold greater than 1 |
| 2 | Storing unseal keys in the same storage as Vault data | Violates the key/data separation principle | Separate physically & logically |
| 3 | Losing the unseal keys / root token | Vault data permanently lost | Secure backup + HSM; run disaster drills |
| 4 | Using the root token for daily operations | No meaningful audit; leak risk | Revoke root, use policy-based tokens |
| 5 | Assuming the storage backend stores plaintext | Misjudging the risk level of storage seizure | Remember: the Barrier always encrypts before writing |
Important
Vault architecture's golden rule: keys and data must never live in the same place. Unseal keys are the warehouse keys; Vault data is the merchandise in the warehouse. If both are stored in the same place, stealing that "one place" means stealing everything — and Vault's entire architecture design collapses. This isn't a suggestion; it's a fundamental security requirement.
In episode 3, we dissected Vault's internals: the difference between the storage backend (warehouse) and the Vault Core / Barrier (padlocking guard), the five-layer request flow from client to storage, the initialization process that produces unseal keys and a root token, the Shamir's Secret Sharing mechanism (N shares, K threshold), manual unseal vs auto-unseal, and the risks and best practices for managing the root token.
Key takeaways to remember:
Now you understand why Vault is secure. In episode 4, we start touching the most concrete part: the KV Secrets Engine — comparing KV v1 vs KV v2 with versioning, enabling a secrets engine, and practicing all the vault kv operations (put, get, list, rollback, destroy, undelete). This is the episode where we truly start "storing secrets" in Vault. Make sure your dev-mode Vault is still running and keep your enthusiasm up, because the real technical journey starts here!