sessiondebug

package
v0.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package sessiondebug provides the target-bound, read-only evidence tool used by dedicated debug sessions.

Index

Constants

View Source
const (
	// ToolName is the sole tool advertised by a dedicated debug engine.
	ToolName = "InspectSession"
)

Variables

This section is empty.

Functions

func BindSelectedMCP

func BindSelectedMCP(candidate tool.Tool, store port.SessionStore, target session.SessionID, expectedFingerprint string, expectedOwner *session.Principal, ownershipEnforced bool) tool.Tool

BindSelectedMCP wraps one selected direct MCP tool with a final target- incarnation check at execution time, after any interactive approval wait.

func New

func New(target session.SessionID, store port.SessionStore, log port.EventLog) tool.Tool

New constructs an InspectSession tool from the target's current incarnation. Composition uses NewBound so authorization and construction share one read.

func NewBound

func NewBound(target session.SessionID, expectedFingerprint string, expectedOwner *session.Principal, ownershipEnforced bool, store port.SessionStore, log port.EventLog) tool.Tool

NewBound constructs an InspectSession tool permanently bound to one authorized target incarnation and owner scope.

Types

type PermissionPolicy

type PermissionPolicy struct {
	// contains filtered or unexported fields
}

PermissionPolicy preserves deployment denies and configured asks while forcing every selected debug MCP call through a fresh human approval. Read-only annotations do not weaken this rule because outbound reads can disclose target-derived data.

func NewPermissionPolicy

func NewPermissionPolicy(base port.PermissionPolicy, store port.SessionStore, target session.SessionID, expectedFingerprint string, expectedOwner *session.Principal, ownershipEnforced, headless bool, mounted []tool.Tool) *PermissionPolicy

NewPermissionPolicy decorates base for the selected direct MCP tools.

func (*PermissionPolicy) Evaluate

Evaluate delegates to the base policy first. It preserves base denies and configured asks, grants InspectSession only as a debugger floor, and forces selected direct MCP calls through the debug approval posture after revalidating the target incarnation.

func (*PermissionPolicy) Learn

func (p *PermissionPolicy) Learn(id session.SessionID, call session.ToolCall)

Learn deliberately never persists approvals for selected debug MCP calls.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL