std::permissions::grants
What khora.toml granted, as Khora.
This file is replaced at build time. khora build reads the whole
[permissions] table – fs, env, network and process alike – and
writes this module out with the manifest’s own patterns in all five
functions below; what is on disk is the default, which grants everything.
It is a file of its own so that the replacement is a whole file rather
than surgery on one: the matcher in std::permissions is real code that
nothing generated should be editing, and a compiler that rewrites a
function body inside a file it does not otherwise understand is a compiler
that breaks the next time somebody reformats it.
A missing [permissions] table grants everything. That is opt-in
tightening rather than a tax on starting, and it is why the defaults here
are wildcards rather than nothing: ** for the two path grants, which
spans separators, and * for env, network and process, whose
subjects are single names.
API at a glance
Section titled “API at a glance”Functions: fs_read · fs_write · env · network · process
Functions
Section titled “Functions”fs_read
Section titled “fs_read”pub fn fs_read() -> List<String>Paths this program may read.
fs_write
Section titled “fs_write”pub fn fs_write() -> List<String>Paths this program may write.
pub fn env() -> List<String>Environment variables this program may read.
network
Section titled “network”pub fn network() -> List<String>Hosts this program may reach, as name or name:port.
process
Section titled “process”pub fn process() -> List<String>Programs this program may run, by name.
Khora 0.4.0built frombd964738afb6on 2026-10-17 20:41ZVersioningSecurityContributingReleasesSource