← Writing

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.vault secret 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/datadog Helm chart (3.264.0) on k3s, configured through datadog.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].
Datadog Agentnative hashicorp.vaultHashiCorp VaultKubernetes authKV v2 secretsAPI key, check credentialsENC[...]http_check with the resolved credentialsstatus API/api/detail401 without credentials, 200 with themchange the secret: 401; restore it: 200, no Agent restart
The check can only pass if the Agent really got its credentials from Vault.

What the docs did not say

  1. /etc/datadog-agent/auth_token is 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.
  2. vault_token is a literal, not a file path. Pointing it at a file made the Agent fail to resolve secrets. For production, use vault_session with Kubernetes or AppRole auth instead.
  3. implicit_auth is nested under vault_session and must be a string. On 7.85.0, implicit_auth: true failed with expected 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.