Documentation menu

Configuration

The .codeveto.toml keys, where configuration is read from, what a repository may and may not set, inline ignores and limits.

On this page
  1. Sources and precedence
  2. A full repository config
  3. Keys
  4. A user config
  5. What repository config may do
  6. Changing the config in a change
  7. Inline ignores
  8. Limits and other caps

Sources and precedence

CodeVeto reads configuration from four layers. A later layer overrides an earlier one key by key:

  1. Built-in defaults.
  2. Repository config: .codeveto.toml at the root of the repository, read from Git objects at the trust anchor. The copy in the change under review is never applied. --no-repo-config skips this layer.
  3. User config: one file per user, outside every repository (locations below).
  4. --config FILE, then the command-line flags (--fail-on, --strict, --ai, --ai-model, --ai-base-url).

[[ignore]] entries from every layer add up. Limits and AI budgets take the lower of the repository value and the trusted value, so a repository can only tighten them. Environment variables are read only for AI credentials and endpoints and to find the user config.

System User config
Linux, macOS and other POSIX $XDG_CONFIG_HOME/codeveto/config.toml, or ~/.config/codeveto/config.toml when XDG_CONFIG_HOME is unset or not absolute
Windows %APPDATA%\codeveto\config.toml, or %USERPROFILE%\.config\codeveto\config.toml when APPDATA is unset

A missing user config is fine; a missing --config file is an error. A user config or --config file inside the reviewed repository's working tree or Git directory is refused, because the change under review could have written it:

output
codeveto: config error: --config /path/to/repo/local.toml: lies inside the reviewed repository's working tree or Git directory, where the change under review could have written it

Every file is UTF-8 TOML of at most 64 KiB. The schema is strict: an unknown key, a wrong type, an unknown rule ID, an invalid glob or malformed TOML ends the review incomplete (exit 2) with the file and the key path. Invalid configuration never silently weakens the review.

A full repository config

toml
# .codeveto.toml
fail_on = "error"

[rules]
disable = ["hygiene/todo-added"]
enable = ["python/print-call"]

[rules.severity]
"tests/untested-change" = "error"

[[ignore]]
paths = ["tests/fixtures/**"]
rules = ["secrets/*"]
reason = "Fixture credentials are fake"

[limits]
max_files = 500

[ai]
required = false
blocking = false
max_packets = 20

Committed on the base branch, this makes tests/untested-change block:

shell
codeveto review --base main --format agent
output
app/users.py:2 agent/reviewer-directive error Instruction to an AI reviewer in a comment or hidden text
app/users.py:3 tests/untested-change error 1 source file changed without a test change
app/users.py:3 security/sql-interpolation error SQL built by f-string reaches execute()
verdict vetoed exit 1

secrets/* includes the non-waivable secrets/private-key, so this ignore is allowed only because its path starts with a literal directory. Every such ignore is listed in the report's config_notes and in the text header.

Keys

Top level

Key Type Default Meaning
fail_on string "error" The lowest severity that blocks: "error", "warning", "note" or "never".
allow_inline_ignores boolean false Honour inline ignores. User config, --config and flags only.

[rules]

Key Type Meaning
enable array of rule IDs Turn on rules, including rules that are off by default such as python/print-call.
disable array of rule IDs Turn rules off. A rule cannot be in both lists.
severity table "<rule-id>" = "error" | "warning" | "note". A hit never exceeds its rule's configured severity.

Rule IDs must exist: codeveto rules lists them.

[[ignore]]

Each entry needs all three keys:

Key Type Meaning
paths non-empty array of globs The paths the entry covers.
rules non-empty array Rule IDs, a whole pack as "secrets/*", or "*" for every rule.
reason string Why, in at most 500 characters with no control characters. Shown in the report.

Globs match the whole Git path, case-sensitively. * and ? stay within one path segment, ** as a whole segment spans directories (a/**/b, **/x, a/**), [abc] and [!a] are character classes, \ makes the next character literal, and a trailing / means the directory and everything below it. There is no implicit basename matching: write **/name for any depth.

[classes]

Key Type Meaning
vendored, generated, minified arrays of globs Treat matching paths as that file class: hygiene and language bug-pattern rules skip them, and the AI pass leaves them out. User config, --config and flags only.

[limits]

Key Default and ceiling Meaning
max_files 2,000 Changed files per review.
max_file_bytes 1,048,576 (1 MiB) Bytes per file.
max_total_bytes 33,554,432 (32 MiB) Bytes in the whole change.
max_file_lines 50,000 Lines per file.
max_total_lines 300,000 Lines in the whole change.
git_seconds 60 Seconds of Git time (a number; the others are integers).

Limits can only be lowered, from any layer. A file over a limit is skipped and the review is incomplete, never silently clear.

[ai]

