Skip to content
Kavachकवच

Settings

Also known as: settings configuration config kavach.toml toml options defaults environment variables env vars dotenv KAVACH_GPU ANTHROPIC_API_KEY NO_COLOR log level

● Intermediate6 minBefore this: Project LayoutSpec 10.11

Every setting a project can have, with its values and its default: kavach.toml, then environment variables.

A project's settings live in kavach.toml, next to src/. Leave a setting out and its default applies:

[package]
name = "shop"
version = "0.1.0"
edition = "2026"

[test]
cases = 500

[log]
level = "warn"
kavach.toml: TOML code

A key or section that isn't in the tables below is an error, and the message lists the names the section does have, so a typo can't be ignored silently:

[package]
name = "shop"
taks = "threads"

The compiler refused the program:

error: unknown key `taks` in [package]: expected one of `name`, `version`, `edition`, `unsafe`, `tasks`
kavach.toml: TOML code, then what running it prints

[package]

KeyValuesDefaultSpec
nametext""10.4
versiontext""10.4
editiontext, such as "2026"""10.8
unsafetrue, falsefalse6.4

[build]

KeyValuesDefaultSpec
version_flagtrue, falsefalse10.5: the program answers --version itself

[limits]

KeyValuesDefaultSpec
file_linesa whole number50012.1
fn_linesa whole number8012.1
level"error", "warn", "off""error"12.1
includea list of file patterns["**/*.kav"]12.1
excludea list of file patterns[]12.1

[limits.files]

KeyValuesDefaultSpec
a file's patha whole number: that file's own limitnone12.1

[test]

KeyValuesDefaultSpec
casesa whole number20011.9
deep_casesa whole number1000011.9
time_budgeta time per call: "500ms", "1s", "2m""1s"11.9

[ai]

KeyValuesDefaultSpec
provider"anthropic""anthropic"8.4

[agents]

KeyValuesDefaultSpec
foldera folder's path"agents"8.5: each agent's state, journal and audit log go in <folder>/<Name>/; the rest of an agent's settings are in its code (settings)

[log]

KeyValuesDefaultSpec
level"debug", "info", "warn", "error""info"14.12
consoletrue, falsetrue14.12
filea file's pathnone14.12
max_bytesa whole number1000000014.12
keepa whole number514.12

[log.levels]

KeyValuesDefaultSpec
a module or event typea level, as in [log]none14.12

[log.otlp]

KeyValuesDefaultSpec
endpointa URL; required in this sectionnone14.12
servicetextthe package's name14.12

Paths in kavach.toml are relative to the folder it is in.

Environment variables

Set in the shell before running a program, for one run, instead of in a file:

VariableValuesWhat it doesSpec
KAVACH_GPUoff, on, checkWhere map with a gpu fn runs15.2
ANTHROPIC_API_KEYa keyThe key ask uses; never in kavach.toml8.4
KAVACH_AI_URLa URLWhere ask sends its requests (a test server)8.4
NO_COLORany textNo colors in what the program prints14.12
KAVACH_CHECK_LEAKSany valueAt the end, report heap objects that were never freed6.1
KAVACH_BACKENDcraneliftkavach build uses Cranelift instead of LLVM10.5
KAVACH_LLVM_BINa folderWhere LLVM's tools are10.5
KAVACH_RUNTIME_LIBa file's pathWhere the runtime library is, for linking10.5
KAVACH_UNPACKEDa folderWhere a program built with --compress unpacks itself10.5
KAVACH_SERIALany valueLoops that would run on all cores run on one9.3
KAVACH_ENV_FILEa file's pathThe .env file a built program reads, instead of the one beside it10.13
KAVACH_PROCESS_CALLa numberSet by spawn process for the program it starts: run only that call; not for setting by hand9.8
Go deeper the why, for readers who want it

For work on the compiler itself: these print what a pass did, or turn one off.

VariableWhat it does
KAVACH_CLIFPrints the Cranelift code of each function
KAVACH_LLVM_IRPrints the LLVM code before LLVM optimizes it, and why LLVM isn't used
KAVACH_NO_SROATurns off splitting records into one local per field
KAVACH_SROA_ONLYSplits records only in the functions named (comma-separated)
KAVACH_SROA_LOGPrints each record split
KAVACH_FUSE_LOGPrints each pair of loops fused into one
KAVACH_FUSE_SKELETONPrints main's loops before and after fusing
KAVACH_PAR_LOGPrints each loop spread over all cores
KAVACH_UNRECURSE_LOGPrints why a recursion did or didn't become a loop
KAVACH_FUZZ_CASESHow many cases the fuzz tests try
KAVACH_COMMITWhen the compiler is built: the commit kavach --version and built programs name (10.5), where git can't tell it