How to connect HashiCorp Vault to Toolspoke

Let your Toolspoke agents map your Vault cluster: secret engines, secret paths and metadata, policies, auth methods and health, without reading a single secret value. A metadata-only policy, a token, and an agent that flags stale secrets.

HashiCorp Vault toolkitMap a Vault cluster — its secret engines, secret paths, policies, auth methods and health — without reading any secret value.

Checked against HashiCorp Vault's documentation on 2026-11-25.

This guide is about HashiCorp Vault, the secrets manager. Toolspoke's Vault toolkit calls your cluster's own HTTP API with a Vault token you create. Once it's installed, any agent in the project can use it.

The toolkit is read-only, and it never reads a secret value. In a KV v2 engine, a secret's value is served from a data/ path and its history from a metadata/ path. The toolkit only calls metadata/. An agent can tell you what exists, where, when it was last rotated and which policy reaches it. It can't tell you what the secret is. It also can't write, delete, revoke, seal or unseal anything.

What an agent can do once it's connected

The toolkit has 11 named actions, and every one of them only reads:

  • Engines: list_mounts lists the mounted secret engines (kv, database, pki, transit and so on) with their type and options. For a KV engine, that's where the agent learns whether it's v1 or v2.
  • Secret paths: list_secrets lists the names under one path in a KV v2 engine. read_secret_metadata reads one secret's created and updated times, version count, and deleted or destroyed versions. That's how an agent answers "when was this last rotated" without seeing the value.
  • Access: list_policies and read_policy show which policies exist and what each one grants. list_auth_methods shows how people and machines get tokens.
  • Leases: list_leases lists the ids of outstanding leases under a prefix. It never returns the credentials behind them.
  • Namespaces: list_namespaces lists child namespaces. Vault Enterprise only.
  • Health: get_health and get_seal_status report whether the cluster is initialized, sealed or on standby, its version, and how many unseal shares have been supplied.
  • This token: get_token_info describes the token Toolspoke uses: its policies, TTL and whether it's renewable. Toolspoke also uses it to test the connection.

What you need

  • A Vault cluster served over HTTPS at an address Toolspoke can reach from the internet. Toolspoke refuses private-network addresses, so a Vault that's only reachable inside your VPC or VPN won't work.
  • A Vault operator who can write a policy and create a token. Creating a periodic token needs root or sudo.
  • A Toolspoke workspace, and a project to install the toolkit in.

Step 1: Write a metadata-only policy

Give Toolspoke a token of its own with a policy written for this toolkit. Don't use your own token or a root token. Save this as toolspoke-readonly.hcl, replacing secret with your KV v2 mount path. Add a block for each KV mount agents should see.

// Secret engines and auth methods
path "sys/mounts" {
  capabilities = ["read"]
}
path "sys/auth" {
  capabilities = ["read"]
}

// ACL policies: names, then each document
path "sys/policies/acl" {
  capabilities = ["list"]
}
path "sys/policies/acl/*" {
  capabilities = ["read"]
}

// KV v2: metadata only. Nothing on secret/data/*
path "secret/metadata/*" {
  capabilities = ["list", "read"]
}

Then load it:

vault policy write toolspoke-readonly toolspoke-readonly.hcl

If you prefer the Vault UI, the same policy can be pasted there:

Vault UI
  1. Policies
  2. Create ACL policy
Name
toolspoke-readonly
Policy
the HCL above
Create policy
Illustration of Vault UI's screen. The labels are Vault UI's; the layout is ours.

