Skip to main content
Vault Policies define who can access what secrets and with which operations. Policies are written in HashiCorp Configuration Language (HCL) and provide fine-grained access control over Vault paths.

Key Concepts

Path-Based Rules

Policies grant capabilities on specific paths. Use wildcards to match multiple paths.

Capabilities

Define allowed operations: create, read, update, delete, list, sudo, deny.

Deny by Default

Users have no access unless explicitly granted by a policy.

Multiple Policies

Users can have multiple policies. Permissions are additive (union of all policies).

Required Permissions

Capabilities Reference

How to Create a Policy

1

Select Vault Instance

Choose the target Vault instance from the dropdown if you have multiple.
2

Click Create Policy

Click the Create Policy button.
3

Enter Policy Name

Provide a unique, descriptive name:
  • Use lowercase with hyphens (e.g., app-read-only)
  • Only alphanumeric, hyphens, and underscores allowed
4

Write Policy Rules

Define access rules in HCL format. Click Insert Example to start with a template.
5

Create

Click Create Policy to save.

Policy Syntax

Policies use HCL (HashiCorp Configuration Language) syntax:

Path Patterns

For KV v2 secrets engine, use secret/data/* for reading/writing secrets and secret/metadata/* for listing and metadata operations.

Common Policy Examples

Read-Only Policy

Application-Specific Policy

Team Lead Policy

Deny Specific Paths

How to Edit a Policy

1

Find the Policy

Use the search bar to locate the policy by name.
2

Click Edit

Click the edit (pencil) icon on the policy row.
3

Modify Rules

Update the HCL content in the editor.
4

Save

Click Update Policy to apply changes.
Policy changes take effect immediately. Users with active sessions may need to re-authenticate to see updated permissions.

How to Delete a Policy

1

Find the Policy

Locate the policy in the list.
2

Click Delete

Click the trash icon on the policy row.
3

Confirm

Confirm the deletion. This action cannot be undone.
Deleting a policy immediately revokes access for all users who depend on it. Ensure no critical workflows rely on this policy before deletion.

Best Practices

Naming Conventions

Principle of Least Privilege

Grant minimum necessary permissions:

Use Comments

Document the purpose of each rule:

Separate by Environment

Create environment-specific policies:

Troubleshooting

  • Users may need to log out and back in
  • Token may be cached with old permissions
  • Verify the policy is attached to the user/group
  • Check the exact path being accessed matches policy
  • For KV v2, ensure using secret/data/ prefix
  • Verify required capability is included
  • Check for explicit deny rules that may override
  • list capability must be on the metadata path
  • Add: path "secret/metadata/*" { capabilities = ["list"] }
  • Check for missing closing braces }
  • Ensure capabilities are in array format ["read", "list"]
  • Verify no trailing commas in capability arrays
  • Use the Insert Example button to compare syntax
  • You need delete permission for Vault policies
  • Built-in policies (root, default) cannot be deleted
  • Check with administrator for policy management permissions

FAQ

Permissions are additive. If policy A grants read and policy B grants write, the user has both read and write access. However, explicit deny always wins.
Use the Vault CLI vault token capabilities command to test what operations are allowed for a token on a specific path.
For KV v2 secrets engine:
  • secret/data/* - Read/write actual secret values
  • secret/metadata/* - List paths, read/write metadata, delete versions
No. Policies are static HCL documents. Use templated policies with Vault Enterprise, or create separate policies per environment.
For full administrative access, attach the root policy. Use sparingly and prefer scoped policies for day-to-day operations.
Yes. MyPolicy and mypolicy are different policies. Use consistent lowercase naming.