Skip to content

fix(workspace): avoid logging forwarded env values - #2630

Merged
neubig merged 1 commit into
mainfrom
sec/redact-runtime-payload
Mar 31, 2026
Merged

neubig merged 1 commit into
mainfrom
sec/redact-runtime-payload

Conversation

@simonrosenberg

@simonrosenberg simonrosenberg commented Mar 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • stop logging the raw runtime start payload in APIRemoteWorkspace
  • log only safe runtime metadata plus forwarded environment keys
  • add a regression test that verifies forwarded env values never appear in logs

Why

APIRemoteWorkspace._start_runtime() was logging Payload: {payload} after copying forwarded host env vars into payload["environment"]. That exposed secrets such as LMNR_PROJECT_API_KEY and provider API keys when instance logs were published in evaluation artifacts.

Testing

  • PYTHONPATH="/Users/simonrosenberg/tmp/software-agent-sdk-sec-leak-fix/openhands-workspace:/Users/simonrosenberg/tmp/software-agent-sdk-sec-leak-fix/openhands-sdk:/Users/simonrosenberg/tmp/software-agent-sdk-sec-leak-fix/openhands-agent-server" pytest tests/workspace/test_api_remote_workspace.py

Refs: #2629


Agent Server images for this PR

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:cd14202-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-cd14202-python \
  ghcr.io/openhands/agent-server:cd14202-python

All tags pushed for this build

ghcr.io/openhands/agent-server:cd14202-golang-amd64
ghcr.io/openhands/agent-server:cd14202-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:cd14202-golang-arm64
ghcr.io/openhands/agent-server:cd14202-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:cd14202-java-amd64
ghcr.io/openhands/agent-server:cd14202-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:cd14202-java-arm64
ghcr.io/openhands/agent-server:cd14202-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:cd14202-python-amd64
ghcr.io/openhands/agent-server:cd14202-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:cd14202-python-arm64
ghcr.io/openhands/agent-server:cd14202-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:cd14202-golang
ghcr.io/openhands/agent-server:cd14202-java
ghcr.io/openhands/agent-server:cd14202-python

About Multi-Architecture Support

  • Each variant tag (e.g., cd14202-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., cd14202-python-amd64) are also available if needed

@github-actions

Copy link
Copy Markdown
Contributor

Python API breakage checks — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟢 Good taste - Straightforward security fix. Solves a real problem (secrets leaking in logs) with an elegant solution: log the keys, not the values. Test coverage is solid. LGTM! 👍

@neubig
neubig merged commit 31cdf5b into main Mar 31, 2026
33 checks passed
@neubig
neubig deleted the sec/redact-runtime-payload branch March 31, 2026 21:09
StressTestor pushed a commit to StressTestor/software-agent-sdk that referenced this pull request Jun 1, 2026
Co-authored-by: Debug Agent <debug@example.com>
pengzhang-create pushed a commit to Pyromind-Dynamics/software-agent-sdk that referenced this pull request Aug 13, 2026
Co-authored-by: Debug Agent <debug@example.com>
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.

3 participants