Skip to content

Allow disabling TLS verification for opensandbox env - #5204

Closed
activatedgeek wants to merge 6 commits into
mainfrom
sanyamk/harbor-osb-env
Closed

activatedgeek wants to merge 6 commits into
mainfrom
sanyamk/harbor-osb-env

Conversation

@activatedgeek

@activatedgeek activatedgeek commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

OpenSandbox clusters may have self-signed certificates. The native Harbor implementation for OpenSandbox environment does not allow disabling TLS verification in OpenSandbox SDK. This PR allows a tls_verify option in a custom environment class while maintaining all other native behavior.

Validation

Verified by pointing the Harbor commands to an internal self-signed OpenSandbox cluster.

Rollouts

Rollouts remain the same. N/A

Compatibility and benchmark impact

None. This class is opt-in.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

@copy-pr-bot

copy-pr-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:sandbox Sandbox providers, isolation, and sandbox runtime contracts feature New capabilities, enhancements, or enablement work labels Oct 28, 2026
@activatedgeek
activatedgeek marked this pull request as ready for review October 28, 2026 18:33
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 28, 2026 18:34
@activatedgeek
activatedgeek force-pushed the sanyamk/harbor-osb-env branch from 06888d3 to 7270dbc Compare October 28, 2026 18:50
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Oct 28, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 29, 2026
@cmunley1

Copy link
Copy Markdown
Contributor

/review

@cmunley1

Copy link
Copy Markdown
Contributor
  1. Could this use the Gym sandbox bridge instead? NemoGymSandboxEnvironment (responses_api_agents/harbor_agent/custom_envs/nemo_gym_sandbox) runs Harbor tasks through Gym's own OpenSandbox provider, which already has connection.tls_verify (SkillsBench uses it). If something there doesn't work for your tasks (e.g. Dockerfile builds), that would be good to know. If Harbor's native environment is needed, could the option go upstream to Harbor's OpenSandboxEnvironment, with this subclass as a stopgap and a TODO linking that PR?

  2. SDK version. This sets the private ConnectionConfig._ssl_context, which the OpenSandbox SDK only declares and uses from 1.x. On 0.1.x (Gym allows >=0.1.15, terminal_bench_4 pins 0.1.16) pydantic accepts the assignment silently and tls_verify: false has no effect. Could you add an opensandbox>=1.1 floor to harbor_agent_general and a small test that the context reaches the connection?

  3. Smaller: a CA bundle option (ssl.create_default_context(cafile=...)) would cover self-signed clusters without turning verification off, and a warning when it is off would help. A line in the README on how to point a Harbor config at this class would also help.

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SHIP WITH CARE

RISK — Record representative model-backed smoke-rollout evidence. The new opt-in environment changes environment setup, but the description's verification against a self-signed cluster does not identify a model-backed task or inspected agent/verifier outcome. Base AGENTS.md requires that evidence for behavior-changing environment work. This is a validation gap, not a demonstrated runtime defect.

Could you record the exact command/configuration, Harbor/OpenSandbox SDK versions, and one representative real rollout selecting this subclass with tls_verify: false against the self-signed endpoint? If the reported Harbor commands already performed that rollout, documenting its results is sufficient. No implementation change or reward-profile comparison is requested unless validation exposes a failure.

Acceptance: the model performs a tool interaction, the verifier reports the task's expected outcome, and the sandbox is deleted afterward. A minimal proposed case is a task asking the model to write a fixed marker, with a verifier returning 1.0 for the correct marker. Preserve normal verified-TLS behavior: omitted/default and explicit true must reject an untrusted certificate, while a trusted endpoint remains usable.

The changed module and directly affected configuration, worker, and test paths were reviewed. Tests were not executed. Harbor/OpenSandbox dependency implementations were unavailable in the mounted source, so SDK consumption of _ssl_context could not be independently verified.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

self._tls_verify = tls_verify
super().__init__(*args, **kwargs)

def _build_connection_config(self, sdk: dict[str, Any]) -> Any:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NOTE — Suggestion: add regression coverage for the TLS option. The inspected general-agent tests do not exercise this subclass. The existing worker HTTP test uses Gym's separate provider, and the native-config test preserves unrelated environment kwargs. Removing this TLS branch therefore would not be caught by those cases. This is a coverage suggestion, not a proven runtime bug.

Could you add focused tests to the general-agent suite using the installed SDK's actual request path? The invariant is that only an explicitly opted-out instance bypasses certificate verification; other superclass connection settings and other instances remain unaffected.

Proposed acceptance checks, not executed: against a local self-signed HTTPS fixture, an SDK request through the returned configuration succeeds with tls_verify=False, while omitted/default and explicit True reject the certificate. A trusted endpoint still succeeds with verification enabled. Check that representative endpoint, credentials, proxy, and timeout settings survive construction, and create an enabled instance after a disabled one to detect shared-state leakage. Retain the existing worker-serialization assertion that environment kwargs survive unchanged. The external constructor/request implementation was unavailable for inspection, so no speculative test patch is supplied.

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 30, 2026
@activatedgeek
activatedgeek requested a review from a team as a code owner November 2, 2026 20:19
@activatedgeek

Copy link
Copy Markdown
Contributor Author

@cmunley1

  1. Could this use the Gym sandbox bridge instead? NemoGymSandboxEnvironment ...

