Configuration
jai uses line-based configuration files that live in $HOME/.jai/ (or $JAI_CONFIG_DIR if set).
Config file lookup
When you run jai cmd, jai looks for a configuration file in this order:
$HOME/.jai/cmd.conf— ifcmdcontains no slashes and does not start with.$HOME/.jai/default.conf— fallback
You can override this with -C file or --conf file. If the path contains no /, it is relative to $HOME/.jai/.
Syntax
Each line has the form:
option [value]option is any long command-line option without the leading --. For example:
conf .defaults
mode casual
dir /local/build
mask MailIf you need to set an option to the empty string, use =:
storage=Blank lines and comments are ignored.
The conf directive
conf acts as an include directive. It logically replaces the conf line with the contents of the specified file at that exact point. Relative paths are relative to $HOME/.jai/.
conf .defaults
mode strict
dir /extra/pathThis reads .defaults first, then the subsequent lines override anything set in .defaults. Because conf is processed inline (not at the end), the order matters: later lines override earlier ones.
The .defaults file
jai auto-generates a .defaults file with sensible defaults — blacklists for sensitive dotfiles (.ssh, .gnupg, etc.) and environment variables (tokens, keys, passwords). You should begin most configuration files with:
conf .defaultsYou can see the default contents with:
jai --print-defaultsThe command directive
jai executes jailed programs through bash. The command directive lets you wrap or modify command execution. The default is:
command "$0" "$@"Where $0 is the command and $@ is its arguments. You can use this to set environment variables, activate virtual environments, or add flags.
Example: Python virtualenv
Create $HOME/.jai/python.conf:
conf default.conf
mode strict
dir venv
name python
command source $HOME/venv/bin/activate; "$0" "$@"Running jai python will now activate the virtualenv before executing the command.
Example: PATH for Claude Code
Create $HOME/.jai/claude.conf:
conf .defaults
name claude
mode strict
command PATH=$HOME/.local/bin:$PATH "$0" "$@"CLI precedence
Command-line options are parsed both before and after the configuration file. This means command-line arguments always take precedence over config file directives.
Within a configuration file, the conf directive reads the included file at the exact point of the directive — it overrides previous lines and is subject to being overridden by subsequent lines.
Example: full config file
conf .defaults
mode strict
name claude
dir .local
mask .bash_history
command PATH=$HOME/.local/bin:$PATH "$0" "$@"This:
- Loads sensible defaults (blacklists, etc.)
- Enables strict mode
- Names the jail
claude - Grants access to
~/.localinside the jail - Hides
.bash_history - Prepends
~/.local/binto PATH before running the command