Skip to content
Open
11 changes: 11 additions & 0 deletions .github/workflows/reusable-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,11 @@ jobs:
- name: Run triage agent
uses: ./.defaults/
env:
# Remote OpenShell gateway endpoint from repository variables
# (#9044): passed via a dedicated channel so an unset variable
# (rendered as an empty string) does not shadow a value configured
# in the runner's own process environment.
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
Comment thread
jctanner marked this conversation as resolved.
Resolved
Comment thread
jctanner marked this conversation as resolved.
Resolved
Comment thread
jctanner marked this conversation as resolved.
Resolved
Comment thread
jctanner marked this conversation as resolved.
Resolved
Comment thread
jctanner marked this conversation as resolved.
Resolved
Comment thread
jctanner marked this conversation as resolved.
Resolved
Comment thread
jctanner marked this conversation as resolved.
Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] backward-incompatible

The dispatch and prioritize workflows now pass vars.OPENSHELL_GATEWAY_ENDPOINT as FULLSEND_OPENSHELL_GATEWAY_ENDPOINT, which takes precedence over the runner's own OPENSHELL_GATEWAY_ENDPOINT. An existing repository or organization variable with this name used for another purpose will now override the runner environment and switch the run to remote-gateway mode; the variable is read from the calling repository, so the effect differs by run type.

Suggested fix: Document the precedence and calling-repository scoping in the migration notes (advanced-setup.md already covers most of this).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] backward-incompatible

All seven agent steps pass FULLSEND_OPENSHELL_GATEWAY_ENDPOINT from vars.OPENSHELL_GATEWAY_ENDPOINT; a repository that already has a variable of that name for another purpose will switch to remote-gateway mode and skip Podman.

Suggested fix: Note in the release notes that an existing OPENSHELL_GATEWAY_ENDPOINT repository or organization variable now changes behavior.

Comment thread
jctanner marked this conversation as resolved.
Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] backward-incompatible

The reusable workflows now read vars.OPENSHELL_GATEWAY_ENDPOINT from the calling repository and pass it as FULLSEND_OPENSHELL_GATEWAY_ENDPOINT (seven steps in reusable-dispatch.yml plus reusable-prioritize.yml). A non-empty variable takes precedence over the runner's own OPENSHELL_GATEWAY_ENDPOINT, so callers that already hold an organization or repository variable of that name for another purpose will have runs redirected to it. The opt-in lock mitigates this but the default is unlocked. The precedence change is documented.

Suggested fix: Call out the precedence change and the lock in the release notes, or make the default safer.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] protected-path

This PR modifies protected paths: .github/workflows/reusable-dispatch.yml and .github/workflows/reusable-prioritize.yml. The PR links issue #9044 and explains the rationale, but human approval is always required for protected-path changes, regardless of context.

Suggested fix: A human maintainer must review and approve the workflow changes.

