Skip to main content
Glama
LOLA0786

privatevault-gate

by LOLA0786

privatevault-gate

A pre-execution runtime gate for AI coding agents. Routes tool calls through PrivateVault's enforcement engine over MCP — a blocked action does not run, and every decision becomes a hash-chained, verifiable record.

pv_write_file -> POST /v1/decide -> allow -> file is written pv_exec -> POST /v1/decide -> require_approval -> command NEVER runs

Quick start

1. Start the enforcement engine

docker run --rm -d -p 8000:8000 \
  -e PV_ALLOW_NO_AUTH=1 \
  -e PV_BASELINE_CAPABILITIES=fs.write \
  -e PV_DB_PATH=/tmp/pv.db \
  --name pv-demo ghcr.io/lola0786/privatevault:latest

curl -s http://localhost:8000/ready

The engine reports its own limitations at GET / -- calibration status, whether signing is enabled, and what it is not certified for. Read it before trusting it with anything.

PV_BASELINE_CAPABILITIES declares what your agent normally does. Declared capabilities pass; anything outside is treated as behavioral drift and stopped for approval. Without it, an agent with no history scores maximum drift on every action — see Cold start below.

PV_ALLOW_NO_AUTH=1 disables authentication. Local development only.

2. Point your coding agent at the gate

Claude Code — .mcp.json; Cursor/Windsurf/Cline — same block in their MCP config:

{
  "mcpServers": {
    "privatevault": {
      "command": "npx",
      "args": ["-y", "privatevault-gate"],
      "env": {
        "PV_ENFORCE_URL": "http://localhost:8000",
        "PV_AGENT_ID": "my-coding-agent"
      }
    }
  }
}

3. See a real allow and a real block

pv_write_file succeeds (fs.write is declared). pv_exec returns:

PrivateVault REQUIRE_APPROVAL (pending approval — NOT executed) triggered_by: drift reason: Behavioral drift 0.90 record_hash: b46ef428a51c6669703854773883c7c1d1a916129901da7bd9e46f8854a22963

This action did not run.

The command never executed. Verify the record with GET /v1/records/{agent_id}.

Scripted: node test/real-engine-test.mjs

Related MCP server: AgentGuard MCP Server

Tools

Tool

Capability

Enforcement

pv_exec

shell.exec

Enforced — execution is behind the decision

pv_write_file

fs.write

Enforced

pv_http_request

net.http

Enforced

pv_decide

caller-supplied

Advisory only — returns a verdict, executes nothing

pv_blocked

Read-only; lists recent BLOCK decisions

What this enforces, and what it does not

Enforced. For pv_exec, pv_write_file, pv_http_request, the execution path lives behind the /v1/decide call, inside this process. A non-allow verdict returns an error and the side effect never happens. Structural, not advisory — the tests assert the file does not exist on disk afterward.

Not enforced. This gate cannot intercept your coding agent's built-in tools. Cursor's own file-write, Claude Code's own Bash — those never route through this process, and no MCP server can gate them. Actions are enforced only when routed through the pv_* tools.

pv_decide is advisory: the agent can ask for a verdict on an action it intends to perform with its own tools, but nothing compels it to honor the answer. It is labeled advisory in the tool description itself.

For enforcement an agent cannot route around, the gate must sit where the tool call dispatches — see docs/integration-patterns/ in the main repo.

Cold start

An agent with no behavioral history scores drift 0.90, a hardcoded constant for the untrained case. Every action, including harmless ones, returns require_approval with an identical reason. This is why PV_BASELINE_CAPABILITIES is step 1 and not a config footnote: without it the gate flags everything indiscriminately.

Configuration

Env var

Default

Purpose

PV_ENFORCE_URL

http://localhost:8000

Base URL of the enforcement API

PV_AGENT_ID

privatevault-gate-dev

Identity recorded on every decision

PV_API_KEY

unset

Sent as x-api-key; required unless server runs PV_ALLOW_NO_AUTH=1

PV_TIMEOUT_MS

5000

Decision timeout before failing closed

PV_FAIL_OPEN

unset

1 allows actions when the engine is unreachable. Dev only

Fail-closed by default

If the engine is unreachable, times out, or returns something unparseable, the gate returns block. A pre-execution control that fails open on a network hiccup provides no guarantee at all. PV_FAIL_OPEN=1 affects transport failures only — a real block or require_approval is always honored. Never set it in production.

What is bound, and what is not

Each decision is bound to a digest of the exact content or body, inside a canonical five-field execution action sealed by the engine. Two different payloads of the same length no longer share one approval.

The decision is not bound to the transport bytes, and no signed permit is minted, verified, or consumed. Approve-once is therefore not enforced: nothing stops the same ALLOW from being acted on twice, and nothing cryptographically ties a decision to the execution that followed it. The engine has that machinery; this gate does not yet call it.

The dispatch context declares pv-audit-only/0.1 for that reason — per ADR-0017 an audit-only context cannot mint a permit, which is an accurate description of this gate rather than a limitation being worked around.

Local vs hosted

The local sandbox is free. PV_ENFORCE_URL is the only thing that changes to point at a hosted control plane, where managed policy, retained audit evidence, and compliance packages live.

Development

npm install
npm run build

node test/mock-pv-server.mjs &   # mock engine, no docker needed
node test/gate-test.mjs

node test/real-engine-test.mjs   # against a real engine on :8000

Both tests assert the absence of the side effect after a block, not merely that an error was returned.

License

MIT

Available Tools

5 tools
pv_blockedA

List recent BLOCK decisions for this agent.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden of behavioral disclosure. It does convey that the tool is a non-mutating, agent-scoped listing of recent items. However, it does not disclose whether there are limits on 'recent', what fields are returned, or whether this covers all sessions or only the current one.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler or redundant phrasing. Every word contributes to identifying what is returned and for whom.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool the description is nearly sufficient, but it relies on undefined concepts such as 'BLOCK decisions' and an unspecified 'recent' window. It also does not explain the return structure, and there is no output schema to compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is effectively 100%, so the baseline of 4 applies. There is no parameter-level ambiguity for the description to resolve.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('List'), a concrete resource ('recent BLOCK decisions'), and an explicit scope ('for this agent'). It is immediately distinguishable from the sibling pv_decide because it focuses on blocked outcomes rather than decision-making or execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given about when to use this tool versus alternatives such as pv_decide, or when it should be preferred over a general decision-history view. The description implies a read-only history check but does not state exclusions or competing tool conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pv_decideA

Ask PrivateVault for a decision WITHOUT executing. Advisory only — nothing enforces that you honor the verdict, unlike the pv_* tools where execution is structurally behind the check.

ParametersJSON Schema
NameRequiredDescriptionDefault
argsNoThe action's arguments
capabilityYesCapability identifier

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states 'WITHOUT executing' and 'Advisory only — nothing enforces that you honor the verdict,' which are the key behavioral traits. It also hints at the structural difference in execution tools. It does not disclose the output format or error behaviors, but the core non-execution and non-enforcement aspects are clear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no filler. The core action ('Ask PrivateVault for a decision WITHOUT executing') is front-loaded, and the second sentence adds essential context about advisory nature and the contrast with execution tools. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple, and the schema covers parameters, but the description omits what the returned 'decision' looks like (e.g., boolean, object, status) and any error behavior. Since there is no output schema, this gap could leave an agent unsure how to interpret the result. The description adequately covers purpose and behavioral nuance, but lacks return-pointer details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes both parameters: 'args' (object) and 'capability' (string) with clear descriptions. Since schema coverage is 100%, the description adds no extra parameter guidance, which meets the baseline for a 3. It does not go beyond the schema to explain constraints, examples, or relationships between parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Ask PrivateVault for a decision WITHOUT executing.' It names the resource (PrivateVault) and the action (ask for a decision) and explicitly notes the advisory-only nature, which distinguishes it from the execution-focused pv_* siblings. The contrast with 'pv_* tools where execution is structurally behind the check' further clarifies its unique role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives strong context: the tool is advisory and does not execute, contrasting with sibling tools that do. This implies it should be used for pre-flight checks or when a decision is needed without side effects. However, it stops short of explicitly stating 'use this tool when you need a verdict only' or naming a specific alternative like pv_exec, so it lacks a direct when-to-use vs. when-not-to-use recommendation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pv_execA

Run a shell command, gated by PrivateVault. Submitted for a pre-execution decision and only runs if the verdict is ALLOW.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory
commandYesThe shell command to run

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description is the sole source of behavioral information. It does disclose the gating mechanism and the fact that execution is conditional on an ALLOW verdict Mend. However, it does not detail what happens on DENY, whether the command is actually executed after approval, or the response format. This leaves some uncertainty but the core behavior is disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, tight sentence that front-loads the core action (run a shell command) and immediately clarifies the key constraint (gated by PrivateVault). It is concise with no filler, and the two sentences are logically ordered: what it does, then the critical behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (2 parameters, no output schema), the description covers the essential nature. However, it does not specify what happens on approval (does it return output?) or on denial (error?), nor does it mention any security implications beyond the gate. With no annotations, an agent might lack clarity on expected outcomes, but the description is adequate for a basic understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides descriptions for both parameters ('The shell command to run' and 'Working directory'), and coverage is 100%. The description adds no further parameter-level detail, such as expected format for cwd or command length limits. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: running a shell command with PrivateVault gating. It explicitly mentions the pre-execution decision step and the ALLOW condition. While it doesn't name specific sibling tools, the core functionality is clear and distinct from the file writing, HTTP request, and decision tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: this is for running shell commands that require PrivateVault authorization. It implies it should be used when a decision is needed before execution, but it does not explicitly say when not to use it or mention alternatives. Sibling tools are not referenced, so an agent might not know when to pick pv_exec over pv_decide.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pv_http_requestA

