Join our Newsletter — 33% off our NHI Course
Home› Guides› HashiCorp Vault for Beginners: What It Stores and…
Guide Secrets Management

HashiCorp Vault for Beginners: What It Stores and How Apps Get Their Secrets

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 12 min read
On this page

HashiCorp Vault is a tool that stores passwords and keys for software and hands them only to approved apps.

This guide is for students, new developers and anyone who has heard "we keep that in Vault" and wants to know what it means. You do not need to run Vault yourself to be affected: if an app you build or support uses it, that app gets its passwords from Vault, not from its own files.

In short

  • Vault keeps software passwords, keys and certificates locked away, and stores them encrypted.
  • An app first proves who it is, then Vault checks a written rule before it hands anything over.
  • Vault can also make a brand new password on request, which expires after a set time.
  • Every request is written to a record, so you can see who asked for what.

What you will learn

  • Explain what Vault does in one sentence.
  • Follow the steps an app takes to get a secret from Vault.
  • Spot the difference between a stored password and one Vault makes on request.
  • Ask the right questions when you join a team that uses Vault.
Software password (secret)
a password, key, token or certificate that one program uses to prove who it is to another.
Pass (token)
what Vault gives an app after it proves who it is. The app shows it with each request.
Rule (policy)
a written list of which secrets a pass may read or change.

This is an independent guide from NHI Mgmt Group, based on HashiCorp's public documentation as of November 2026. It is not sponsored or reviewed by HashiCorp. Product features change, so confirm settings against HashiCorp's current documentation.

What is HashiCorp Vault?

Think of a bank's safe deposit boxes. Your valuables sit in a locked vault, and the bank checks who you are before you reach your box. Vault does the same for the passwords and keys that software uses.

Programs often need to log in to other things, such as a database (the place where an app keeps its records) or a payment service. To do that, they need a secret: a password, key or certificate. Without a tool like Vault, those secrets often end up typed into code or settings files, where many people can read them.

Vault keeps them in one guarded place instead. HashiCorp says Vault encrypts the data it stores, so the stored copy is scrambled, and controls who can reach it.[1] It can run on a company's own servers or in the cloud.

Where the comparison stops working: a bank gives back the same item you left. Vault can also make a brand new password on the spot, just for one app, and take it away again later. That is called a dynamic secret.

Why does it matter?

When secrets sit in files, anyone who can read the files can copy them, and nobody knows. Vault gives each secret a gatekeeper, a rule and a record. You are likely to meet it in many development and IT teams.

If you are learning to code

What could happen: you copy a real database password into your project "just to test", and it is shared with the code.

Check this: ask where the team keeps secrets, and get yours from there.

Next: Secrets in Code for Beginners

If you are joining a development team

What could happen: your app is given a rule that lets it read every secret, not just its own.

Check this: ask what your app's Vault rule allows, and whether it can be narrower.

Next: Secrets Management for Beginners

If you are new to IT operations

What could happen: the all-powerful setup pass is kept "in case", and later leaks.

Check this: confirm that root passes are used only for setup or emergencies, then removed.

Next: The Secret Zero Problem for Beginners

What does it look like?

Here is a made-up rule for a shop app. Under it is the reply the app gets when it asks for a database credential.

Example only. All values are made up.

# Rule (policy) for the shop app
path "secret/data/shop-app/*" {        (1)
  capabilities = ["read"]              (2)
}
# anything not listed is refused       (3)

# Reply when the shop app asks for a database credential
username: v-shop-app-EXAMPLE-0000      (4)
password: FAKE-password-0000
lease_duration: 1h                     (5)
  1. The place in Vault this rule covers: only the shop app's own secrets.
  2. The app may read them. It may not change or delete them.
  3. Vault refuses anything a rule does not allow.
  4. In a real file, this line would contain a credential Vault has just made for this app alone.
  5. How long the credential is valid. This value is made up for the example.

Why this is risky: without Vault, one password would sit in the app's files for years. Every copy of the app would share it.

The safer way: give each app a narrow rule. Where you can, give it a short-lived credential made just for it.

How does it work?

HashiCorp describes the same basic flow for every request.[1]

  1. The app proves who it is. It uses an auth method, a way of signing in, such as its cloud account or a company login system.
  2. Vault gives it a pass. This pass is called a token. HashiCorp says every token except the root one has a time limit. When it runs out, the token and its leases are cancelled.[3]
  3. Vault checks the rule. Vault refuses anything a rule does not allow. An empty rule allows nothing.[4]
  4. Vault hands over the secret. It is either a stored value or a new one made on request.
  5. Vault writes it down. HashiCorp says Vault records each request, whether it is allowed or refused.[1]
Diagram titled How an app gets a secret from Vault. An App box on the left and a Vault box on the right, joined by four numbered arrows: 1 Prove who I am, 2 Here is your pass (token), 3 Please may I have the database password, 4 Here it is, if your rule allows it. Under Vault, two small boxes: Rule checked, and Request recorded. A green bar says the app does not keep the password in its own files.
Figure 1. The app proves who it is, gets a pass, and asks. Vault checks the rule and records the request.

The parts of Vault that store or make secrets are called secrets engines. Two are common for beginners:

  • Key-value store. Like a labelled locker for stored secrets. In version 2, it keeps older versions of each secret, 10 by default.[6]
  • Database engine. It makes database credentials on request, based on set roles. Each service gets its own credential, which helps you trace who did what.[7]

A credential Vault makes comes with a lease: a time limit attached to the secret. The app can ask to renew it before it ends. HashiCorp says that cancelling a lease makes the secret invalid straight away.[5]