GITHUB_ISSUE_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
FULLSEND_WORK_ITEM_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
REPO_FULL_NAME: ${{ github.repository }}
Expand Down Expand Up @@ -1646,6 +1651,7 @@ jobs:
- name: Run code agent
uses: ./.defaults/
env:
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
GITHUB_ISSUE_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
FULLSEND_WORK_ITEM_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
FULLSEND_WORK_ITEM_KEY: ${{ fromJSON(needs.route.outputs.event_payload).issue.number }}
Expand Down Expand Up @@ -1822,6 +1828,7 @@ jobs:
- name: Run review agent
uses: ./.defaults/
env:
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
GITHUB_ISSUE_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
FULLSEND_WORK_ITEM_URL: ${{ fromJSON(needs.route.outputs.event_payload).pull_request.html_url || fromJSON(needs.route.outputs.event_payload).issue.html_url }}
GITHUB_PR_URL: ${{ fromJSON(needs.route.outputs.event_payload).pull_request.html_url || fromJSON(needs.route.outputs.event_payload).issue.html_url }}
Expand Down Expand Up @@ -2091,6 +2098,7 @@ jobs:
- name: Run fix agent
uses: ./.defaults/
env:
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
PR_NUMBER: ${{ steps.context.outputs.pr_number }}
REPO_FULL_NAME: ${{ github.repository }}
TARGET_BRANCH: ${{ steps.context.outputs.base_ref }}
Expand Down Expand Up @@ -2209,6 +2217,7 @@ jobs:
- name: Run retro agent
uses: ./.defaults/
env:
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
ORIGINATING_URL: ${{ fromJSON(needs.route.outputs.event_payload).pull_request.html_url || fromJSON(needs.route.outputs.event_payload).issue.html_url }}
RETRO_COMMENT: ${{ fromJSON(needs.route.outputs.event_payload).comment.body || '' }}
REPO_FULL_NAME: ${{ github.repository }}
Expand Down Expand Up @@ -2310,6 +2319,7 @@ jobs:
- name: Run prioritize agent
uses: ./.defaults/
env:
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
GITHUB_ISSUE_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
FULLSEND_WORK_ITEM_URL: ${{ fromJSON(needs.route.outputs.event_payload).issue.html_url }}
REPO_FULL_NAME: ${{ github.repository }}
Expand Down Expand Up @@ -2691,6 +2701,7 @@ jobs:
- name: Run harness agent
uses: ./.defaults/
env:
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
GITHUB_ISSUE_URL: ${{ steps.dispatch-env.outputs.issue_url }}
FULLSEND_WORK_ITEM_URL: ${{ steps.dispatch-env.outputs.issue_url }}
FULLSEND_WORK_ITEM_KEY: ${{ steps.dispatch-env.outputs.work_item_key }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/reusable-prioritize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ jobs:
- name: Run prioritize agent
uses: ./.defaults/
env:
# Remote OpenShell gateway endpoint from repository variables
# (#9044): passed via a dedicated channel so an unset variable
# (rendered as an empty string) does not shadow a value configured
# in the runner's own process environment.
FULLSEND_OPENSHELL_GATEWAY_ENDPOINT: ${{ vars.OPENSHELL_GATEWAY_ENDPOINT }}
GITHUB_ISSUE_URL: ${{ fromJSON(inputs.event_payload).issue.html_url }}
REPO_FULL_NAME: ${{ inputs.source_repo }}
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ vars.OTEL_EXPORTER_OTLP_ENDPOINT }}
Expand Down
76 changes: 69 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,81 @@ runs:
shell: bash
run: fullsend --version

# A runner that sets OPENSHELL_GATEWAY_ENDPOINT uses an OpenShell gateway
# that runs elsewhere. Sandboxes are created on that gateway, so the
# runner needs no Podman and no local gateway (#9044). This step reads the
# runner process environment: the `env` context in an `if:` holds only
# workflow, job and step variables, not the runner's own environment.
# A remote OpenShell gateway runs elsewhere; sandboxes are created on
# it, so the runner needs no Podman and no local gateway (#9044). The
# endpoint comes from the repository variable the dispatch workflow
# passes as FULLSEND_OPENSHELL_GATEWAY_ENDPOINT, or, when that is unset,
# from the runner's own process environment: the `env` context in an
# `if:` holds only workflow, job and step variables, not the runner's
# own environment.
- name: Detect sandbox host
id: sandbox-host
shell: bash
run: |
set -euo pipefail
if [[ -n "${OPENSHELL_GATEWAY_ENDPOINT:-}" ]]; then
echo "OPENSHELL_GATEWAY_ENDPOINT is set: using the existing OpenShell gateway, skipping local Podman and gateway setup"
# The workflow layer (reusable-dispatch.yml) passes the gateway
# endpoint from repository variables as
# FULLSEND_OPENSHELL_GATEWAY_ENDPOINT. That channel wins when it is
# non-empty. An unset repository variable renders as an empty string
# and must not shadow a value configured in the runner's own process
# environment, so the fallback reads OPENSHELL_GATEWAY_ENDPOINT only
# when the workflow channel is empty (#9044).
endpoint="${FULLSEND_OPENSHELL_GATEWAY_ENDPOINT:-}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[HIGH] A repository variable outranks the runner operator's endpoint, so on a shared pool one repository can send the gateway's bearer token to any host

