Skip to content

Add sandbox adapter framework for CLI confinement - #45

Merged
adityathebe merged 19 commits into
mainfrom
claude/captain-multi-instance-workflow-f3ixfs
Aug 4, 2026
Merged

Add sandbox adapter framework for CLI confinement#45
adityathebe merged 19 commits into
mainfrom
claude/captain-multi-instance-workflow-f3ixfs

Conversation

@adityathebe

@adityathebe adityathebe commented Aug 4, 2026

Copy link
Copy Markdown
Member

This PR introduces a pluggable sandbox adapter framework that allows agent CLI processes (claude-cli, codex-cli, gemini-cli) to execute under different confinement mechanisms.

resolves: #39

Summary by CodeRabbit

  • New Features

    • Added configurable sandbox selections, including container, sandbox-runtime, and unsandboxed execution.
    • Added sandbox settings for projects and workflows, with defaults, named backends, and validation.
    • Added prompt-based AI verification hooks for workflow runs.
    • Added structured output fields to prompt run results.
  • Bug Fixes

    • Verification now stops at the first failure and preserves its retry guidance.
    • Command verification now supports timeouts, cancellation, process cleanup, and bounded output.
    • Improved validation and error reporting for unsupported sandbox and workflow configurations.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR adds a pluggable sandbox abstraction with structured configuration, registry support, none/SRT/container adapters, provider integration, and CLI selection. It also adds workflow judge hooks, command hardening, first-failure verification, and exported commit gate helpers.

Changes

Verification and workflow execution

Layer / File(s) Summary
Commit gates and verification flow
pkg/ai/agent/commit/..., pkg/ai/agent/runner.go, pkg/ai/agent/verify_order_test.go
Exports commit gate helpers and stops verification at the first invalid hook result.
Command verifier hardening
pkg/ai/agent/verify/verify.go, pkg/ai/agent/verify/cmd_hardening_test.go
Adds context cancellation, process-group termination, configurable timeouts, and bounded output retention.
Workflow prompt verification
pkg/api/workflow.go, pkg/api/workflow_test.go, pkg/ai/agent/verify/workflow.go, pkg/ai/agent/verify/prompt_hooks_test.go
Adds workflow prompt configuration, validation, LLM judge hook construction, and provider invocation checks.
CLI workflow execution
pkg/cli/prompt_run.go, pkg/cli/prompt_run_live.go, pkg/cli/prompt_run_stream.go, pkg/cli/prompt_run_workflow_test.go
Routes workflow-configured runs through the runner, attaches judge hooks, returns structured output, and removes temporary runs.

Sandbox abstraction and selection

