Documentation
¶
Overview ¶
Classification of the run's protected settings files and blocked paths, and the typed refusal a covered structured-tool call produces before it is authorized.
Index ¶
- type Label
- type LayerKind
- type LayerSnapshot
- type Monitor
- type Policy
- func (p Policy) Guards() bool
- func (p Policy) ProtectedIn(root string) ([]string, error)
- func (p Policy) RefuseBlockedVCS(tool, cwd string, ...) *Refusal
- func (p Policy) RefuseNominal(tool string, args map[string]any, home, baseDir string) *Refusal
- func (p Policy) RefuseResolved(tool string, endpoints ...string) *Refusal
- func (p Policy) RefuseShell(subjectKind, subject, folder string, candidates []string) *Refusal
- func (p Policy) RefuseVCS(tool, cwd string, risky bool) *Refusal
- type Projection
- type Refusal
- type Result
- type Section
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LayerSnapshot ¶
type LayerSnapshot struct {
Kind LayerKind
Path string
Ignored bool
Present bool
Raw map[string]any
}
LayerSnapshot is one settings layer as bootstrap admitted it, handed to a monitor so the baseline is the content the launch actually loaded rather than a later re-read. Ignored carries a configured project path the trust gate refused: it is retained so the launch can state what it is not watching, and the monitor never opens or locks it.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor holds a runtime-local baseline of the protected settings the launch admitted and compares later checkpoint reads against it. It never touches the live authorization or configuration cache: a checkpoint reports what changed on disk and changes nothing.
func NewMonitor ¶
func NewMonitor(layers []LayerSnapshot) *Monitor
func (*Monitor) AdvanceBaseline ¶
func (m *Monitor) AdvanceBaseline(path string, prior, next Projection) bool
AdvanceBaseline replaces the baseline for path when prior still matches the retained one, so a confirmed publication only advances the state it was computed against. A caller whose prior no longer matches has raced another writer and its change stays visible as drift.
func (*Monitor) Checkpoint ¶
Checkpoint compares every admitted layer against its baseline and returns one result per affected layer, in the order the layers were admitted (global first). A layer that matches its baseline — including an admitted path that was absent and still is — yields no result.
type Policy ¶
type Policy struct {
// Entries must be absolute: a relative entry matches no endpoint and protects nothing.
SettingsPaths []string
Blocked *permissions.BlockedPaths
}
func (Policy) ProtectedIn ¶
ProtectedIn returns every protected identity inside root, hardlink aliases included. A protected file that does not exist cannot be aliased and is skipped; any other stat or directory-read failure is returned, so a caller that cannot enumerate the whole set refuses rather than acting on a partial one.
func (Policy) RefuseBlockedVCS ¶
func (Policy) RefuseNominal ¶
RefuseNominal classifies a covered call's raw endpoint arguments, so a target an operation-specific resolver would reject is still refused as protected state.
func (Policy) RefuseResolved ¶
func (Policy) RefuseShell ¶
type Projection ¶
type Projection struct {
// contains filtered or unexported fields
}
Projection is the protected view of one settings layer. It holds credentials in memory and is only ever compared against another projection — never rendered, logged, hashed, or persisted.
func Project ¶
func Project(raw map[string]any) Projection
Project builds the protected view of an already-validated settings layer.
type Refusal ¶
type Result ¶
type Result struct {
Kind LayerKind
Path string
Reason locks.LockReason
Sections []Section
Labels []Label
}
Result is one layer's checkpoint outcome. It is metadata only: no settings content, permission argument, credential, token, account identifier, or provider name reaches it. Unavailable means the layer could not be inspected under its lock and carries no labels, which is distinct from inspecting it and finding it unreadable.
type Section ¶
type Section string
Section names a protected area of a settings layer. The vocabulary is closed and never carries a configured provider name, which is unbounded user text.
const ( SectionPermissions Section = "permissions" SectionAuth Section = "auth" SectionProviderDestination Section = "provider_destination" SectionProviderCredential Section = "provider_credential" SectionProviderAuthHeader Section = "provider_auth_header" SectionWebResearchCredential Section = "web_research_credential" SectionDeclaredCommands Section = "declared_commands" SectionBlockedPaths Section = "blocked_paths" SectionWritableFolders Section = "writable_folders" )