At b9f1730, lines 454-459: a non-empty FULLSEND_OPENSHELL_GATEWAY_ENDPOINT (vars.OPENSHELL_GATEWAY_ENDPOINT) always wins. The runner's OPENSHELL_GATEWAY_ENDPOINT is read only when that variable is empty, and the operator has no way to lock it. The only check is ^https://[^[:space:]]+$, so any https host passes.

In OpenShell v0.1.4, when OPENSHELL_GATEWAY is set, no endpoint matching happens and the named gateway's stored auth is sent to whatever endpoint is given. From crates/openshell-cli/src/tls.rs at v0.1.4:

  • OIDC mode adds an authorization: Bearer <token> header (line 40).
  • Bearer-over-HTTPS without registered mTLS material falls back to ClientTlsConfig::new().with_enabled_roots() (line 434), which trusts the system/public CAs.
  • Cloudflare edge mode sends the edge token (line 374).

Impact: anyone who can write Actions variables in one repository on a shared runner pool can point the variable at a host with a public certificate. That host then receives the shared gateway's OIDC or edge bearer token, and the token works for every other repository's sandboxes on that gateway. Only pinned-CA mTLS blocks this.

Prior context: the earlier precedence thread on these lines was about the #9044 requirement wording and was resolved as intended design. The shared-pool docs thread suggested an operator opt-out, which was deferred as a follow-up. Neither covered reusable bearer tokens leaving the gateway, the docs still do not say this, and I found no follow-up issue for the opt-out.

Suggestion: give the runner operator a lock.

  1. When the runner sets OPENSHELL_GATEWAY, or a flag such as FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED=1, the runner value wins, and a repository variable with a different value fails the job.
  2. Or: when OPENSHELL_GATEWAY is set, accept the repository variable only if it equals that gateway's registered endpoint (from openshell gateway info, after removing a trailing slash).

Either way, the shared-pool docs should say plainly that on bearer-auth gateways (OIDC or Cloudflare edge) the repository variable can send a reusable bearer token to any host. At minimum, file the deferred opt-out as a tracked issue before merge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d4ea049: the action now has an operator lock, fail-closed. When the runner's process environment sets FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED=1 together with the runner's own OPENSHELL_GATEWAY_ENDPOINT, the runner value wins and a repository variable naming a different endpoint fails the job. The lock also fails a repository variable on a locked runner with no endpoint of its own (the fleet-image case you describe, where the gateway is registered under OPENSHELL_GATEWAY without exporting the endpoint), and a lock value other than 1, 0 or empty fails rather than silently meaning unlocked. Seven lock cases are in the test harness. The guide states the bearer-token risk plainly, documents the lock and its runner-endpoint prerequisite, and notes the lock defends against variable-only writers — workflow writers remain a runner-group access-control concern. The tracking issue is #9569. I went with your first-listed shape (the dedicated flag rather than keying on OPENSHELL_GATEWAY, to avoid overloading an existing variable's meaning); happy to add the match-registered-endpoint check as a follow-up if you'd prefer the stricter semantics.

endpoint_source="repository variable"
if [[ -z "$endpoint" ]]; then
endpoint="${OPENSHELL_GATEWAY_ENDPOINT:-}"
endpoint_source="runner environment"
fi
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
Resolved
# Operator lock (#9044): on a shared runner pool, anyone who can
# write Actions variables in one repository could otherwise point
# the endpoint at a host of their choosing, and the gateway's
# bearer token (OIDC or edge) would be sent there. A runner
# operator sets FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED=1 to
# pin the endpoint to the runner's own value: the runner value
# then wins, and a repository variable that names a different
Comment thread
jctanner marked this conversation as resolved.
Resolved
# endpoint fails the job instead of redirecting the credentials.
# The lock is fail-closed: a non-empty repository variable also
# fails when the runner has no endpoint of its own to pin to (a
# fleet image may register the gateway under OPENSHELL_GATEWAY
# without exporting OPENSHELL_GATEWAY_ENDPOINT), and a value other
# than 1, 0 or empty fails rather than silently meaning unlocked.
lock="${FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED:-}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] fail-open

The endpoint lock is opt-in: when FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED is absent or empty, a non-empty repository/organization variable takes precedence over the runner endpoint and is published to GITHUB_ENV. On a shared bearer-auth runner pool this lets a variable-only writer redirect the gateway credentials unless the operator sets the lock. Documented as deliberate and opt-in; setting variables needs admin rights; credential-forwarding impact not verifiable in this tree. See also the breaking-config finding at this location.

Suggested fix: Consider defaulting to locked whenever the runner sets its own OPENSHELL_GATEWAY_ENDPOINT, with an explicit runner-side opt-out (LOCKED=0), or at minimum call out the default-open posture for shared pools in the release notes. Test the absent, empty, malformed, 0 and 1 lock cases against both endpoint channels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The opt-in posture is deliberate: the lock was the reviewer's first-listed shape in the finding that motivated it, and defaulting to locked would silently change behavior for existing fleet images that intentionally let repository variables route their runs — the same overloading concern that led to the dedicated flag rather than keying on OPENSHELL_GATEWAY. The default-open posture for shared bearer-auth pools is called out in the guide's shared-pool paragraph and in the BREAKING CHANGE trailer. I'd treat default-locked (with a LOCKED=0 opt-out) as a separate proposal if the opt-in proves insufficient in practice — happy to prepare it as a follow-up to #9569 if you'd prefer it now. The absent, empty, malformed (true), 0 and 1 lock cases are tested against both endpoint channels in the 20-case table.

Comment thread
jctanner marked this conversation as resolved.
Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] fail-open

Endpoint pinning is opt-in. When FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED is absent or empty, a non-empty repository or organization variable replaces the runner's own gateway endpoint (lines 454-459). On a shared runner pool where a fleet image sets OPENSHELL_GATEWAY and the gateway uses bearer auth (OIDC or Cloudflare edge, without pinned-CA mTLS), anyone who can write Actions variables in one repository can send that gateway's credentials to any HTTPS host they choose; the https/whitespace check at line 499 does not prove the host is the operator's gateway. Malformed lock values are rejected and lock=1 rejects a differing repository endpoint. advanced-setup.md documents the precedence and the opt-in lock as deliberate, and notes workflow writers can bypass the lock anyway. Severity is anchored to the prior assessment: this code is unchanged since the prior review.

Suggested fix: Consider pinning by default for runner-provisioned gateways, or require explicit operator opt-in before honoring an endpoint chosen by a repository.