I was indeed using this earlier, but it led me to the following error on the first step of agent interaction with OpenCode.

{"type":"error","timestamp":1793153448322,"sessionID":"ses_e7fb9cb39ffeKeKlenhywRIbDR","error":{"name":"UnknownError","data":{"message":"Invalid URL"}}}

This was the smallest change which directly uses the OpenSandbox implementation from Harbor without rewriting the whole class. I am not sure if TLS verification should be turned off and whether it would be appropriate for it go into main Harbor releases.

  1. SDK version

I've added the minimum version in the dependencies and verified that it still works. I'm not sure what a test here will look like. Can you provide additional guidance?

  1. Smaller

Updated the README.

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SHIP WITH CARE

The new TLS regression test addresses the prior coverage NOTE: it asserts the SSL context on the SDK-created transport for default, enabled, and disabled verification, along with preservation of connection settings. The dependency floor is also reflected by OpenSandbox 1.2.0 in the lockfile. These are source checks, not executed test results.

RISK — Record representative model-backed smoke-rollout evidence. This remains the unresolved finding from review 5709932163. The description and author reply do not identify a model-backed task, inspected tool interaction, verifier outcome, or sandbox deletion. The current README documents configuration rather than a completed rollout. Behavior-changing environment work requires that validation under trusted AGENTS.md. This is a validation gap for the opt-in integration, not a demonstrated runtime defect.

Could you record the exact command, resolved configuration, model, and installed Harbor/OpenSandbox SDK versions for one real rollout selecting the custom environment with tls_verify: false against the self-signed endpoint? Include the inspected agent trajectory, verifier result, and evidence of sandbox deletion. If the reported commands already performed that rollout, documenting its results is sufficient. No implementation change or reward-profile comparison is requested unless validation exposes a failure.

Acceptance and preservation — proposed checks, not executed: A minimal task can ask the model to write a fixed marker, with a verifier returning 1.0 for the correct marker and 0.0 otherwise. Confirm a model tool interaction, the expected verifier and Gym rollout reward, and sandbox deletion afterward. Retain the existing mandatory deletion contract. Preserve the distinct TLS cases: explicit false permits the self-signed endpoint; omitted/default and explicit true reject an untrusted certificate; a trusted endpoint remains usable with verification enabled.

This follow-up checked the earlier findings and their directly affected configuration, worker, test, and dependency paths. The previously reviewed tree was unavailable, so I couldn't independently establish an inter-review source delta and did not restart whole-PR discovery. Tests and rollouts were not executed, and the external Harbor/OpenSandbox implementations were unavailable for inspection.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@adil-a

adil-a commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/review reset=True

@adil-a

adil-a commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

/ok to test a852d14

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SHIP WITH CARE

The TLS regression test addresses the earlier coverage NOTE: it checks the SDK-created transport for omitted/default, enabled, and disabled verification, plus preservation of connection settings. The SDK dependency floor agrees with OpenSandbox 1.2.0 in the lockfile. These are source checks, not executed test results.

RISK — Record representative model-backed smoke-rollout evidence. This remains the unresolved finding from review 5775721323. Selecting the custom environment with tls_verify: false changes sandbox connection setup, but the supplied validation identifies neither a model-backed task nor inspected agent/verifier outcomes. The README addition documents configuration rather than a completed rollout. Trusted AGENTS.md requires representative real smoke rollouts for behavior-changing environment work. This leaves the opt-in integration unvalidated end to end; it is not a demonstrated runtime defect.

Could you record the exact command, resolved configuration, model, and installed Harbor/OpenSandbox SDK versions for one real rollout through this subclass against the self-signed endpoint? Include the inspected agent trajectory, verifier result, Gym reward, and evidence of sandbox deletion. If the reported Harbor commands already performed that rollout, documenting their results is sufficient. No implementation change or reward-profile comparison is requested unless validation exposes a failure.

Acceptance and preservation — proposed checks, not executed:

  • Use a minimal task asking the model to write a fixed marker, with a verifier returning 1.0 for the correct marker and 0.0 otherwise. Confirm an actual model tool interaction, the expected verifier and Gym reward, and deletion afterward. Retain the mandatory environment-deletion contract.
  • Preserve the distinct TLS cases: explicit false permits the self-signed endpoint; omitted/default and explicit true reject an untrusted certificate; a trusted endpoint remains usable with verification enabled. Retain the existing transport-test assertions for credentials, domain, protocol, proxy, timeout, and transport ownership. SDK creation metrics should remain disabled only in the opted-out case.

I reviewed all six changed files and traced the directly affected configuration, worker, transport, and test contracts. The large lockfile received a semantic comparison of dependency versions, metadata, extras, and relevant markers, not independent verification of every artifact hash. Tests, resolver checks, and rollouts were not executed; the external Harbor/OpenSandbox implementations were unavailable for inspection.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@activatedgeek

Copy link
Copy Markdown
Contributor Author

Closing in favor of native OpenCode and Harbor task format support which already handles the sandboxing environment.

@activatedgeek
activatedgeek deleted the sanyamk/harbor-osb-env branch November 18, 2026 18:57

This branch was previously deployed

1 inactive deployment
public — a852d148 Deployed Nov 6, 2026 by copy-pr-bot[bot] via release / finalize / notify #10627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:sandbox Sandbox providers, isolation, and sandbox runtime contracts feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants