Skip to main content

Module govern

Module govern 

Source
Expand description

An external agent’s calls under speccoder’s policy: its permission requests, and the file and terminal access speccoder offers it.

Each call is decided as a native attempt’s call is — the same classification (Policy), the same objects, the same grants, the same person through the same Approver — and recorded in the attempt’s tool-call log in the native shape, so task approve, the report and the audit read it alike. A permission request names no stable tool, so it is classified from its declared kind and arguments, never its title; one that cannot be classified goes to a person. With nobody to ask, the first call that needs a person ends the attempt needs_approval, saved with that call for speccoder task approve.

Structs§

Governor
Who decides for one attempt, and what they decided.
PermissionOption
One of the agent’s permission options.
Setup
What a Governor is built from.

Enums§

Verdict
What a call came to.

Constants§

AGENT_CALL
The tool name a call speccoder cannot classify is recorded under.
READS_GRANT
The call kind of a person’s “reads for this task”.
RUNS_ITSELF
Why a command the agent runs itself needs a person.

Functions§

argv_of_line
A command line as an argv: split on ASCII whitespace when it is a plain command, else given to sh -c whole — which a person decides, so a shell’s meaning (or a look-alike space) is never guessed.
commands_of_line
A shell line of plain commands joined by ;, &&, || or newlines: its commands, each plain; None for anything else a shell would read.
holds_a_credential
Whether a file’s text looks like it holds a credential: a private key, a URL with a user and password, a well-known token prefix, or a key/secret/password/token set to a value.
plain_read
The one file a plain-read line (cat src/lib.rs, head -n 5 x) reads; None for anything else — another program, another option, --, -, several files.

Type Aliases§

Command
A command allowed to run: its argv, directory and environment.