Documentation
¶
Index ¶
- Constants
- Variables
- func Available() []string
- func EnsureClaudeOnboarding(homeDir string)
- func PrepareCodexHome(homeDir string, route *ProxyRoute) error
- func SandboxPrompt(agentName string) string
- func SandboxSkill(agentName string) string
- func SkillDirs() []string
- type Agent
- type Claude
- func (c *Claude) Args(passthrough []string) []string
- func (c *Claude) ConfigOverlays() []Mount
- func (c *Claude) EgressDomains() []string
- func (c *Claude) Env() map[string]string
- func (c *Claude) Image() string
- func (c *Claude) Mounts() []Mount
- func (c *Claude) Name() string
- func (c *Claude) PromptFile() string
- func (c *Claude) ProxyEnvOverride(_ []ProxyRoute) map[string]string
- func (c *Claude) ProxyRoutes() []ProxyRoute
- type Codex
- func (c *Codex) Args(passthrough []string) []string
- func (c *Codex) ConfigOverlays() []Mount
- func (c *Codex) EgressDomains() []string
- func (c *Codex) Env() map[string]string
- func (c *Codex) Image() string
- func (c *Codex) Mounts() []Mount
- func (c *Codex) Name() string
- func (c *Codex) PromptFile() string
- func (c *Codex) ProxyEnvOverride(_ []ProxyRoute) map[string]string
- func (c *Codex) ProxyRoutes() []ProxyRoute
- type MaskedPath
- type Mount
- type OpenCode
- func (o *OpenCode) Args(passthrough []string) []string
- func (o *OpenCode) ConfigOverlays() []Mount
- func (o *OpenCode) EgressDomains() []string
- func (o *OpenCode) Env() map[string]string
- func (o *OpenCode) Image() string
- func (o *OpenCode) Mounts() []Mount
- func (o *OpenCode) Name() string
- func (o *OpenCode) PromptFile() string
- func (o *OpenCode) ProxyEnvOverride(routes []ProxyRoute) map[string]string
- func (o *OpenCode) ProxyRoutes() []ProxyRoute
- type ProtectedPath
- type ProxyRoute
Constants ¶
const ProxyPort = 2376
const SkillName = "clampdown"
SkillName is the directory name for the clampdown skill.
Variables ¶
var Home = os.Getenv("HOME")
Home is the user's home directory, resolved once at startup.
Functions ¶
func EnsureClaudeOnboarding ¶
func EnsureClaudeOnboarding(homeDir string)
EnsureClaudeOnboarding makes sure .claude.json has hasCompletedOnboarding: true. Reads existing file if present, sets the key if missing, writes back.
func PrepareCodexHome ¶
func PrepareCodexHome(homeDir string, route *ProxyRoute) error
PrepareCodexHome seeds the Codex auth/config files inside the agent's persistent HOME directory. In subscription mode the host's ~/.codex/auth.json is copied in once per session (or refreshed when newer), never bind-mounted. The source path is fixed — not configurable — to eliminate a project-.clampdownrc exfiltration primitive.
func SandboxPrompt ¶
SandboxPrompt returns the common sandbox instructions with the agent name substituted into agent-specific paths.
func SandboxSkill ¶
SandboxSkill returns the skill content with agent name substituted.
Types ¶
type Agent ¶
type Agent interface {
Name() string
Image() string
EgressDomains() []string
Mounts() []Mount
ConfigOverlays() []Mount
Env() map[string]string
Args(passthrough []string) []string
PromptFile() string
ProxyRoutes() []ProxyRoute
ProxyEnvOverride(routes []ProxyRoute) map[string]string
}
Agent describes an AI tool that runs inside the sandbox.
type Claude ¶
type Claude struct{}
Claude implements Agent for the Claude Code CLI.
func (*Claude) ConfigOverlays ¶
func (*Claude) EgressDomains ¶
func (*Claude) PromptFile ¶
func (*Claude) ProxyEnvOverride ¶
func (c *Claude) ProxyEnvOverride(_ []ProxyRoute) map[string]string
func (*Claude) ProxyRoutes ¶
func (c *Claude) ProxyRoutes() []ProxyRoute
type Codex ¶
type Codex struct{}
Codex implements Agent for the OpenAI Codex CLI.
func (*Codex) ConfigOverlays ¶
func (*Codex) EgressDomains ¶
func (*Codex) PromptFile ¶
func (*Codex) ProxyEnvOverride ¶
func (c *Codex) ProxyEnvOverride(_ []ProxyRoute) map[string]string
func (*Codex) ProxyRoutes ¶
func (c *Codex) ProxyRoutes() []ProxyRoute
type MaskedPath ¶
MaskedPath is a workdir-relative path whose content is hidden from the agent. Files are replaced with /dev/null; directories with empty read-only tmpfs. Unlike ProtectedPath (which preserves content as read-only), masked paths show the path exists but reads return nothing.
type OpenCode ¶
type OpenCode struct{}
OpenCode implements Agent for the OpenCode CLI (anomalyco/opencode).
func (*OpenCode) ConfigOverlays ¶
func (*OpenCode) EgressDomains ¶
func (*OpenCode) Env ¶
Env redirects TMPDIR because Bun-compiled binaries extract and dlopen native .so files at startup. Default /tmp is mounted noexec, causing a silent hang.
func (*OpenCode) PromptFile ¶
PromptFile returns ~/.config/opencode/AGENTS.md — OpenCode auto-discovers AGENTS.md from ~/.config/opencode/ as global rules.
func (*OpenCode) ProxyEnvOverride ¶
func (o *OpenCode) ProxyEnvOverride(routes []ProxyRoute) map[string]string
ProxyEnvOverride builds OPENCODE_CONFIG_CONTENT for providers whose SDK doesn't read a *_BASE_URL env var. The JSON is deep-merged by OpenCode at highest precedence — no clobbering of user config.
func (*OpenCode) ProxyRoutes ¶
func (o *OpenCode) ProxyRoutes() []ProxyRoute
ProxyRoutes returns upstream API routes for all supported providers.
type ProtectedPath ¶
type ProtectedPath struct {
Path string
IsDir bool
GlobalPath bool // false = workdir-relative (default), true = HOME-relative
}
ProtectedPath is a path that must be read-only inside the agent container. GlobalPath paths are resolved against the agent's persistent HOME directory; workdir-relative paths (GlobalPath: false, the default) are resolved against the working directory.