A few notes on what to leave out:

  • No data/ paths. The toolkit never calls them anyway, but a policy that withholds them means even a future change can't reach secret values.
  • Scope the metadata path if agents should only see part of the tree, for example secret/metadata/apps/*. Vault's KV docs warn that list results aren't filtered by policy, so don't put anything sensitive in secret names.
  • Leases are optional. Vault requires the sudo capability to list leases. If you don't want to hand that out, leave list_leases without a policy. Vault will refuse it, which is the expected result.
  • Namespaces: on Vault Enterprise, add path "sys/namespaces" { capabilities = ["list"] } if you want list_namespaces to work.

get_token_info needs no extra rule. Vault's built-in default policy lets a token look up data about itself.

Step 2: Create a token with that policy

vault token create -policy=toolspoke-readonly -display-name=toolspoke -period=720h

Copy the token value from the output. It starts with hvs..

Vault tokens expire. Two things to know:

  • A periodic token has its TTL reset to the period every time it's renewed, so it lives as long as something renews it in time. The toolkit has no renewal action. Schedule vault token renew against the token, or replace it before the period ends.
  • A non-periodic token can't outlive its maximum TTL. Vault's system maximum is 32 days unless you've changed it in the server config. Use one only if you're happy to rotate the token monthly.

If the token expires, Vault answers every call with 403 "permission denied" until you paste a new one.

Step 3: Install the Vault toolkit in Toolspoke

  1. In Toolspoke, open the project your agents work in. Find HashiCorp Vault in the marketplace and add it.
  2. Enter the Vault address: the root URL, the same value you'd put in VAULT_ADDR, with no /v1. For example https://vault.acme.com:8200.
  3. Paste the Vault token from step 2.
  4. On Vault Enterprise, enter the Namespace the toolkit should work in, for example admin/engineering. Leave it blank on open-source Vault.
CredentialHashiCorp Vault
Vault address
https://vault.acme.internal:8200
The root address of your Vault cluster, with no trailing path — the same value you would put in VAULT_ADDR. The /v1 prefix is added by this connector. It has to be reachable from this gateway.
Vault token
••••••••••••••••
A Vault token whose policy grants read on the sys endpoints and list/read on the KV metadata paths this connection should see. Do not grant it read on any KV data path: nothing here calls one, and a policy that withholds it is the guarantee that survives a change to this file. Vault tokens expire — use a periodic token or a renewable one with a long enough TTL that the connection does not go dead unnoticed.
Namespaceoptional
admin/engineering
Vault Enterprise only. Leave blank for open-source Vault, which has no namespaces. When set it is sent as X-Vault-Namespace and every path below is resolved inside it.

get_token_info answered. The credential works.

Save and test
The HashiCorp Vault toolkit's credential card in your Toolspoke project, with its real fields.

Toolspoke checks the connection with get_token_info. Every valid token can make that call, whatever its policy.

The token is encrypted at rest and attached to each request by the gateway. The agent never sees it, and it never appears in the arguments an agent sends or in the audit log.

Step 4: Decide what agents may see

Nothing here can change your cluster, so there are no writes to switch off. The Vault policy from step 1 is your main control. Toolspoke adds a second one on top.

In the project's toolkit settings, each action can be switched on or off for everyone in the project. An action that's switched off can't be called, whatever the prompt says. If secret names themselves are sensitive in your organization, switch off list_secrets and read_secret_metadata and keep the cluster-level reads.

HashiCorp Vault actions in your project

Agents can call 11 of 11, and none of them change anything.

Read
Looks, changes nothing.
  • get_token_infoDescribe the token this connection is using — its display name, the policies attached to it, when it was issued, when it expires, whether it is renewable and which auth path minted it.
  • list_mountsList the secret engines mounted on this cluster, keyed by their mount path — kv/, database/, pki/, transit/ and so on — with each one's type, description, options and lease settings.
  • list_secretsList the secret names under one path in a KV v2 engine.
  • read_secret_metadataRead one secret's metadata: when it was created and last updated, how many versions exist, which of them are deleted or destroyed, the configured maximum version count, and any custom metadata attached to it.
  • list_policiesList the names of the ACL policies configured on this cluster.
  • read_policyRead one ACL policy document by name.
  • list_auth_methodsList the auth methods enabled on this cluster, keyed by their mount path — token/, userpass/, oidc/, approle/, kubernetes/ and so on — with each one's type, description and default lease settings.
  • list_namespacesList the child namespaces under the current one.
  • list_leasesList the lease ids outstanding under one prefix — the dynamic credentials Vault has issued and not yet expired, such as database logins minted by the database engine.
  • get_healthReport the cluster's health: whether it is initialised, sealed, a standby or a performance standby, its version, cluster name and replication mode.
  • get_seal_statusReport the seal state in detail: whether the cluster is sealed, how many unseal key shares its threshold requires and how many have been supplied, the seal type, the storage type and the version.
Try the switches. They start the way this guide suggests; nothing here changes your project.

Every call is recorded with the agent and person behind it, the request, the response, the status and the duration.

Step 5: Build an agent that uses it

In Toolspoke, create an agent and describe its job in one sentence. The builder proposes the instructions, the toolkits it needs, a schedule and where it should answer. You add or skip each one, then create the agent. Every piece stays editable afterwards.

It reads metadata only, so it never sees a secret value. If you switched off list_secrets and read_secret_metadata, give it a cluster-level job instead, such as reporting seal status and enabled auth methods. The same agent answers when someone asks it in Slack or emails it, and it replies in the thread it was asked in.

Try it

Ask the agent in Slack, by email or in its chat:

  • Which secret engines are mounted, and which KV mounts are v1 versus v2?
  • List the secrets under apps/billing and tell me which ones haven't been updated in 90 days.
  • Which policies grant anything on a data/ path under secret/prod? Show me the lines.
  • Which auth methods are enabled, and what's the default lease TTL on each?
  • Is the cluster sealed? If so, how many unseal shares are still needed?

When a call is refused, ask the agent to run get_token_info first. The policy list it returns usually explains why. The Vault toolkit page lists every action.

Troubleshooting

403 "permission denied" on one action.

The policy doesn't cover that path, or covers it with the wrong capability. Lists need list and single reads need read. Add the path to the policy and run vault policy write again.

403 on everything.

The token has expired or been revoked. Create a new one (step 2) and paste it into the toolkit's credentials.

listnamespaces returns 404.

That's expected on open-source Vault, which has no namespaces.

gethealth fails when a namespace is set.

Vault's API docs mark the health endpoint as restricted: it has to be called from the root namespace. Use get_seal_status instead, or clear the namespace field.

Listing a nested folder fails behind a proxy, but works directly.

The toolkit sends a nested path like apps/billing as one percent-encoded segment. Some reverse proxies reject encoded slashes by default. Allow them for the Vault route.

The connection check fails with an address error.

The address must be public HTTPS. Toolspoke refuses private and internal IPs. Also check you didn't add /v1.

Questions

Can an agent read a secret?

No. The toolkit has no action that calls a data/ path, and a caller-supplied path can't be steered there. Your policy from step 1 also withholds data/, so the guarantee holds on Vault's side as well.

Does the agent see the Vault token?

No. The gateway attaches it as the X-Vault-Token header. Vault echoes the token back in its lookup response, and the toolkit strips it before the agent sees the answer.

Connect HashiCorp Vault to Toolspoke

Install HashiCorp Vault in a project, give it to an agent, and every call is checked and logged.