Skip to main content

LLM-based code review tool that finds issues tests and linters miss

Project description

Vet : Verify Everything

PyPi License: AGPL v3 Build Status

Vet is a standalone verification tool for code changes and coding agent behavior.

It reviews git diffs, and optionally an agent's conversation history, to find issues that tests and linters often miss. Vet is optimized for use by humans, CI, and coding agents.

Why Vet

  • Verification for agentic workflows: "the agent said it ran tests" is not the same as "all tests ran successfully".
  • CI-friendly safety net: catches classes of problems that may not be covered by existing tests.
  • Bring-your-own-model: can run against hosted providers or local/self-hosted OpenAI-compatible endpoints.

Installation

pip install verify-everything

Or install from source:

pip install git+https://github.com/imbue-ai/vet.git

Quickstart

Run Vet in the current repo:

vet "Implement X without breaking Y"

Compare against a base ref/commit:

vet "Refactor storage layer" --base-commit main

Using Vet with Coding Agents

Vet ships as an agent skill that coding agents like OpenCode and Codex can discover and use automatically. When installed, agents will proactively run vet after code changes and include conversation history for better analysis.

Install the skill

Project Level

From the root of your git repo:

for dir in .agents .claude; do
  mkdir -p "$dir/skills/vet/scripts"
  for file in SKILL.md scripts/export_opencode_session.py scripts/export_codex_session.py scripts/export_claude_code_session.py; do
    curl -fsSL "https://raw.githubusercontent.com/imbue-ai/vet/main/skills/vet/$file" \
      -o "$dir/skills/vet/$file"
  done
done

This places the skill in .agents/skills/vet/ and .claude/skills/vet/ at the repo root, which is sufficient for discovery by OpenCode, Claude Code, and Codex.

User Level

for dir in ~/.agents ~/.opencode ~/.claude ~/.codex; do
  mkdir -p "$dir/skills/vet/scripts"
  for file in SKILL.md scripts/export_opencode_session.py scripts/export_codex_session.py scripts/export_claude_code_session.py; do
    curl -fsSL "https://raw.githubusercontent.com/imbue-ai/vet/main/skills/vet/$file" \
      -o "$dir/skills/vet/$file"
  done
done

This places the skill in ~/.agents/skills/vet/, ~/.opencode/skills/vet/, ~/.claude/skills/vet/, and ~/.codex/skills/vet/, so it is discovered by OpenCode, Claude Code, and Codex.

Security note

The --history-loader option executes the specified shell command as the current user to load the conversation history. It is important to review history loader commands and shared config presets before use.

GitHub PRs (Actions)

Vet can run on pull requests using the reusable GitHub Action.

Create .github/workflows/vet.yml:

name: Vet

permissions:
  contents: read
  pull-requests: write

on:
  pull_request:
    types: [opened, edited, synchronize, reopened]

jobs:
  vet:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    env:
      ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: imbue-ai/vet@main
        with:
          agentic: false

The action handles Python setup, vet installation, merge base computation, and posting the review to the PR. ANTHROPIC_API_KEY must be set as a repository secret when using Anthropic models (the default). See action.yml for all available inputs.

How it works

Vet snapshots the repo and diff, optionally adds a goal and agent conversation, runs LLM checks, then filters/deduplicates findings into a final list of issues.

architecture

Output & exit codes

  • Exit code 0: no issues found
  • Exit code 1: unexpected runtime error
  • Exit code 2: invalid usage/configuration error
  • Exit code 10: issues found

Output formats:

  • text
  • json
  • github

Configuration

Model configuration

Vet supports custom model definitions using OpenAI-compatible endpoints via JSON config files searched in:

  • $XDG_CONFIG_HOME/vet/models.json (or ~/.config/vet/models.json)
  • .vet/models.json at your repo root

Example models.json

{
  "providers": {
    "openai": {
      "name": "OpenAI",
      "api_type": "openai_compatible",
      "base_url": "https://api.openai.com/v1",
      "api_key_env": "OPENAI_API_KEY",
      "models": {
        "gpt-4o": {
          "model_id": "gpt-4o-2024-08-06",
          "context_window": 128000,
          "max_output_tokens": 16384
        },
        "gpt-4o-mini": {
          "model_id": "gpt-4o-mini-2024-07-18",
          "context_window": 128000,
          "max_output_tokens": 16384
        },
        "o1": {
          "model_id": "o1-2024-12-17",
          "context_window": 200000,
          "max_output_tokens": 100000
        }
      }
    }
  }
}

Then:

vet "Harden error handling" --model gpt-4o-mini

Configuration profiles (TOML)

Vet supports named profiles so teams can standardize CI usage without long CLI invocations.

Profiles set defaults like model choice, enabled issue codes, output format, and thresholds.

See the example in this project.

Custom issue guides

You can customize the guide text for the issue codes via guides.toml. Guide files are loaded from:

  • $XDG_CONFIG_HOME/vet/guides.toml (or ~/.config/vet/guides.toml)
  • .vet/guides.toml at your repo root

Example guides.toml

[logic_error]
suffix = """
- Check for integer overflow in arithmetic operations
"""

[insecure_code]
replace = """
- Check for SQL injection: flag any string concatenation or f-string formatting used to build SQL queries rather than parameterized queries
- Check for XSS: flag user-supplied data rendered into HTML templates without proper escaping or sanitization
- Check for path traversal: flag file operations where user input flows into file paths without validation against directory traversal (e.g. ../)
- Check for insecure cryptography: flag use of deprecated or weak algorithms (e.g. MD5, SHA1 for security purposes, DES, RC4)
- Check for hardcoded credentials: flag passwords, API keys, or tokens embedded directly in source code
"""

Section keys must be valid issue codes (vet --list-issue-codes). Each section supports three optional fields: prefix (prepends to built-in guide), suffix (appends to built-in guide), and replace (fully replaces the built-in guide). prefix and suffix can be used together, but replace is mutually exclusive with the other two. Guide text should be formatted as a list.

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verify_everything-0.1.8.tar.gz (186.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verify_everything-0.1.8-py3-none-any.whl (240.4 kB view details)

Uploaded Python 3

File details

Details for the file verify_everything-0.1.8.tar.gz.

File metadata

  • Download URL: verify_everything-0.1.8.tar.gz
  • Upload date:
  • Size: 186.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for verify_everything-0.1.8.tar.gz
Algorithm Hash digest
SHA256 20ab6f668bce256ba41a5f0540b4b519c89261607b0699ae6f48cc12481f75f9
MD5 c1f2d829f9b67afeb4505609445587a8
BLAKE2b-256 6728328d7ce87f1c40aea52e4f7eac71e71f5c8a29cd2c698903c737d24cfd07

See more details on using hashes here.

File details

Details for the file verify_everything-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for verify_everything-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 bfa65e64f1329b795927e552411af35e13c7239be1a9999004fe24fd80e80e79
MD5 dde1242e310f5138805e66544deb2522
BLAKE2b-256 c3724438281e2857e1eb96d3bfd60e4f38dabad8d294b48ac4f0b474b5f4ac0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page