Vault attaches access policies to tokens. The distinction between service and batch tokens shows up constantly in day-to-day operations and is also a frequent Associate exam topic.
This article organizes the lifecycle, constraints, representative use cases, and selection criteria from a practitioner's perspective. Minor behavior may shift between versions, but the fundamentals covered here are stable.
Vault tokens come in two broad flavors: service and batch. A service token is a persistent token with server-side state that you can renew, revoke, and look up. A batch token is a lightweight token that is not stored server-side; its expiry and permissions are fixed at issuance, and it cannot be renewed or individually revoked.
Their verification flows differ. Service tokens consult the token store on every request, while batch tokens are verified by signature and the metadata embedded in the token itself. Batch is the default pick for high-throughput, short-lived workloads; service is the default for long-running services.
Service vs batch verification flow
Start by issuing a default (service) token and inspecting it
vault token create -policy=default -ttl=1h
# 出力されたトークンを lookup(service は可能)
vault token lookup s.XYZ...
Because service tokens are kept in the token store, you can look them up, renew them, revoke them immediately, perform partial revocation by accessor, or cascade-revoke a token tree. Use them for long-running applications, daemons, and Vault Agent auto-renewal scenarios.
They support management features like periodic tokens (usable indefinitely as long as they keep being renewed) and orphan tokens (unaffected by parent revocation). The cubbyhole, a per-token transient KV store, is also a service-token-only feature.
Typical operations (renew, revoke, periodic, orphan)
# service トークン発行(1時間)
vault token create -policy=app -ttl=1h
# 更新(さらに30分延長、max_ttl に依存)
vault token renew s.ABC... 30m
# 即時失効(ID で)
vault token revoke s.ABC...
# アクセサーで失効
evault token revoke -accessor hvs.abc...
# periodic トークン(24時間周期で更新必須)
vault token create -policy=agent -period=24h
# orphan トークン
evault token create -policy=ops -orphan
Batch tokens are lightweight tokens that are not recorded in server storage. Verification relies on a signature and embedded metadata. They cannot be renewed, individually revoked, or looked up. They fit short-lived, high-throughput workloads such as CI/CD, serverless, batch processing, and map-reduce jobs.
A key distinction: the TTL and policies determined at issuance are frozen for the token's lifetime. Subsequent changes to roles, identity groups, or policies do not modify the permissions of previously issued batch tokens.
Issuing a batch token and confirming the constraints
# batch トークンを 15 分で発行
vault token create -type=batch -policy=build -ttl=15m
# lookup は失敗(batch は参照不可)
vault token lookup s.BATCH... # => エラー: batch token は lookup 不可
# revoke も不可(期限到来を待つ)
vault token revoke s.BATCH... # => エラー: batch token は revoke 不可
Pick based on whether you need lifecycle management and whether policy changes must propagate. If you need long-running tokens, immediate permission changes, or forced revocation, choose service. If you want per-job, short-lived, high-volume issuance with minimal overhead, choose batch.
For exam preparation, lock in the fact that batch tokens cannot be renewed, revoked, or looked up, and that their policy is fixed.
| Item | Service Token | Batch Token | Exam Takeaway |
|---|---|---|---|
| Server-side state | Yes (token store) | None (not stored) | Batch is never persisted |
| Renew | Supported (bound by max_ttl/period) | Not supported | Batch is always non-renewable |
| Revoke | Immediate (by ID, accessor, or prefix) | Not supported (TTL only) | You cannot individually revoke a batch token |
| lookup | Supported | Not supported | Batch cannot be looked up |
| cubbyhole | Supported | Not supported | Batch has no cubbyhole |
| Policy propagation | Evaluated per request (later changes propagate) | Frozen at issuance | Permission changes after issuance do not apply to batch tokens |
Example: using token_type with AppRole
# AppRole で batch を発行する role を作成
vault write auth/approle/role/ci \
token_policies=build \
token_ttl=15m \
token_max_ttl=30m \
token_type=batch
# 長期運転サービス向けの service 役割
evault write auth/approle/role/app \
token_policies=app \
token_ttl=1h \
token_max_ttl=24h \
token_type=service
Renewal and revocation are the operational pillars for service tokens. Use Vault Agent auto-renewal, design max_ttl thoughtfully, and standardize accessor-based partial revocation. Tree and prefix revocation are powerful for mass invalidation during incidents.
Batch tokens lean on short TTLs to time-box leak exposure. Because you cannot revoke them individually, contain leaks by disabling the role or issuance path and temporarily isolating the affected system. Also consider your Vault token verification key rotation policy (any operational change must be validated carefully ahead of time).
Minimal example: auto-renew a service token with Vault Agent
# agent.hcl の一例
auto_auth {
method "approle" {
mount_path = "auth/approle"
config = {
role_id_file_path = "/etc/vault/role_id"
secret_id_file_path = "/etc/vault/secret_id"
}
}
sink "file" {
config = { path = "/var/run/vault/token" }
}
}
cache {
use_auto_auth_token = true
}
listener "tcp" { address = "127.0.0.1:8200" tls_disable = true }
When you see keywords like renew, revoke, lookup, or cubbyhole, instantly recognize that batch does not support them. Another frequent topic is whether policy changes after issuance propagate (service tends to propagate; batch is frozen).
Watch for use-case translation questions, too. Long-running services and Agent flows belong to service tokens; CI/CD and serverless workloads belong to batch tokens.
Minimal commands to validate your understanding
# batch かどうかの違いを体で覚える
vault token create -type=batch -policy=dev -ttl=10m
vault token lookup <batch_token> # 失敗するはず
vault token create -policy=dev -ttl=10m
vault token lookup <service_token> # 成功するはず
Associate
問題 1
A short-lived CI job reads secrets from Vault. The permissions at issuance time are sufficient, and individual renewal or immediate revocation is not required. Which token type should you choose, and which statement about that token is correct?
正解: A
Batch is the right fit for short-lived workloads like CI. Batch tokens are non-stored, non-renewable, and non-revocable; the permissions captured at issuance are frozen until the TTL expires. B is wrong (batch tokens have no periodic option). C is wrong (service tokens have accessors and can be revoked). D is wrong (cubbyhole is available on service tokens, and batch is the lighter issuance path).
Can I use dynamic secrets with a batch token?
Reading dynamic secrets itself works. Secret leases are managed by the secret engine, so retrieval and expiration still function even when the caller uses a batch token. However, because the token itself cannot be revoked immediately, you must mitigate leak risk with short TTLs, least-privilege policies, and the ability to cut off issuance paths.
Can I apply policy changes to an existing batch token after issuance?
No. A batch token freezes its policy at issuance time. To apply a policy change, issue a new token and switch the job to use it. If you need to swap permissions or revoke immediately, choose a service token from the start.
How do I respond to a leak of a batch token I cannot revoke individually?
Reduce risk operationally. Use short TTLs, least privilege, encrypted and audited distribution paths, per-job issuance, and the ability to quickly disable the role or block the execution platform when anomalies surface. Wider-impact actions like rotating Vault's verification key should be planned carefully and validated in a staging environment first.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...