Expand description
The [read_paths] allowlist: how an agent is granted read access outside
its workdir, and how each access is checked.
A blueprint’s [read_paths] allow array declares what the agent wants to
read. Declaring is not granting: the user’s config must either name the
same paths ([security] read_paths / [agent_read_paths.<name>]) or set
allow_blueprint_read_paths = true. That keeps the manifest tighten-only -
an agent.leviath someone downloaded cannot ship one TOML line that reads
~/.ssh. ReadPathPolicy::decide is that double check, applied per path
at resolve time.
Three entry forms:
- an exact path: grants the whole subtree under it, checked with the same canonicalize-then-prefix containment as the workdir sandbox
glob:- a glob pattern,*stays inside one path component,**crosses themregex:- a regex, auto-anchored as^(?:pattern)$soregex:runscannot quietly match/etc/runs-anything
Patterns match the symlink-resolved real path of the file, never the
path the agent asked for. That is what makes them safe: a symlink planted
inside an allowlisted directory resolves to its real target, and the real
target must itself match an entry. The matched string uses / separators
on every OS and, on Windows, has the \\?\ verbatim prefix stripped and is
compared case-insensitively (see normalize_match_str).
Portability: ~/ expands to the home directory (honoring LEVIATH_HOME),
and a bare relative entry resolves against the run’s workdir. A relative
regex: is refused - there is no way to splice a workdir into a regex
safely, and glob: covers that case.
Structs§
- Read
Path Policy - Everything read-path enforcement needs, resolved once at spawn.
- Read
Path Set - A compiled set of allowlist entries, bound to the run they were compiled for (tilde and relative entries were resolved at compile time).
Enums§
- Read
Path Decision - The outcome of checking one path against a
ReadPathPolicy. - Read
Path Entry - One compiled allowlist entry. Only
ReadPathSetconstructs these; the enum is public so a set’s contents are inspectable, not so callers build entries by hand (compilation is where~/relative resolution and anchoring happen).
Functions§
- normalize_
match_ str - Normalize a canonicalized path string for glob/regex matching.
- validate_
entry_ syntax - Validate one entry’s syntax without binding it to a run: bad glob/regex,
a relative
regex:, an empty entry. Called from manifest parsing so a broken entry failslev validate/lev add/spawn loudly instead of degrading the agent at its first out-of-workdir read.