Expose sandbox bypass across SDKs - #2372
Conversation
There was a problem hiding this comment.
Pull request overview
Exposes the runtime’s optional sandbox-bypass capability through the Rust SDK.
Changes:
- Augments the API schema during Rust code generation.
- Regenerates
SandboxConfigwith optional camelCase serialization. - Tests enabled and omitted serialization behavior.
Show a summary per file
| File | Description |
|---|---|
scripts/codegen/utils.ts |
Adds the temporary schema augmentation. |
scripts/codegen/rust.ts |
Applies augmentation during Rust generation. |
rust/src/generated/api_types.rs |
Adds allow_bypass to SandboxConfig. |
rust/tests/api_types_test.rs |
Verifies serialization and omission. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/4 changed files
- Comments generated: 0
- Review effort level: Balanced
|
Thanks for the Rust implementation of Before this is ready to merge, could you extend the same support to the other five SDKs (Node, C#, Python, Go, and Java)? We want For coverage, please add:
Once all six SDKs have parity and appropriate test coverage, please mark this ready for review again. I'm converting to draft in the meantime. |
056fc1b to
ca26198
Compare
|
Implemented the requested six-language parity in The pinned CLI Targeted codegen, typecheck, serialization, formatting, and lint validation is complete across all six bindings. GitHub reports the branch conflict-free, so I am marking the PR ready for review again. |
|
Thanks for extending the API shape consistently across all six SDKs. The generated bindings are the right eventual direction, and the serialization tests are useful as codegen/regression checks. I've moved this PR to draft because the feature's value is runtime behavior, while the runtime and authoritative schema do not yet ship Please keep this in draft until the runtime feature and schema land. Then remove the temporary |
ca26198 to
ab55453
Compare
|
Final status after rebasing onto current
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ba96325 to
8f31a4d
Compare
SDK Consistency ReviewThis PR only adds test coverage (no SDK client/source changes) for the existing
Naming follows each language's convention correctly (camelCase for TS/Java, PascalCase for .NET/Go, snake_case for Python/Rust), and all tests assert the same round-trip/omit-when-absent behavior for the No feature-parity or API-design inconsistencies found — this looks like a good example of coordinated, consistent test coverage across the SDKs. No action needed.
|
Teach the Rust code generator about the runtime's allowBypass host capability until the pinned CLI schema includes it, then verify camelCase serialization and omission when unset. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Generate SandboxConfig.allowBypass for Node, .NET, Python, Go, Java, and Rust from one temporary schema augmentation. Preserve Python and Java constructor compatibility and cover camelCase round-tripping plus omission in each binding. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the temporary schema augmentation now that CLI 1.0.83-4 ships allowBypass, update serialization coverage for the current generated shapes, and add a real-runtime bypass E2E test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Register replay snapshot and in-process environment hooks before the test runs while avoiding unsupported Windows sandbox setup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the macOS sandbox backend available in CI and prove the approved bypass by observing the denied-path result in the successful tool completion. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Track the grep execution start so the E2E can verify its successful denied-path result even when completion events omit the tool name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
8f31a4d to
5f8f8f1
Compare
SteveSandersonMS
left a comment
There was a problem hiding this comment.
Looks good to merge now. Thanks for landing cross-SDK test parity and the runtime-backed sandbox bypass E2E coverage.
Summary
SandboxConfig.allowBypasscamelCase round-trip and omission coverage for Node, .NET, Python, Go, Java, and RustallowBypassthrough generatedsession.options.update, observes the runtime bypass permission request, approves it, and verifies the blocked command completes outside the sandbox1.0.83-5schema now adopted bymain; the temporary schema augmentation and generated-output changes are gonePaired with github/github-app#12088.
Schema handling
Runtime commit
71bd9ecdde840b90118fcb2217c18b7f2147ef09addedSandboxConfig.allowBypassto the authoritative API schema. SDKmainnow pins CLI1.0.83-5, which contains that definition and has already regenerated all six bindings with their language-idiomatic optional/default/omission behavior and generated documentation.This branch is rebased onto that SDK update. The previous
addSandboxAllowBypasscompatibility augmentation has been removed, and the final diff contains no generated-file changes.Coverage
System.Text.Jsonround-trip/omission test onnet8.0andnet472to_dict/from_dictcoverageencoding/jsonround-trip/omission coverageSome(true)emits"allowBypass": true, round-trips, andNoneis omittedValidation
net8.0andnet472plus format verificationba963255; refreshed CI is running after the final rebase onto CLI1.0.83-5