Skip to main content

ccvet

PyPI

A risk-classifying permission gate for Claude Code.

ccvet is a PreToolUse hook that auto-approves low-risk tool calls, hard-blocks dangerous ones, and only asks you about the genuinely ambiguous middle. Most of that classification happens with plain rules and heuristics, not a model call. For the leftover gray zone, you can optionally point it at any local LLM server (Ollama, LM Studio, vLLM) for a second opinion, without ever giving that model the power to block anything on its own.

Status: early, published and installable, but new. Expect rough edges (see the badge above for the current version). See Docs/PLAN.md for the build plan and Docs/risk-taxonomy.md for the full rule set.

Contents

Why this exists

Claude Code's permission prompts protect you, but on a busy session the constant "allow this?" for obviously safe commands (git status, cat, ls) trains people to stop reading them. The next prompt that actually matters gets approved on autopilot too.

ccvet front-loads a deterministic, rule-based engine that handles the overwhelming majority of tool calls with zero model calls at all, and only escalates genuinely ambiguous actions to an optional local model or to you. The goal is fewer prompts overall, so the ones that remain are worth reading.

How it works

Four layers, evaluated in order:

  1. Hard-coded safety guards. Things like rm -rf /, sudo, git push --force, credential-file access, and obfuscated or piped-to-shell commands are always blocked. No configuration, LLM opinion, or user override can bypass this layer. It is the floor everything else sits on.
  2. Program allow and ask lists. Read-only commands (ls, cat, git status, git log, and so on) are auto-approved. Mutating-but-reversible commands (git commit, npm install, docker build) ask by default. This list ships in a plain YAML file you can extend.
  3. Your own policy rules. Once you've reviewed a specific command and decided it's fine, promote it with one command (ccvet allow) so you never get asked about it again. These rules can loosen or further restrict ccvet's own defaults, but they can never override layer 1.
  4. Optional LLM classifier. For anything left in the gray zone, point ccvet at a local model server for a second opinion. It can only promote a command toward "allow". It can never produce a "deny", so a misconfigured or hallucinating model can't block your agent's work.

Full detail, including the exact command-by-command classification table, is in Docs/risk-taxonomy.md.

A note on non-interactive sessions. "Ask" means exactly that: it escalates for a human to answer. In an interactive session that's the point, it's the review step ccvet exists to add. In a headless session (claude -p, a background agent, a CI pipeline) there's no human to answer, so an "ask" is effectively a hard stop, and most non-read-only commands land there by default. If you're running ccvet somewhere headless, build project ccvet allow rules ahead of time for the specific commands that pipeline actually runs, or wire ccvet's hook in for interactive sessions only.

Install

pip3 install ccvet
ccvet init

Or, to track the repo directly instead of PyPI:

pip3 install git+https://github.com/saicharansreedhara2/ccvet.git
ccvet init

ccvet init wires the PreToolUse hook into your project's .claude/settings.json (or ~/.claude/settings.json with --global), merging into any hooks you already have rather than overwriting them.

Global, project, or just this one session

Three ways to turn ccvet on, depending on how permanent you want it:

Scope Command
Global Every project, every session, from now on ccvet init --global
Project Every session started in this project, from now on ccvet init
Session Just this one run of claude claude-ccvet (in place of claude)

claude-ccvet is a tiny wrapper, installed alongside ccvet by the same pip3 install ccvet. It launches claude --settings '{...}' with ccvet's hook passed in as a one-off --settings payload, so nothing is written to any settings.json and nothing changes for your next session. It takes the exact same arguments as claude itself (claude-ccvet -p "...", claude-ccvet --resume ..., and so on) and passes them straight through. It's additive, not exclusive: Claude Code merges --settings hooks with whatever your project or user settings.json already configures, so any other PreToolUse hook you already have keeps firing alongside it.

Seeing what ccvet decided

Claude Code does not show a hook's reason in the normal chat transcript for auto-approved ("allow") actions, only for blocks and escalations. To see ccvet's reasoning for every decision, including allows, in real time, run Claude Code with:

claude --debug

Otherwise, use ccvet's own audit log:

ccvet log --tail 20

That gives a human-readable record of every decision ccvet has made, regardless of whether you're in debug mode. ccvet status summarizes the overall state: which hooks are wired, which policy files exist, whether Layer 2 is configured, and how large the audit log has grown.

Tuning the policy

ccvet check "docker build ."      # see what ccvet would decide, without running it for real
ccvet allow "docker build ."      # promote it to allow after you've reviewed it
ccvet policy edit                 # hand-edit the project's .ccvet/policy.yaml directly

Your rules can only loosen, or further restrict, ccvet's own judgment-call defaults. They can never bypass a hard-coded safety guard like rm -rf / or git push --force, even if you explicitly try to allow one.

Layer 2 (optional): an LLM second opinion on the gray zone

For commands that don't match any rule at all, point ccvet at any OpenAI-compatible local model server:

ccvet config set classifier.base_url http://localhost:11434/v1
ccvet config set classifier.model <your-model-name>

ccvet init also auto-detects a running Ollama or LM Studio server and offers to wire it up for you. Layer 2 is advisory in one specific direction only: it can promote a gray-zone command to "allow", but it can never turn anything into a "deny". The hard-coded safety guards keep exclusive authority to block, so a misconfigured or hallucinating local model cannot unilaterally stop your agent from working. If Layer 2 is unreachable, times out, or returns something that doesn't parse, ccvet simply falls back to asking you, exactly as if Layer 2 were never configured.

Uninstalling

ccvet uninstall

Removes only ccvet's own hook entry from .claude/settings.json (or ~/.claude/settings.json with --global), leaving any other hooks you've configured untouched.

Security model and limitations

ccvet is a heuristic and optional-LLM advisory gate, not a sandbox. It reduces the chance of an obviously destructive command slipping through on autopilot. It does not replace running Claude Code with least-privilege permissions, in a container, or on a disposable machine for anything you don't fully trust. See SECURITY.md for the full threat model and known gaps.

Contributing

Issues and pull requests are welcome, especially new entries for the risk taxonomy (a command you think should be classified differently, or a pattern that's missing entirely). See CONTRIBUTING.md.

License

MIT. See LICENSE.

Metadata

Release files for ccvet 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccvet 0.8.0
File Size Uploaded Provenance Actions
ccvet-0.8.0.tar.gz 170.8 kB With provenance Details for ccvet-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ccvet 0.8.0
File Interpreter ABI Platform Actions
ccvet-0.8.0-py3-none-any.whl Python 3 none any Details for ccvet-0.8.0-py3-none-any.whl

Total release size: 233.9 kB

Release files / ccvet-0.8.0.tar.gz

Download URL ccvet-0.8.0.tar.gz
Size 170.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4b09b262544c1e7fe86b99492489166fb8bf5dd42619182185b6a0974cedd750
BLAKE2b-256 checksum
How to use checksums
2e9a4ebbd44d92e253108e0971587db388a388a107b9acaf1e4d362f040f39d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / ccvet-0.8.0-py3-none-any.whl

Download URL ccvet-0.8.0-py3-none-any.whl
Size 63.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd104572be9d7231fb44c2978e4bbfad498dbd614ae2aca6f6c01228cc7df2a5
BLAKE2b-256 checksum
How to use checksums
abb1c5d168991198e587c9960da1e4287ad839d817eb3b8f0c82a7bcafaed31b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for ccvet 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ccvet-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page