Key Type Default Meaning
enabled boolean false Run the AI pass. --ai claude or --ai openai sets it.
provider string "none" "claude", "openai" or "none".
model string provider default The model ID.
base_url string provider default The model API base URL.
required boolean false A failed pass makes the review incomplete.
blocking boolean false Verified high-severity AI findings block.
effort string "high" "low", "medium", "high", "xhigh" or "max" (Claude).
max_packets integer 40 Packets sent per review; at most 100.
max_output_tokens integer 32,000 Output tokens per packet.
max_total_input_tokens integer unlimited Input tokens per review.
max_total_output_tokens integer unlimited Output tokens per review.
deadline_s number 600 Seconds for the whole pass.
concurrency integer 4 Requests in flight.

AI review explains the policy and the budgets.

A user config

The user config is the place for what a repository may not decide for you: inline ignores, a network AI provider, models and endpoints.

toml
# ~/.config/codeveto/config.toml
allow_inline_ignores = true

[ai]
enabled = true
provider = "claude"
effort = "medium"
max_total_output_tokens = 200000

With this file, every codeveto review runs the Claude pass. --ai none turns it off for one run; Git hooks and --format agent turn it off unless --ai is given.

What repository config may do

The repository layer comes from the anchor, but its authors are still not the person running the review. It may make the review stricter and may waive rules for specific paths. It may:

  • set fail_on to "error", "warning" or "note";
  • disable or downgrade waivable rules, and enable rules;
  • add [[ignore]] entries for specific paths, with rule IDs, a pack such as "secrets/*", or "*";
  • set [ai] enabled = false, required = true or blocking = true, or provider = "none";
  • lower limits, AI budgets and effort.

It may not, and each of these is a config error that ends the review incomplete:

  • set fail_on = "never";
  • set allow_inline_ignores;
  • set [classes];
  • ignore with a catch-all path, one with no literal character other than / and ., such as **, *, **/* or */**/*.* (decided from the pattern alone, never from the files a change touches);
  • disable or downgrade a non-waivable rule, or ignore one on a path that does not start with a literal segment or that matches .codeveto.toml, a workflow file, an agent configuration file or CODEOWNERS;
  • enable a network AI provider (enabled = true, provider = "claude" or "openai"), choose the model or set base_url;
  • raise any limit, budget or effort above the built-in value.

For example, a repository config with fail_on = "never" at the anchor:

output
codeveto: config error: repository config (.codeveto.toml at anchor ff81f48492e6): fail_on: repository config may not set fail_on = "never"; use --fail-on or user config

User config, --config and flags have none of these restrictions.

Changing the config in a change

A change that edits .codeveto.toml is reviewed under the anchor's copy, and the edit is reported. agent/reviewer-config-changed (warning) fires on any edit. agent/reviewer-config-weakened (error, non-waivable) fires when the new file is less strict than the anchor's: a rule disabled or downgraded, an ignore added or widened, fail_on raised, the AI pass made optional or turned off, an AI budget lowered or removed, a limit raised or removed, or a file that no longer parses or breaks a rule above.

The same weak file, proposed in a change instead of sitting at the anchor:

shell
codeveto review --commit HEAD --format agent
output
.codeveto.toml:1 agent/reviewer-config-changed warning .codeveto.toml changed
.codeveto.toml:1 agent/reviewer-config-weakened error .codeveto.toml weakened: changed .codeveto.toml: fail_on: repository config may not set fail_on = "never"; use --fail-on or user config
verdict vetoed exit 1

Adding the full example above to a repository that had no config is a weakening too: it disables a rule, adds an ignore and lowers max_packets. Make such a change its own pull request, reviewed by the people who own the review policy.

Inline ignores

An inline ignore waives one finding of one rule at one place:

text
codeveto-ignore: <exact-rule-id> -- <reason>

It goes in a comment on the line above the finding, or at the end of the finding's line. CodeVeto honours it only when all of these hold:

  • user config, --config or the command line sets allow_inline_ignores = true;
  • the comment line is unchanged from the trust anchor, so a change cannot waive its own findings;
  • the rule may be ignored inline: non-waivable rules and every rule in secrets/*, agent/* and ci/* cannot be.

There are no globs and no lists: one exact rule ID per comment. An ignore that a change adds or edits is not applied. It is listed in the report's proposed_ignores, and agent/suppression-added fires at the severity of the finding it tried to suppress.

This file was committed with the ignore already in place:

text
def show(x):
    # codeveto-ignore: python/print-call -- the CLI prints its result
    print(x)

A later commit edits only the print line. Without allow_inline_ignores, the finding is reported:

output
lib/debug.py:3 python/print-call note print() in library code
verdict clear exit 0

With allow_inline_ignores = true in the user config, the unchanged comment waives it:

output
verdict clear exit 0

Limits and other caps

  • Intake limits are in [limits]. A change over one is incomplete.
  • At most 500 findings are reported, blocking findings first; the rest become an issue.
  • Lines longer than 4,000 characters are scanned in overlapping windows, so minified files stay reviewable.
  • Each rule, and the whole rule run, has a time budget. Running over makes the review incomplete.
  • Config files are capped at 64 KiB, [[ignore]] reasons at 500 characters, glob patterns at 512 characters.