Sign inSign up

sbx/openhands-kit:latest

Manifest digest

sha256:fe9feb76e9fc71f09fd88f1ec5ec00d7e1525fab54f69b456542ae11cf271d6f

Last pushed

10 days by sbx

Type

Sandbox Kit

Manifest digest

sha256:fe9feb76e9fc71f09fd88f1ec5ec00d7e1525fab54f69b456542ae11cf271d6f

yaml
schemaVersion: "2"
kind: sandbox
name: openhands
displayName: OpenHands
description: |
    AI software engineering agent. Resolves issues, writes code, runs tests, and opens PRs — all autonomously.
sandbox:
    image: docker.io/sbx/openhands-image:latest
    entrypoint:
        - sh
    command:
        default:
            - /home/agent/.local/bin/openhands-start.sh
            - --always-approve
        interactive:
            - /home/agent/.local/bin/openhands-start.sh
            - --always-approve
agentInstructions:
    filename: AGENTS.md
    content: |
        # OpenHands — Sandbox Context

        You are running inside a Docker SBX sandbox.

        ## Environment

        | Item | Value |
        |------|-------|
        | Workspace | `${WORKDIR}` |
        | Sandbox mode | local (code runs in this container) |
        | Persistence | enabled — workspace survives restarts |
        | Confirmation | always-approve mode is active |

        ## Network access

        Outbound requests are filtered. Reachable: GitHub, PyPI (version-check only),
        npm (for `openhands mcp add` servers launched via `npx`), the configured LLM
        API (auth injected by proxy). Tavily search is available if `TAVILY_API_KEY`
        is set.

        ## Working conventions

        1. Read the repo README and existing tests before making changes.
        2. Make the smallest change that satisfies the task.
        3. Run the test suite; fix failures before reporting completion.
        4. Commit with a clear message and push to the current branch.
        5. Use `gh pr create` for pull requests (GitHub CLI is pre-installed).

        ## Switching LLM providers

        Anthropic is resolved automatically from the host credential. For OpenAI
        or Gemini, register the provider secret with `sbx secret set <service>`,
        then open the in-app Settings screen and pick the provider and model
        there — that choice is saved to `~/.openhands/agent_settings.json` and
        takes precedence from then on. See the kit README for details.
permissions:
    network:
        allow:
            - api.anthropic.com
            - platform.claude.com:443
            - api.openai.com
            - generativelanguage.googleapis.com
            - github.com
            - api.github.com
            - raw.githubusercontent.com
            - pypi.org
            - registry.npmjs.org
            - api.tavily.com
credentials:
    - service: anthropic
      apiKey:
        name: ANTHROPIC_API_KEY
        proxyManaged: true
        inject:
            - domain: api.anthropic.com
              header: x-api-key
              format: '%s'
      oauth:
        tokenEndpoint:
            host: platform.claude.com
            path: /v1/oauth/token
        resourceHosts:
            - api.anthropic.com
        sentinels:
            accessToken: sk-ant-oat01-proxy-managed
            refreshToken: sk-ant-ort01-proxy-managed
        credentialFile:
            path: ~/.claude/.credentials.json
            structure:
                claudeAiOauth:
                    accessToken: '{{.AccessToken}}'
                    expiresAt: '{{.ExpiresAt}}'
                    refreshToken: '{{.RefreshToken}}'
                    scopes: '{{.Scopes}}'
    - service: google
      apiKey:
        name: GEMINI_API_KEY
        proxyManaged: true
        inject:
            - domain: generativelanguage.googleapis.com
              header: x-goog-api-key
              format: '%s'
    - service: openai
      apiKey:
        name: OPENAI_API_KEY
        proxyManaged: true
        inject:
            - domain: api.openai.com
              header: Authorization
              format: Bearer %s
environment:
    variables:
        OPENHANDS_SUPPRESS_BANNER: "1"
        SANDBOX_TYPE: local
setup:
    startup:
        - command:
            - sh
            - /home/agent/.local/bin/openhands-anthropic-auth.sh
          user: "1000"
          description: Resolve whether Anthropic auth is an API key, an OAuth login, or absent, and record it for the entrypoint and `sbx exec` shells