Datadog Agent and HashiCorp Vault on Kubernetes, and a docs bug on the way
3 November 2026
Goal
- The Datadog Agent reads its own API key and a check’s credentials from HashiCorp Vault, with the Agent’s native
hashicorp.vaultsecret backend instead of a custom secret script. - Prove it: a check that only passes with the credentials from Vault, and that fails and recovers when the secret changes.
Setup
- Docker/Podman: Agent 7.85.0 (7.74.1 compared), Vault 1.21.2 in dev mode, and a small status API whose detail endpoint answers 401 without basic auth and 200 with it.
- Kubernetes: the official
datadog/datadogHelm chart (3.264.0) on k3s, configured throughdatadog.secretBackend, with the Vault Kubernetes-auth role bound to the chart’s Agent ServiceAccount. - Secrets are referenced as handles, for example
api_key: ENC[/secret/datadog;api_key].
What the docs did not say
/etc/datadog-agent/auth_tokenis not the Vault token. It is the Agent’s own IPC token, created with a random value. Both 7.74.1 and 7.85.0 resolved Vault secrets without mounting anything there.vault_tokenis a literal, not a file path. Pointing it at a file made the Agent fail to resolve secrets. For production, usevault_sessionwith Kubernetes or AppRole auth instead.implicit_authis nested undervault_sessionand must be a string. On 7.85.0,implicit_auth: truefailed withexpected type 'string', got unconvertible type 'bool';"true"worked.
The fix upstream
The third point was a docs bug: the reference showed a boolean. I reproduced it, corrected the docs, and the pull request was approved by the Datadog docs team. It is still open.
Result
- The Agent reads the API key and the check’s credentials from Vault; the check reaches the status API with 200.
- Altering the secret makes the check fail with 401; restoring it recovers without restarting the Agent.
- Both setups are public: the Helm chart and the Docker/Podman template, each with its own learnings.