Skip to main content

Module gate

Module gate 

Source
Expand description

Which kind of refusal a gated command is: one safe-chains has not approved YET, or a boundary.

A harness that can put a command to a person in the moment (Grok’s ask) can let a person decide the first kind, since nothing about it is known to be dangerous: there is simply no entry or grant for it. The second kind stays a hard refusal whatever the harness can do, because it is what safe-chains exists to stop an agent from getting through by asking: credentials, raw devices, the files safe-chains and the system read their trust from, the places whose contents run later without anyone being asked, other AI agents, and safe-chains’ own rule edits.

NotYet is the narrow answer and Boundary the default. A command is NotYet only when every check below passes; anything the checks cannot read with confidence is a Boundary, which is today’s deny:

  • The command text holds nothing that makes its words unknowable before the shell runs it: no $ expansion, backtick, glob or brace, ~user, change of directory, or program that runs code it was handed or names (a shell, eval, an interpreter, xargs, env, a package runner), and no -P cluster keeping absolute names.
  • With quotes and backslashes removed, no word of the WHOLE command (approved segments, function bodies and -c strings included, attached option values too) names a protected place, a place outside the workspace but for a temporary folder, a project file that runs later (.git, .envrc, an agent’s or editor’s project settings), an AI agent or its package, or safe-chains. Removing them can only join or split words, so this finds every name the shell would see.
  • No place the whole command reaches, by workspace_reaches, is protected.
  • Each refused segment’s fix_for answer is an entry, a grant, a level, or a read of a runs-later place, never a credential, a device, a frozen file, an agent or an interpolation.

Enums§

GateKind
The kind of a gated command. See the module docs.

Functions§

gate_kind
The kind of the gated command, from its text and its explanation.
segment_kind
The kind of one refused segment, from what fix_for says would approve it.