if [[ -n "$lock" && "$lock" != "1" && "$lock" != "0" ]]; then
echo "::error::FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED must be 1, 0 or empty (got ${#lock} characters)"
exit 1
fi
if [[ "$lock" == "1" ]]; then
if [[ -z "${OPENSHELL_GATEWAY_ENDPOINT:-}" ]]; then
if [[ -n "$endpoint" ]]; then
echo "::error::This runner's gateway endpoint is locked (FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED=1) but the runner sets no OPENSHELL_GATEWAY_ENDPOINT to pin to, and a repository variable is set."
exit 1
fi
else
if [[ -n "$endpoint" && "$endpoint" != "${OPENSHELL_GATEWAY_ENDPOINT}" ]]; then
echo "::error::This runner's gateway endpoint is locked (FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED=1) and the repository variable names a different endpoint."
exit 1
fi
endpoint="${OPENSHELL_GATEWAY_ENDPOINT}"
endpoint_source="runner environment (locked)"
fi
fi
if [[ -n "$endpoint" ]]; then
# The value is written to GITHUB_ENV below, where a newline would
# become a separate assignment for later steps, so it must be a
# single https:// URL with no whitespace. This also rejects
# whitespace-only configuration, which would otherwise suppress
# the fallback and select an unusable remote mode.
if [[ ! "$endpoint" =~ ^https://[^[:space:]]+$ ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[HIGH] https-only validation rejects runner-environment endpoints that v0.55.0 accepted, and no commit is marked breaking

The Detect sandbox host step now fails the job unless the endpoint matches ^https://[^[:space:]]+$. The check also applies to the runner-environment fallback. In v0.55.0 (which contains #9049), this step accepted any non-empty OPENSHELL_GATEWAY_ENDPOINT. A runner set to http://gw:17670, to a value with no scheme, or to HTTPS://... worked before and fails here on upgrade.

OpenShell v0.1.4 (the pinned SHA 5a7728c3) supports plaintext gateways: tls.rs:364 (if server.starts_with("http://")) connects without TLS.

COMMITS.md lists "Validation is added that rejects previously accepted input" as breaking, a missing ! is an important-severity review finding there, and every commit subject goes into the release notes. The validation came in fix(#9044): validate the gateway endpoint and cover the prioritize caller, which has no ! and no BREAKING CHANGE: trailer. The earlier test-coverage thread mentioned the hard failure but not the marker or plaintext support.

Suggestion (pick one):

  • (a) Accept ^https?://[^[:space:]]+$ and print a ::warning:: for http://. Rejecting whitespace and newlines already blocks the GITHUB_ENV injection.
  • (b) Apply https-only only to the new repository-variable channel, and leave the runner-environment fallback as it was in v0.55.0.
  • (c) Keep https-only on purpose: reword the validating commit as fix(#9044)!: (or feat(#9044)!:) with a BREAKING CHANGE: trailer giving the migration (use an https:// URL with no whitespace), and say in advanced-setup.md that plaintext gateways are rejected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Taken option (c): the validating commit is reworded to fix(#9044)!: with a BREAKING CHANGE trailer naming the migration (use an https:// URL with no whitespace; plaintext-only gateways are no longer supported through this path), the PR title carries the ! too, and the guide says plaintext is rejected. https-only is kept deliberately — the runner-environment fallback feeds GITHUB_ENV, and the no-whitespace rule alone felt thin for values that reach every later step. Happy to switch to accepting http:// with a warning if you'd rather not break plaintext deployments; the no-whitespace rule is what blocks the injection either way.

Comment thread
jctanner marked this conversation as resolved.
Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] breaking-config

The Detect sandbox host step now rejects any OPENSHELL_GATEWAY_ENDPOINT that is not a single https URL without whitespace (anchored bash regex) and exits 1. On main any non-empty value selected remote mode, so a self-hosted runner already setting a plaintext http endpoint, a bare host:port, or a value with trailing whitespace will fail at this step after upgrade. The ! marker and the migration note in advanced-setup.md cover the break.

Suggested fix: Call out the stricter validation in the release notes; optionally trim trailing whitespace before validating.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] breaking-config

The runner-environment contract for OPENSHELL_GATEWAY_ENDPOINT is stricter. Previously any non-empty value selected remote mode; now it must be a single https URL with no whitespace, so plaintext, scheme-less, uppercase-scheme or whitespace-containing values fail the job. The PR is marked ! and advanced-setup.md documents the migration. Fleet images maintained outside this repository will break on upgrade.

Suggested fix: No code change required. Keep the ! marker and migration note; mention the stricter validation in the release notes.

echo "::error::OPENSHELL_GATEWAY_ENDPOINT must be a single https:// URL with no whitespace (got ${#endpoint} characters from ${endpoint_source})"
exit 1
fi
echo "Using the OpenShell gateway (from ${endpoint_source}); skipping local Podman and gateway setup"
echo "local=false" >> "${GITHUB_OUTPUT}"
# The sandbox setup reads OPENSHELL_GATEWAY_ENDPOINT from the
# environment; publish the resolved value for the later steps.
if [[ -n "${GITHUB_ENV:-}" ]]; then
echo "OPENSHELL_GATEWAY_ENDPOINT=${endpoint}" >> "${GITHUB_ENV}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] breaking-config

The Detect sandbox host step now exports the resolved OPENSHELL_GATEWAY_ENDPOINT through GITHUB_ENV, a new side effect for later steps in the caller's job (including a repository-variable value that overrides the runner's own).

Suggested fix: Document the GITHUB_ENV export as part of the action's contract.

fi
if command -v openshell >/dev/null 2>&1; then
echo "Using the preinstalled OpenShell CLI"
echo "install-openshell=false" >> "${GITHUB_OUTPUT}"
Expand Down
80 changes: 73 additions & 7 deletions docs/guides/infrastructure/advanced-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,79 @@ configuration, and installs the OpenShell CLI. That suits GitHub-hosted
runners, which start empty.

A self-hosted runner can instead use an OpenShell gateway that runs
elsewhere. Set `OPENSHELL_GATEWAY_ENDPOINT` in the runner's environment to
that gateway's `https://` endpoint. When it is set, the action skips the
Podman installation, the rootless Podman configuration, and the local gateway
configuration, and sandboxes are created on the remote gateway. If the
`openshell` CLI is already on the runner's `PATH`, the action also skips the
OpenShell CLI installer, which needs `sudo` and starts a local gateway
service. Install the CLI version pinned in
elsewhere. Configure the endpoint in one of these ways:

1. Set the `OPENSHELL_GATEWAY_ENDPOINT` repository (or organization)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[MEDIUM] The docs do not say that the runner must already have this gateway registered, or that the value must match the registered endpoint

The guide reads as if setting the variable is all you need to use a remote gateway. OpenShell at the pinned SHA 5a7728c3 (v0.1.4) handles OPENSHELL_GATEWAY_ENDPOINT without a gateway name in resolve_gateway() (crates/openshell-cli/src/main.rs):

  1. It calls find_gateway_by_endpoint(), which compares the normalised value against the stored gateway metadata.
  2. If nothing matches, it falls back to unwrap_or_else(|| endpoint.clone()), so the raw URL becomes the gateway name.
  3. The stored mTLS or auth material is kept under the real gateway name, so it is not found.

fullsend never sets OPENSHELL_GATEWAY or --gateway. Say a repository admin sets a value that is not registered on the runner, or one that differs from the registered endpoint (for example https://gw:443 against https://gw). The value passes the new https:// check in action.yml. The run then fails later at the TLS or auth handshake, with an error that does not point to the cause. This PR makes the gap more likely: the person who sets the repository variable is often not the runner operator who registered the gateway.

Suggestion: in this section, say that the runner must already have this gateway registered (openshell gateway add, with its mTLS or auth material), and that the variable must match the endpoint exactly as it was registered. As an option, the Detect step could warn when openshell gateway list from the preinstalled CLI shows no gateway with the resolved endpoint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 4198d24: the section now says the gateway must already be registered on the runner (openshell gateway add, which stores the mTLS or authentication material), that the action never registers a gateway itself, and that the variable must repeat the registered endpoint exactly — a value that does not match a registered endpoint fails later at the TLS or authentication handshake with an error that does not point at the cause, so the runner operator who registered the gateway should confirm the exact value. Leaving the thread for you to verify and close.

variable to the gateway's `https://` endpoint, on the repository where
the workflow run is triggered (the one whose Actions tab shows the
run); the dispatch workflow passes it to the agent action. In a
reusable workflow, `vars` is read from that calling repository, not
from the repository holding the issue or pull request. For the
standard per-repo install the calling repository is the work-item
repository itself; for a custom poller or other external repository
calling the reusable workflow, it is that calling repository. An
organization variable visible to the calling repository also works.
When the run starts from a different repository than the work item, a
variable set only on the work-item repository is not read.
2. As a fallback, for fleet-managed runner images, set
`OPENSHELL_GATEWAY_ENDPOINT` in the runner's own process environment;
it applies whenever the variable from step 1 is unset, and always
when the runner's endpoint is locked (below). The same rule
holds on this channel: the value must be a single `https://` URL with
no whitespace. Earlier releases accepted any non-empty value here, so
plaintext, scheme-less or uppercase-scheme runner values must be
migrated to lowercase `https://` URLs.

When an endpoint is configured, the action skips the Podman installation,
Comment thread
jctanner marked this conversation as resolved.
Resolved
the rootless Podman configuration, and the local gateway configuration,
and sandboxes are created on the remote gateway.

**Registration.** The gateway must already be registered on the runner:
`openshell gateway add` stores the gateway's mTLS or authentication
material, and the action never registers a gateway itself. Set the
variable to the endpoint exactly as it was registered, as an `https://`
URL — plaintext `http://` gateways are rejected. The runner operator who
registered the gateway can confirm the exact registered value.

**Endpoint matching.** When `OPENSHELL_GATEWAY` is not set on the
runner, OpenShell matches the configured endpoint against the registered
gateways. A value that does not match (for example `https://gw:443`
where `https://gw` is registered) is used as a gateway name instead, and
the sandbox fails with `failed to read TLS CA` under a
`gateways/https___gw_443/mtls` path — an error that does not point at
the mismatch. When a fleet image sets `OPENSHELL_GATEWAY`, no endpoint
matching happens: the named gateway's registered material is used with
whatever endpoint the variable holds.

**Precedence and validation.** A non-empty repository or organization
variable deliberately takes precedence over a value configured in the
runner's process environment: repository administrators choose the
gateway for their runs. The exception is a locked runner (below).
Whatever the source, the value must be a single `https://` URL with no
whitespace.

**Shared runner pools.** When a fleet image sets `OPENSHELL_GATEWAY` on
a runner pool shared across repositories, each repository's variable
decides which endpoint receives that gateway's registered credentials
for its runs. On a bearer-auth gateway (OIDC or Cloudflare edge, without
pinned-CA mTLS), that means anyone who can write Actions variables in
one repository can send the gateway's reusable bearer token to any host

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[MEDIUM] The shared-runner docs understate what a redirected endpoint receives. Provider credentials go to it too, not only the bearer token.

This paragraph says a repository variable can send "the gateway's reusable bearer token to any host with a public certificate". That part is correct for OpenShell v0.1.4. With OPENSHELL_GATEWAY set, resolve_gateway keeps the named gateway, and apply_auth_with_status attaches its stored OIDC or edge token.

But fullsend then runs openshell provider create ... --credential KEY against the same resolved endpoint (internal/sandbox/sandbox.go, around lines 1142-1225). The CLI reads each credential value from the environment and stores it on the gateway. So a host picked through a repository variable also receives the inference API keys and any forge token registered as a provider credential. The exposure is larger than the paragraph says, and the lock is opt-in.

This is about how the doc describes the exposure, not about the opt-in default, which earlier threads already settled.

Suggestion: say that the redirected host receives the gateway bearer token and also every provider credential fullsend registers for the run (inference API keys, forge tokens). Operators of bearer-auth shared pools can then judge whether they need the lock with the full exposure in view.

with a public certificate. Runner operators who need to prevent this can
set `FULLSEND_OPENSHELL_GATEWAY_ENDPOINT_LOCKED=1` in the runner's
process environment, together with the runner's own
`OPENSHELL_GATEWAY_ENDPOINT`: the runner value then wins, a repository
variable naming a different endpoint fails the job, and a repository
variable set on a runner with no endpoint of its own fails too — the
lock is fail-closed, and it requires the runner endpoint to pin to. The
lock defends against variable-only writers; anyone who can write
workflows that run on the pool can still set step `env:` overrides, so
limiting which repositories can use the runner group remains the control
against workflow writers.

**CLI preinstall (remote gateway only).** On a remote-gateway runner,
if the `openshell` CLI is already on the runner's `PATH`, the action
also skips the OpenShell CLI installer, which needs `sudo` and starts a
local gateway service. Install the CLI version pinned in
`.github/scripts/openshell-version.sh` in the runner image.

The action also needs the Python `jsonschema` package to validate agent
Expand Down
Loading
Loading