Before and after diagram titled One shared password or a fresh one for each app. Left panel, labelled Risky: one password in a settings file, shared by every copy of the app, rarely or never changed, with no record of who used it. Right panel, labelled Safer: Vault makes a credential for each copy, each credential has a time limit called a lease, Vault removes it when the lease ends, and each request is recorded. A green bar says a short-lived credential gives a thief less time to use it.
Figure 2. A stored, shared password compared with short-lived credentials that Vault makes for each app.

One more word you will hear is sealed. When Vault starts, it is sealed: it can reach its storage but cannot unscramble anything in it. Someone must unseal it, or it can be set up to unseal itself using a trusted outside service.[2]

A worked example

Umar Lindahl is a student on a summer placement at Ochre Brewery, a fictional brewery with an online shop. His mentor is Leila Rosen, a senior developer.

On day two, Umar finds an old copy of the shop app. Its settings file holds the database password in plain text. He asks Leila if he should use it to test his work.

Leila shows him how the current app works instead. When the shop app starts, it signs in to Vault using its cloud account. Vault gives it a pass. The app then asks for a database credential.

Vault checks the shop app's rule. The rule lets it read only its own secrets. Vault then makes a fresh database credential just for that copy of the app, with a one-hour lease. The settings file holds no password at all.

Umar asks for "the main Vault password" so he can look around. Leila explains that the root pass can do anything, so the team uses it only for setup or emergencies and removes it afterwards.[3] She gives Umar his own sign-in with a rule for the test area.

Last, they look at the old password in the forgotten file. It belongs to a database that was shut down, but Leila checks with the database owner to be sure. They delete the old copy and note it in the team's record.

Umar thinks of the safe deposit box. Nobody gets a key to every box, and the bank writes down each visit.

Myths and mistakes

What people thinkWhat is true
Once we use Vault, our secrets are safe.Vault helps a lot, but only if rules are narrow, root passes are removed and records are read.
Putting everything in one place means everyone can see everything.Vault refuses by default. Each app or person sees only what its rule allows.[4]
The root token is fine for everyday work.HashiCorp says root tokens are for setup or emergencies and should be removed when no longer needed.[3]
Deleting a stored secret removes it completely.In version 2 of the key-value store, a deleted version can be restored. Only "destroy" removes the data.[6]
A copy of the app's pass is harmless.A valid token can read whatever its rule allows until it expires. Treat it like a password.

What can I do this week?

  • Ask your team which secrets live in Vault and which still sit in files.
  • Read the rule for one app you work on, and check it covers only that app's secrets.
  • Check whether your database credentials are stored values or made on request.
  • Try HashiCorp's own getting-started tutorials on a practice copy, never with real secrets.

Checklist

  • Apps get their secrets from Vault, not from code or settings files.
  • Each app has its own rule that covers only the secrets it needs.
  • Root tokens are used only for setup or emergencies, then removed.
  • Credentials made on request are used where the service supports them.
  • Tokens and leases have time limits that match how long the work takes.
  • Vault's records are switched on, kept and looked at.
  • Someone owns each secret and knows what uses it.

Common questions

Is Vault the same as a password manager?

Not quite. A password manager mainly helps people store and fill in their own passwords. Vault is built mainly for software: apps sign in to it, follow written rules and can be given new, short-lived passwords. Some teams use both, each for its own job.

What does it mean when Vault is sealed?

It means Vault is locked. HashiCorp says a sealed Vault can reach its storage but cannot unscramble the data, so it cannot hand out secrets. Someone must unseal it with the right key parts, or a trusted outside service can unseal it automatically at start-up.

What happens if a password from Vault leaks?

Cancel it. For credentials Vault made, you can cancel the lease, and HashiCorp says the secret is then invalid straight away. For stored secrets, change the value at the service that uses it, then update Vault. Check the records to see who asked for it.

Do I need Vault for a small project?

Not always. We suggest starting with your hosting service's secure settings store for a small app. Vault earns its place when many apps, people and environments share secrets, or when you want credentials made on request and detailed records.

How can I learn Vault safely?

Start with HashiCorp's own tutorials on a practice copy that holds only made-up values. Learn rules, tokens and leases first, as most other features build on them. If you want a formal goal, see our HashiCorp Vault Associate guide.

Where next?

Ready for the detail? Read the practitioner guide: HashiCorp Vault Guide. It goes further into auth methods for workloads, writing and testing rules, and running Vault safely day to day.

Also useful:

Related NHI Mgmt Group resources: Secrets Management Guide · HashiCorp Vault Audit Log Detection Guide · Non-Human Identities for Beginners

Key terms

HashiCorp Vault
A tool for storing software secrets and controlling who can reach them, with encryption and records.
Secret
A password, key, token or certificate that software uses to prove it may act.
Auth method
The way an app or person proves who they are before Vault gives them a token.
Secrets engine
The part of Vault that stores, makes, renews or cancels a kind of secret.
Dynamic secret
A secret made on request for one job, and cancelled after use or when it expires.
Root token
A Vault pass that can do anything, meant only for setup or emergencies.
Auto-unseal
A setup where Vault unlocks itself at start-up using a trusted outside service.

Sources and further reading

  1. What is Vault? Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/what-is-vault, accessed 28 Nov 2026.
  2. Seal/Unseal. Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/concepts/seal, accessed 28 Nov 2026.
  3. Tokens. Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/concepts/tokens, accessed 28 Nov 2026.
  4. Policies. Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/concepts/policies, accessed 28 Nov 2026.
  5. Lease, renew, and revoke. Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/concepts/lease, accessed 28 Nov 2026.
  6. KV secrets engine. Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/secrets/kv, accessed 28 Nov 2026.
  7. Database secrets engine. Vault documentation, HashiCorp. https://developer.hashicorp.com/vault/docs/secrets/databases, accessed 28 Nov 2026.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.