Documentation
¶
Overview ¶
Package permissions defines golder's approval modes and the live, mutable state that tracks the active one. It is a leaf package: standard library only, no imports from judge/trust/runtime, so every layer (the risk gate, the bash tool, the slash command) can read the mode without an import cycle.
The four modes mirror codex's approval presets, adapted to golder's gate:
- read-only: mutating tools (bash, apply_patch) are blocked outright.
- ask: the reviewer grades each mutating call; Allow runs, the rest asks the human (or is denied when no prompt exists).
- auto: the reviewer decides: Allow/Confirm run, Sandbox runs isolated, Deny is blocked — each non-trivial decision is announced with a one-line rationale.
- full-access: no review and no sandbox; only the static hard-deny floor still applies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mode ¶
type Mode int
Mode is one of the four approval modes.
const ( // ReadOnly blocks mutating tools: the model may inspect but not change. ReadOnly Mode = iota // Ask grades each mutating call and asks the human about anything that is // not clearly low-risk. Without an interactive prompt the call is denied. Ask // Auto lets the reviewer decide without a human: reviewed calls run, risky // ones run sandboxed, dangerous ones are blocked, and each decision is // announced with its rationale. Auto // FullAccess disables review and sandboxing (the static floor remains). FullAccess )
func FromEnv ¶
FromEnv resolves the default mode from GOLDER_PERMISSIONS. GOLDER_JUDGE=off is honored as a legacy alias for full-access. ok is false when the variable is unset or unparseable, leaving the caller's own default in place.
func Parse ¶
Parse resolves a user-supplied mode name. It accepts the canonical names plus a few common shorthands ("readonly", "ro", "full"), case-insensitively. ok is false for anything unrecognized so callers can report a usage error instead of silently picking a default.
func (Mode) Description ¶
Description returns the one-line explanation shown next to the label.