Layer / File(s) Summary
Sandbox contracts and registry
pkg/api/sandbox.go, pkg/api/sandbox_registry.go, pkg/api/sandbox_ref.go, pkg/api/*sandbox*test.go
Defines sandbox lifecycle and capability contracts, registry construction, capability discovery, and scalar/object sandbox references.
Spec and runtime configuration
pkg/api/spec.go, pkg/api/spec_merge.go, pkg/api/runtime_config.go, pkg/api/runtime_registry.go
Adds sandbox references to specs, merge replacement semantics, runtime resolution, and provider compatibility validation.
Saved and CLI sandbox selection
pkg/captainconfig/*, pkg/cli/ai.go, pkg/cli/ai_sandbox.go, pkg/cli/ai_prompt_file.go, pkg/cli/prompt_schema*
Resolves named backends and selector precedence across CLI input, frontmatter, saved defaults, and legacy values.
Sandbox adapters
pkg/sandbox/adapter/*, pkg/sandbox/config.go
Adds none, SRT, and container adapters with command wrapping, policy construction, environment handling, and cleanup.
Provider sandbox command construction
pkg/ai/provider/*
Passes full requests into sandbox-aware CLI execution and removes provider-local sandbox handling.

Sequence Diagram(s)

sequenceDiagram
  participant Provider as ClaudeCLI/CodexCLI/GeminiCLI
  participant CLI as startCLIStream
  participant Adapter as SandboxAdapter
  participant Runtime as DockerOrSRTRuntime
  Provider->>CLI: pass request with SandboxConfig
  CLI->>Adapter: NewSandbox(config)
  Adapter->>Adapter: Prepare(session)
  CLI->>Adapter: Wrap(command)
  Adapter->>Runtime: build wrapped command
  Runtime-->>CLI: wrapped command and environment
  CLI-->>Provider: streamed execution result
Loading
sequenceDiagram
  participant Runner as prompt_run_live
  participant Workflow as PromptHooksForWorkflow
  participant Judge as LLMJudgeVerifier
  participant Provider as ai.Provider
  Runner->>Workflow: load and validate workflow prompts
  Workflow-->>Runner: return judge hooks
  Runner->>Judge: verify round
  Judge->>Provider: execute judge request
  Provider-->>Judge: return response
  Judge-->>Runner: return verdict
  Runner-->>Runner: stop on first invalid verdict
Loading

Possibly related issues

  • Prompt sandboxes #39: Covers the sandbox adapter seam, prompt verification hooks, command hardening, and exported commit gates implemented here.

Possibly related PRs

Suggested reviewers: moshloop

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.23% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the PR's main change: adding a sandbox adapter framework for CLI confinement.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/captain-multi-instance-workflow-f3ixfs
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/captain-multi-instance-workflow-f3ixfs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration

Totals: 0 passed · 0 failed · 0 skipped · -

View full results

@adityathebe
adityathebe marked this pull request as ready for review August 4, 2026 13:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (5)
pkg/api/sandbox_registry.go (1)

29-40: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Consider synchronizing sandboxFactories.

RegisterSandbox writes this map and NewSandbox reads it. Registration at init() time is safe, but tests re-register adapters while other tests construct sandboxes (see pkg/ai/provider/sandbox_seam_test.go:47), which is an unsynchronized concurrent map access under go test -race with parallel packages sharing the process. A sync.RWMutex around both accesses removes the hazard.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/api/sandbox_registry.go` around lines 29 - 40, Synchronize concurrent
access to sandboxFactories by adding a sync.RWMutex, using the write lock in
RegisterSandbox and the read lock around the map lookup in NewSandbox. Keep the
existing registration validation and sandbox construction behavior unchanged.
pkg/api/sandbox_ginkgo_test.go (1)

56-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Restore the global sandbox registry after each spec.

These specs replace the process-global factories for none and srt and never restore them. Ginkgo shares one process across the suite and can randomize spec order, so a later spec that expects the real adapter can observe a stub instead. The provider seam test already restores the previous factory (pkg/ai/provider/sandbox_seam_test.go:45-49). Note also that the spec at line 87 assumes git-agent has no registered adapter in this binary; that assumption breaks silently if a git-agent adapter is later linked in.

♻️ Proposed cleanup helper
+// registerSandboxForSpec registers a stub factory and restores the previous
+// registration when the spec ends.
+func registerSandboxForSpec(kind api.SandboxKind, factory api.SandboxFactory) {
+	previous, existed := api.SandboxFactoryFor(kind) // add this accessor alongside RegisterSandbox
+	api.RegisterSandbox(kind, factory)
+	DeferCleanup(func() {
+		if existed {
+			api.RegisterSandbox(kind, previous)
+			return
+		}
+		api.UnregisterSandbox(kind)
+	})
+}
 	It("constructs the registered adapter for a kind", func() {
-		api.RegisterSandbox(api.SandboxNone, func(cfg api.SandboxConfig) (api.Sandbox, error) {
+		registerSandboxForSpec(api.SandboxNone, func(cfg api.SandboxConfig) (api.Sandbox, error) {
 			return sandboxStub{kind: api.SandboxNone}, nil
 		})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/api/sandbox_ginkgo_test.go` around lines 56 - 113, Restore the
process-global sandbox factories after each spec in the NewSandbox Describe
block, preserving the previous registrations when tests replace the none or srt
adapters and restoring them during cleanup. Also make the “no registered
adapter” assertion in the known-kind test explicitly isolate or reset the
git-agent registration so it remains valid regardless of adapters linked
elsewhere.
pkg/sandbox/adapter/container_test.go (1)

14-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Drop the unused error return from the helpers.

newContainer already fails the test with t.Fatal, so its error result is always nil. prepareContainer then captures that value and discards it with _ = err. Remove the return value so the helper contract matches its behaviour.

♻️ Proposed refactor
 func prepareContainer(t *testing.T, cwd string, options map[string]any) api.Sandbox {
 	t.Helper()
-	sandbox, err := newContainer(t, options)
-	if _, err2 := sandbox.Prepare(context.Background(), specWithCwd(cwd)); err2 != nil {
-		t.Fatal(err2)
-	}
-	_ = err
+	sandbox := newContainer(t, options)
+	if _, err := sandbox.Prepare(context.Background(), specWithCwd(cwd)); err != nil {
+		t.Fatal(err)
+	}
 	return sandbox
 }
 
-func newContainer(t *testing.T, options map[string]any) (api.Sandbox, error) {
+func newContainer(t *testing.T, options map[string]any) api.Sandbox {
 	t.Helper()
 	sandbox, err := api.NewSandbox(api.SandboxConfig{Kind: api.SandboxContainer, Options: options})
 	if err != nil {
 		t.Fatal(err)
 	}
 	t.Cleanup(func() { _ = sandbox.Close() })
-	return sandbox, nil
+	return sandbox
 }

Update the three call sites at lines 114, 124 and 137 accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/sandbox/adapter/container_test.go` around lines 14 - 32, Remove the
unused error return from newContainer and update its callers to receive only the
sandbox value; adjust prepareContainer to stop capturing and discarding err,
while preserving the existing t.Fatal handling for sandbox creation and
preparation failures. Update the three newContainer call sites accordingly.
pkg/sandbox/adapter/srt.go (1)

75-86: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Report runtime teardown failures, and consider bounding runtime accumulation.

Close discards every runtime.Close error, so a confinement that fails to tear down leaves no trace. Join the errors and return them.

Each Wrap call also creates a new confinement and retains it until Close. Resources therefore accumulate for the lifetime of the sandbox. If the policy depends only on the CLI name, cache the runtime per command instead of appending one per call.

♻️ Proposed refactor for the error reporting
 func (s *srtSandbox) Close() error {
 	s.mu.Lock()
 	runtimes := s.runtimes
 	s.runtimes = nil
 	s.mu.Unlock()
+	var errs []error
 	for _, runtime := range runtimes {
 		closeCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
-		_ = runtime.Close(closeCtx)
+		if err := runtime.Close(closeCtx); err != nil {
+			errs = append(errs, err)
+		}
 		cancel()
 	}
-	return nil
+	return errors.Join(errs...)
 }

Add "errors" to the imports.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/sandbox/adapter/srt.go` around lines 75 - 86, Update srtSandbox.Close to
collect each runtime.Close failure and return the aggregated errors instead of
discarding them, using the errors package. Also revise Wrap and the runtime
storage so confinement instances are cached and reused by CLI name when the
policy depends only on that name, rather than appending a new runtime for every
call.
pkg/sandbox/adapter/cli_env.go (1)

9-19: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Pass through the CLI authentication environment variables each wrapper supports.

The repository pinpoints ANTHROPIC_AUTH_TOKEN plus the Anthropic mock also exports ANTHROPIC_BASE_URL; OpenAI mock exports OPENAI_BASE_URL; Google Gen AI has a Vertex path and related env vars. Add the alternate variables needed for each filepath.Base(command) path, then update the shared srt and container tests so containers and sandbox-runtime both stay aligned.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/sandbox/adapter/cli_env.go` around lines 9 - 19, Update the
cliCredentialEnv function to include all authentication variables that each CLI
wrapper supports. For the "claude" case, add ANTHROPIC_AUTH_TOKEN and
ANTHROPIC_BASE_URL to the returned environment variables. For the "codex" case,
add OPENAI_BASE_URL alongside OPENAI_API_KEY. For the "gemini" case, add the
Vertex-related environment variables alongside the existing GEMINI_API_KEY and
GOOGLE_API_KEY. Then update the shared srt and container tests to verify that
both the sandbox-runtime and containers pass through the complete set of
environment variables for each CLI command path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/ai/agent/verify/verify.go`:
- Around line 111-143: Update the command execution flow around
context.WithTimeout and cmd.Run so verifier timeout detection uses a separate
context dedicated to c.Timeout, while preserving the original parent context for
cancellation errors. Return the timeout Verdict only when the verifier timeout
context exceeds its deadline; if the parent deadline fires first, return the
parent ctx.Err() instead. Add a regression test covering a parent deadline
shorter than Timeout.

In `@pkg/ai/agent/verify/workflow.go`:
- Around line 50-53: Reject whitespace-only entries in PromptHooksForWorkflow
instead of silently skipping them, returning an indexed validation error
consistent with pkg/api/workflow.go. Update pkg/ai/agent/verify/workflow.go
lines 50-53 accordingly; in pkg/ai/agent/verify/prompt_hooks_test.go lines
46-55, remove the blank entry from the successful case and add coverage
asserting that a blank prompt entry fails.

In `@pkg/api/runtime_registry.go`:
- Around line 52-63: The legacy sandbox validation guard that checks cfg.Sandbox
needs to respect SandboxSelection precedence. Locate the legacy guard that
validates based on cfg.Sandbox and wrap it in a condition so it only runs when
cfg.SandboxSelection is nil. This ensures that when a caller explicitly sets
SandboxSelection, the legacy guard does not override or reject that explicit
choice. The new SandboxSelection validation block shown in the diff should
remain unchanged and execute regardless.

In `@pkg/api/sandbox_ref.go`:
- Around line 172-178: Update SandboxRef.Validate to reject a set scalar
reference with an empty Backend, including sandbox: "" and scalar null decodings
that have no overrides. Preserve the existing backend requirement for
agent/policy overrides and the MaxAttempts validation, while ensuring any
present ref must select a non-empty backend.
- Around line 60-89: Update SandboxRef.UnmarshalJSON to return immediately for
explicit JSON null without modifying the receiver, and decode the object form
with a strict JSON decoder that rejects unknown fields such as “backed”.
Preserve the existing scalar-string handling and alias assignment for valid
object input.

In `@pkg/api/sandbox_registry.go`:
- Around line 62-69: Update NewSandbox immediately after the factory(cfg) call
to reject a nil Sandbox even when err is nil, returning an appropriate
construction error before verifySandboxCapabilities or any Close call. Preserve
the existing factory-error handling and capability verification for non-nil
sandbox instances, including SandboxNone.

In `@pkg/cli/ai_prompt_file.go`:
- Around line 196-204: The overlayCLI configuration must override inherited
sandbox settings when the resolved sandbox selection is none. Update the sandbox
handling around sandboxSelectionConfig so the none case explicitly clears both
cfg.Sandbox and cfg.SandboxSelection, while preserving named sandbox and
inherited SRT behavior. Add overlay tests covering inherited SRT and named
sandbox defaults.

In `@pkg/cli/prompt_run.go`:
- Around line 152-157: Update the workflow branch in executeSyncRunSingleDirect
to preserve opts.NoStream by threading it into executeSyncWorkflowRun or
selecting an equivalent non-streaming runner path. Ensure workflow prompts with
--no-stream avoid runPromptStream and do not require an ai.StreamingProvider,
while leaving the existing streaming behavior unchanged when the option is
unset.

In `@pkg/sandbox/adapter/container.go`:
- Around line 105-112: Update pathWithin to resolve relative path values against
root before calling filepath.Abs, while preserving absolute paths unchanged; use
the resulting path for symlink evaluation and containment checks so it matches
the project directory used by spec.Cwd and the Docker source path behavior.
- Around line 62-77: Restrict preset handling in the container configuration
flow around rejectUntrustedContainerConfig and c.options["presets"] so
repository-supplied presets cannot influence host environment variables or
mounts. Only apply presets from trusted backend options, or validate every
preset-derived environment and volume through the same trust checks before Wrap
expands them into -e or -v arguments; preserve trusted preset behavior.

In `@pkg/sandbox/adapter/srt.go`:
- Around line 68-72: Update the environment selection in the srt adapter’s Wrap
flow so variables declared through the env argument are preserved when cmd.Env
is non-empty. Either include those declared variables in
srtConfigFor(...).PassthroughEnv when it is the complete allowlist, or append
env to wrappedEnv before returning; retain existing command environment values.
- Around line 130-141: Extend the DenyRead list in the sandbox policy with the
remaining home-directory credential-store paths, then add the identical entries
to the denyRead fixture in the related SRT tests so policy and fixture coverage
remain synchronized.

In `@pkg/sandbox/config.go`:
- Around line 10-21: Preserve the existing ~/.captain.yaml key names for the
aliased configuration types in pkg/sandbox/config.go. Update the configuration
decoding path around MitmProxyConfig, NetworkConfig, FilesystemConfig,
RipgrepConfig, and SeccompConfig to use local wrapper structs or equivalent
YAML-tag overrides for legacy keys such as allowed_domains, socks_proxy_port,
and allow_git_config, rather than exposing sandboxruntime’s camelCase tags; keep
the upstream aliases only where they do not change the persisted schema.

---

Nitpick comments:
In `@pkg/api/sandbox_ginkgo_test.go`:
- Around line 56-113: Restore the process-global sandbox factories after each
spec in the NewSandbox Describe block, preserving the previous registrations
when tests replace the none or srt adapters and restoring them during cleanup.
Also make the “no registered adapter” assertion in the known-kind test
explicitly isolate or reset the git-agent registration so it remains valid
regardless of adapters linked elsewhere.

In `@pkg/api/sandbox_registry.go`:
- Around line 29-40: Synchronize concurrent access to sandboxFactories by adding
a sync.RWMutex, using the write lock in RegisterSandbox and the read lock around
the map lookup in NewSandbox. Keep the existing registration validation and
sandbox construction behavior unchanged.

In `@pkg/sandbox/adapter/cli_env.go`:
- Around line 9-19: Update the cliCredentialEnv function to include all
authentication variables that each CLI wrapper supports. For the "claude" case,
add ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL to the returned environment
variables. For the "codex" case, add OPENAI_BASE_URL alongside OPENAI_API_KEY.
For the "gemini" case, add the Vertex-related environment variables alongside
the existing GEMINI_API_KEY and GOOGLE_API_KEY. Then update the shared srt and
container tests to verify that both the sandbox-runtime and containers pass
through the complete set of environment variables for each CLI command path.

In `@pkg/sandbox/adapter/container_test.go`:
- Around line 14-32: Remove the unused error return from newContainer and update
its callers to receive only the sandbox value; adjust prepareContainer to stop
capturing and discarding err, while preserving the existing t.Fatal handling for
sandbox creation and preparation failures. Update the three newContainer call
sites accordingly.

In `@pkg/sandbox/adapter/srt.go`:
- Around line 75-86: Update srtSandbox.Close to collect each runtime.Close
failure and return the aggregated errors instead of discarding them, using the
errors package. Also revise Wrap and the runtime storage so confinement
instances are cached and reused by CLI name when the policy depends only on that
name, rather than appending a new runtime for every call.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dce7cba6-476b-4023-b88f-338707b5d407

📥 Commits

Reviewing files that changed from the base of the PR and between ceff736 and 88e001f.

📒 Files selected for processing (50)
  • pkg/ai/agent/commit/commit.go
  • pkg/ai/agent/commit/gates.go
  • pkg/ai/agent/runner.go
  • pkg/ai/agent/verify/cmd_hardening_test.go
  • pkg/ai/agent/verify/prompt_hooks_test.go
  • pkg/ai/agent/verify/verify.go
  • pkg/ai/agent/verify/workflow.go
  • pkg/ai/agent/verify_order_test.go
  • pkg/ai/provider/claude_cli.go
  • pkg/ai/provider/cli.go
  • pkg/ai/provider/cli_test.go
  • pkg/ai/provider/codex_cli.go
  • pkg/ai/provider/gemini_cli.go
  • pkg/ai/provider/init.go
  • pkg/ai/provider/sandbox_seam_test.go
  • pkg/api/runtime_config.go
  • pkg/api/runtime_registry.go
  • pkg/api/sandbox.go
  • pkg/api/sandbox_ginkgo_test.go
  • pkg/api/sandbox_ref.go
  • pkg/api/sandbox_ref_ginkgo_test.go
  • pkg/api/sandbox_registry.go
  • pkg/api/spec.go
  • pkg/api/spec_merge.go
  • pkg/api/spec_merge_differential_test.go
  • pkg/api/workflow.go
  • pkg/api/workflow_test.go
  • pkg/captainconfig/config.go
  • pkg/captainconfig/sandbox_test.go
  • pkg/cli/ai.go
  • pkg/cli/ai_prompt_file.go
  • pkg/cli/ai_prompt_file_test.go
  • pkg/cli/ai_sandbox.go
  • pkg/cli/ai_sandbox_test.go
  • pkg/cli/ai_test.go
  • pkg/cli/prompt_run.go
  • pkg/cli/prompt_run_live.go
  • pkg/cli/prompt_run_stream.go
  • pkg/cli/prompt_run_workflow_test.go
  • pkg/cli/prompt_source.go
  • pkg/cli/prompt_source_test.go
  • pkg/cli/prompt_workflow.go
  • pkg/sandbox/adapter/cli_env.go
  • pkg/sandbox/adapter/container.go
  • pkg/sandbox/adapter/container_test.go
  • pkg/sandbox/adapter/none.go
  • pkg/sandbox/adapter/none_test.go
  • pkg/sandbox/adapter/srt.go
  • pkg/sandbox/adapter/srt_test.go
  • pkg/sandbox/config.go

Comment thread pkg/ai/agent/verify/verify.go Outdated
Comment thread pkg/ai/agent/verify/workflow.go Outdated
Comment thread pkg/api/runtime_registry.go
Comment thread pkg/api/sandbox_ref.go
Comment thread pkg/api/sandbox_ref.go
Comment thread pkg/sandbox/adapter/container.go
Comment thread pkg/sandbox/adapter/container.go
Comment thread pkg/sandbox/adapter/srt.go
Comment thread pkg/sandbox/adapter/srt.go
Comment thread pkg/sandbox/config.go
claude and others added 2 commits August 4, 2026 13:50
… container preset trust, deny-read expansion)
Repository container configuration could still escape containment through a missing bind source below an outward symlink, while trusted preset values were exposed in Docker argv. Descriptor capabilities could also go unverified, and the prompt schema omitted configured sandbox selectors.

Canonicalize existing bind-source parents, pass preset environment values by name, fail closed on unchecked capabilities, and inject configured sandbox names into both SandboxRef schema forms. Stop advertising SRT egress until that capability has a verifiable seam.
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Gavel results

Gavel exited with code .

View full results

claude and others added 2 commits August 4, 2026 15:42
Synchronous workflow runs always selected the streaming runner, dropping --no-stream and rejecting buffered-only providers.\n\nRoute no-stream generation through Provider.Execute while adapting the completed response into runner events, preserving workflow hooks and leaving normal streaming unchanged.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yml:
- Around line 55-60: Add CI coverage for pkg/cli/webapp by adding a workflow job
or run that checks out or installs the sibling clicky-ui dependency, then
executes the vitest suite defined by pkg/cli/webapp/package.json. Keep the
existing Gavel exclusions for tests/e2e and pkg/cli/webapp, and ensure the new
step runs in an environment where the sibling dependency is available.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a840cf62-c768-435d-8c78-04cd52890a7a

📥 Commits

Reviewing files that changed from the base of the PR and between 88e001f and 1fa49e2.

📒 Files selected for processing (21)
  • .github/workflows/test.yml
  • pkg/ai/agent/verify/cmd_hardening_test.go
  • pkg/ai/agent/verify/prompt_hooks_test.go
  • pkg/ai/agent/verify/verify.go
  • pkg/ai/agent/verify/workflow.go
  • pkg/api/registry/sandboxes.go
  • pkg/api/runtime_registry.go
  • pkg/api/sandbox_ginkgo_test.go
  • pkg/api/sandbox_ref.go
  • pkg/api/sandbox_ref_ginkgo_test.go
  • pkg/api/sandbox_registry.go
  • pkg/cli/ai_prompt_file.go
  • pkg/cli/ai_prompt_file_test.go
  • pkg/cli/prompt_schema.go
  • pkg/cli/prompt_schema_build.go
  • pkg/cli/prompt_schema_test.go
  • pkg/sandbox/adapter/cli_env.go
  • pkg/sandbox/adapter/container.go
  • pkg/sandbox/adapter/container_test.go
  • pkg/sandbox/adapter/srt.go
  • pkg/sandbox/adapter/srt_test.go
🚧 Files skipped from review as they are similar to previous changes (13)
  • pkg/sandbox/adapter/srt_test.go
  • pkg/ai/agent/verify/prompt_hooks_test.go
  • pkg/sandbox/adapter/container_test.go
  • pkg/ai/agent/verify/cmd_hardening_test.go
  • pkg/sandbox/adapter/srt.go
  • pkg/api/runtime_registry.go
  • pkg/ai/agent/verify/workflow.go
  • pkg/ai/agent/verify/verify.go
  • pkg/sandbox/adapter/cli_env.go
  • pkg/api/sandbox_registry.go
  • pkg/cli/ai_prompt_file.go
  • pkg/api/sandbox_ref_ginkgo_test.go
  • pkg/sandbox/adapter/container.go

Comment thread .github/workflows/test.yml
@adityathebe
adityathebe merged commit beff162 into main Aug 4, 2026
12 checks passed
@adityathebe
adityathebe deleted the claude/captain-multi-instance-workflow-f3ixfs branch August 4, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompt sandboxes

2 participants