Token Vault
Access Policies

Access Policies

Define reusable ABAC rules to control when, where, and how credentials are accessed.

Token Vault includes an Attribute-Based Access Control (ABAC) policy system. Policies let you define fine-grained rules that are evaluated on every credential request - agent access, MCP proxy injection, or direct token retrieval.

How Policies Work

Loading diagram...

AND logic

All rules within a policy are AND'd together - every rule must pass. If multiple policies are attached to one entity, those policies are also AND'd. A single failing rule blocks the request.

Rule Types

Creating a Policy

  1. Go to the Policies tab.
  2. Click Create Policy.
  3. Give it a name and optional description.
  4. Add one or more rules using the rule editor.
  5. Save the policy.
  6. Attach it to the entities you want to protect.

The create dialog lets you name your policy, add rules, and configure each rule's parameters:

Create Policy dialog with rule

Policies can be enabled or disabled without deleting them. A disabled policy is skipped during evaluation.

Managing Policies

The Policies page shows all your policies with their rule counts and action buttons for editing, attaching, and deleting:

Policies page with multiple policies

Attaching Policies

Policies are attached to entities - agents, MCP proxies, or individual tokens. One policy can be attached to many entities, and one entity can have many policies.

Loading diagram...

To attach a policy:

  1. Open the Policies tab in the dashboard.
  2. Click the attach icon on the policy you want to use.
  3. Select the entity type (agent, proxy, or token) and pick the entity.
  4. The policy takes effect immediately - the next credential request will be evaluated against it.

To detach, open the same dialog and remove the attachment.

Example: Business Hours + Office IP

Create a policy with two rules:

RuleConfiguration
Time windowWeekdays 09:00-17:00, Europe/London
IP allowlist203.0.113.0/24 (office network)

Attach it to your GitHub agent. Now that agent can only retrieve GitHub credentials during business hours from the office network. A request at 22:00 or from a home IP is denied with:

403 POLICY_DENIED
Policy: "Business Hours"
Rule: time_window
Reason: "Current time 22:15 is outside allowed window 09:00-17:00"

Example: Rate-Limited Proxy with Approval

Create a policy with two rules:

RuleConfiguration
Rate limit50 requests per 300 seconds (5 min)
Manual approval(no config)

Attach it to an MCP proxy. Every request sends you a push notification - tap Approve to allow it. If the proxy exceeds 50 requests in 5 minutes, it is temporarily blocked regardless of approval.

What Happens When Denied

When any rule fails, Token Vault returns:

403 Response
{
  "error": "POLICY_DENIED",
  "policyName": "Business Hours",
  "ruleType": "time_window",
  "reason": "Current time 22:15 is outside allowed window 09:00-17:00"
}

The response always includes the policy name, rule type, and a human-readable reason so you can diagnose why access was blocked. Denied requests are logged to your audit trail.

On this page