Make an outbound HTTP request, gated by PrivateVault. Only sent if the verdict is ALLOW.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesTarget URL
bodyNoRequest body
methodNoHTTP methodGET

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals the gating mechanism (PrivateVault, ALLOW-only) and the side effect of making an outbound request. However, it does not disclose return value, error handling, or what occurs if the verdict is not ALLOW. While it adds meaningful context, it lacks comprehensive behavioral detail expected without annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no superfluous content. The primary action ('Make an outbound HTTP request') is front-loaded, followed by the critical gating condition. Every word contributes to understanding the tool's function and constraint, making it concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple (3 params, no output schema, no annotations), but the description omits important details such as the return value or response format, which is especially relevant given there is no output schema. It also does not specify behavior when the verdict is not ALLOW (e.g., whether an error is returned). While the core action is covered, these gaps reduce completeness for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters (url, body, method) have descriptive text in the schema. The description does not add extra meaning to the parameters, such as formatting requirements or relationships. Baseline 3 is appropriate since the schema already documents the parameters adequately, and the description does not enrich them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: making an outbound HTTP request, with a specific gating condition (PrivateVault, only if ALLOW). It distinguishes itself from siblings like pv_exec (execution) and pv_write_file (file writing) by focusing on HTTP requests. The verb 'make' and resource 'outbound HTTP request' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions the gating condition ('Only sent if the verdict is ALLOW') but does not explicitly state when to use this tool versus alternatives. It implies usage for HTTP requests but lacks guidance on when not to use it (e.g., if the request might be blocked) or how it relates to siblings. No exclusions or alternative tool mentions are present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pv_write_fileB

Write content to a file, gated by PrivateVault. Only happens if the verdict is ALLOW.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesPath to write
contentYesFull content

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description bears full responsibility for disclosing behavior. It does state the conditional execution based on the ALLOW verdict, which is important, but it omits other critical behavioral details: whether the write overwrites existing content, handles directories, or returns any result. The description is too thin for a mutating operation with no annotation safety net.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that immediately states the core action and then the critical constraint. There is no wasted wording, and the structure is front-loaded with the essential purpose before the gating note. It is appropriately concise without losing necessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and no annotations, yet the description omits how the ALLOW verdict is obtained (e.g., via pv_decide), what happens if the verdict is not ALLOW, and any post-conditions. For a write operation that depends on a prior decision, an agent lacks sufficient context to invoke it correctly in a workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for both path and content, so the schema already documents parameters adequately. The description adds no extra parameter meaning beyond the gating condition, which is not parameter-specific. Per the baseline rule, a 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Write content to a file' and the gating condition 'gated by PrivateVault' and 'Only happens if the verdict is ALLOW.' This is specific and distinct from the sibling tools (execute, HTTP request, decide, blocked). However, it does not explicitly name alternatives, so it slightly misses the highest bar for differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies that the tool should be used only when a PrivateVault verdict of ALLOW has been obtained, but it does not explicitly state when to use it versus siblings like pv_decide or pv_blocked. No exclusions or alternative routing are provided, leaving the agent to infer the correct usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.2
    • First observedpv_blocked
    • First observedpv_decide
    • First observedpv_exec
    • First observedpv_http_request
    • First observedpv_write_file

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation4/5

Each pv_* tool has a distinct purpose (exec, write, HTTP, decide, list blocked). Minimal ambiguity between pv_decide (advisory) and the gated tools is mitigated by clear descriptions of enforcement.

Naming Consistency4/5

All tools use a consistent pv_ prefix with snake_case verbs. Minor deviation: 'decide' is an action but 'blocked' is a list operation, but the pattern is still predictable.

Tool Count5/5

Five tools perfectly suit a security-gating server: core gated operations plus an advisory decision and a history check. No bloat or gap in scope.

Completeness4/5

The server covers the essential lifecycle of gating actions and checking decisions. Missing features like allowing/denying decisions or a detailed audit log, but these are secondary for advisory/lists.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    A governance proxy for AI tools — every MCP/agent tool call is policy-gated, secret-redacted, and written to a hash-chained, offline-verifiable audit trail.
    13
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Provides a secure MCP boundary for AI agents, intercepting and validating tool calls, redacting secrets, and requiring human approval for sensitive actions with a tamper-evident audit trail.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides permission gates and tamper-evident audit logging for AI agent tool executions, with declarative policies, consent ladders, and hash-chained verification.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to call external endpoints under per-endpoint policy enforcement, with credentials and personal data kept inside a hardware enclave and every allowed or denied attempt recorded to an immutable audit ledger.
    2
    -