Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions .github/workflows/copilot_credential_health.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Copilot - Credential Health
run-name: Credential health · ${{ github.actor }} · ${{ github.ref_name }}

on:
workflow_dispatch:
Expand Down Expand Up @@ -49,9 +50,11 @@ permissions:

jobs:
verify-pat:
if: ${{ inputs.check_pat }}
if: ${{ inputs.check_pat && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify PAT
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate PAT without exposing its value
Expand All @@ -67,9 +70,11 @@ jobs:
printf 'Authorization: Bearer %s\n' "$PAT" | curl -q --fail --silent --show-error --location --max-redirs 0 --proto '=https' --proto-redir '=https' --max-time 20 --header @- --header 'Accept: application/vnd.github+json' "https://api.github.com/repos/${GITHUB_REPOSITORY}" >/dev/null

verify-openai:
if: ${{ inputs.check_openai }}
if: ${{ inputs.check_openai && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify OPENAI_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate OpenAI key without exposing its value
Expand All @@ -84,9 +89,11 @@ jobs:
printf 'Authorization: Bearer %s\n' "$OPENAI_API_KEY" | curl -q --fail --silent --show-error --location --max-redirs 0 --proto '=https' --proto-redir '=https' --max-time 20 --header @- https://api.openai.com/v1/models >/dev/null

verify-anthropic:
if: ${{ inputs.check_anthropic }}
if: ${{ inputs.check_anthropic && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify ANTHROPIC_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate Anthropic key without exposing its value
Expand All @@ -101,9 +108,11 @@ jobs:
printf 'x-api-key: %s\n' "$ANTHROPIC_API_KEY" | curl -q --fail --silent --show-error --location --max-redirs 0 --proto '=https' --proto-redir '=https' --max-time 20 --header @- --header 'anthropic-version: 2023-06-01' https://api.anthropic.com/v1/models >/dev/null

verify-google:
if: ${{ inputs.check_google }}
if: ${{ inputs.check_google && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify GOOGLE_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate Google key without exposing its value
Expand All @@ -118,9 +127,11 @@ jobs:
printf 'x-goog-api-key: %s\n' "$GOOGLE_API_KEY" | curl -q --fail --silent --show-error --location --max-redirs 0 --proto '=https' --proto-redir '=https' --max-time 20 --header @- https://generativelanguage.googleapis.com/v1beta/models >/dev/null

verify-openrouter:
if: ${{ inputs.check_openrouter }}
if: ${{ inputs.check_openrouter && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify OPENROUTER_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate OpenRouter key without exposing its value
Expand All @@ -135,9 +146,11 @@ jobs:
printf 'Authorization: Bearer %s\n' "$OPENROUTER_API_KEY" | curl -q --fail --silent --show-error --location --max-redirs 0 --proto '=https' --proto-redir '=https' --max-time 20 --header @- https://openrouter.ai/api/v1/models >/dev/null

verify-cursor:
if: ${{ inputs.check_cursor }}
if: ${{ inputs.check_cursor && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify CURSOR_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate Cursor key without exposing its value
Expand All @@ -154,9 +167,11 @@ jobs:
unset basic_auth

verify-opencode:
if: ${{ inputs.check_opencode }}
if: ${{ inputs.check_opencode && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify OPENCODE_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate OpenCode key without exposing its value
Expand All @@ -171,9 +186,11 @@ jobs:
printf 'Authorization: Bearer %s\n' "$OPENCODE_API_KEY" | curl -q --fail --silent --show-error --location --max-redirs 0 --proto '=https' --proto-redir '=https' --max-time 20 --header @- https://opencode.ai/zen/v1/models >/dev/null

verify-codex-api-key:
if: ${{ inputs.check_codex_api_key }}
if: ${{ inputs.check_codex_api_key && github.event_name == 'workflow_dispatch' && github.repository == 'vypdev/copilot' && contains(fromJSON('["1783618","260864876"]'), github.actor_id) && contains(fromJSON('["efraespada","vypbot"]'), github.triggering_actor) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.workflow_ref == format('{0}/.github/workflows/copilot_credential_health.yml@{1}', github.repository, github.ref) }}
name: Verify CODEX_API_KEY
runs-on: [self-hosted, codex, Linux]
runs-on:
group: vypdev
labels: [self-hosted, codex, Linux]
timeout-minutes: 10
steps:
- name: Validate Codex API key without exposing its value
Expand Down
16 changes: 16 additions & 0 deletions docs/security-operations/security/self-hosted-runners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,19 @@ platform fixtures remain separate and do not invoke real Codex. CLI or
model success is distinct from a verified tool read, edit, or command. A model
reply and a setup marker cannot certify sandbox tools. No new Windows-service
Codex acceptance run is required or scheduled.

## Credential-health source selection

The reviewed proposal in [#979](https://github.com/vypdev/copilot/issues/979)
explicitly routes source health jobs to group `vypdev` with `self-hosted`, `codex`
and `Linux` labels. Its default-ref/workflow and actor selector runs before a
job receives a runner; unselected checks stay disabled. Preserve the existing
hosted exceptions for event admission/npm OIDC and all consumer runner defaults.

This routing does not establish runner isolation or externally enforced workflow
access. Organization runner-group evidence is unavailable (403). A collaborator
who can change workflow code can remove its local condition; the policy review
must treat that privilege explicitly. The inspected default revision still has
the old hosted health workflow, so neither a develop change nor this proposal
proves adoption. Inspect native actor/ref and selected checks when a run skips;
use an explicit default-branch retry after reviewing the missing condition.
22 changes: 22 additions & 0 deletions docs/security-operations/security/trust-boundaries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,25 @@ Treat workflow events as different trust zones:
| `issue_comment` | User-controlled text | Authorization MUST run before any write-capable agent |

Self-hosted runners MUST be isolated, ephemeral where possible, and cleaned after agent execution. Agent prompts MUST treat repository content and comments as untrusted data. See [Prompt-injection controls](/security-operations/security/prompt-injection) for the complete threat model, output-sanitization rules, and incident response procedure.

## Source credential-health policy review

The source-only proposal in [#979](https://github.com/vypdev/copilot/issues/979)
selects the exact default-ref health workflow and reviewed original/rerun actors,
with an explicit false-by-default check. It requires maintainer acceptance of
the actor/ref policy and trusted-workflow-editor assumption. A mutable condition
and its editable validator provide no independent boundary against workflow
editors. GitHub's repository-write requirement for dispatch is a separate control.

The observed default health workflow is older than develop; source changes do
not establish installation. Health uses no environment approval gate. Effective
branch rules and classic-protection responses are recorded separately, and the
organization runner-group policy is unavailable to this connection (403).
Do not infer an independent organization fence from runner labels, a missing
repository runner list or an artifact/run identity.

The workflow token is contents:read, but that does not narrow the separate PAT or
provider key. Their actual grants remain unverified by this audit; authentication
GETs establish only the tested endpoint's acceptance. No real health dispatch or
credential value is used for the policy's fake-endpoint controls. Stronger claims
need separately verified operator controls. Consumer templates are unchanged.
85 changes: 85 additions & 0 deletions quality/bugbot/evidence/issue-979/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Credential-health trust review — #979

**Policy proposal; maintainer approval remains pending.** This prepares a source-only
operating policy and its evidence. It does not establish independent protection
against workflow-editing collaborators or install anything on trusted default.

## Observed baseline

`observed-baseline.json` records the authenticated API snapshot. Source develop
is `ccefb27627cd627ccdb7d5666fd174c2ac1da07b`; default is master at
`ace49e4a7ce0f6a007fef5d11479eb9b7a5846e3`. Their health workflow hashes differ:
source a3706073a38708205bc1ec68c96a0b8caf5e5bff98f09fc747c11b926996aa08
uses self-hosted/codex/Linux; default
5f093b2c03bef389ccea68ef43bec3577cb1bfddc038da1884a146088f39a4ec
still uses ubuntu-latest. Exact pre-change workflows are preserved here.
No current default installation of the proposed policy is claimed.

The two repository collaborators are administrators: efraespada (1783618) and
vypbot (260864876). The repository enables all actions, does not require SHA
pinning, and defaults GITHUB_TOKEN to write with approval permission. The health
workflow explicitly narrows its own token to contents:read. Each explicit
false-by-default check exposes only its requested Secret to one job. That
`permissions` declaration does not reduce the PAT/provider key's own grants.
Actual stored-credential grants, organization secret access and runner isolation
were not established; no Secret value was read or health dispatch performed.

There is only an npm environment; health jobs name no environment. The effective
master rule response requires strict `CI Check`; classic branch protection is
404. These separate observations do not imply no ruleset protection, nor an
independent review requirement. Organization runner-group policy reads return
403 (admin:org / runner-group permission unavailable). The repository runner list
is empty, which says nothing conclusive about shared organization capacity.

## Concrete proposed policy

Only the source repository's default branch, the exact credential-health
workflow identity and an explicit selected check may run. Original actor IDs
1783618/260864876 and triggering actors efraespada/vypbot are allowed, including
reruns; other selections skip before runner assignment. Each job explicitly
selects group vypdev with self-hosted/codex/Linux. Consumer templates retain their
current runner and selector defaults. There is no new public input or environment
setting. Changes to the literal actor set require a new review.

The native title identifies actor/ref; existing Verify PAT/provider job names
remain unchanged. If all jobs skip, inspect the chosen actor/ref and check flags,
then explicitly retry from trusted default. A queued job is not a successful
check. A missing key fails before HTTP; provider failure fails the job without
retry or exposing its value.

| Threat / condition | Established boundary and limitation |
| --- | --- |
| Actor without write permission | GitHub requires write permission to dispatch this repository. No unauthorized event path is demonstrated. This review sends no real denied dispatch. |
| Accidental branch/workflow selection | The proposed unchanged workflow rejects the wrong ref/path/repository before assigning a runner. |
| Fork actor | The source selector rejects a foreign repository/actor; a fork's own workflow does not grant this repository's write privilege. Organization runner access remains unavailable evidence. |
| Workflow-editing collaborator | Can replace this mutable condition. The counter-control does exactly that. Treat such actors as credential holders unless a separately verified external boundary constrains them. |
| Missing credential / provider failure | Existing actual shell controls use fake curl; zero real endpoints/secrets. Authentication success does not establish full grants or write capability. |

Approval must explicitly choose this default-only actor policy and its trusted
workflow-editor assumption, or require a different externally enforced design.
The selector and repository validator are editable together and are not an
independent trust anchor. Stronger claims require organization/operator evidence
outside candidate-controlled workflow code. This task changes no organization
runner policy, protection, Secret, environment or token grant. Production remains
disabled. This review is not model qualification.

## Executed controls

Four focused Jest suites pass **503 tests**: 11 new selection/mutability cases,
82 existing fake-curl transport cases, 58 trusted-read evidence cases and 352
workflow-validator cases. The nine selection rows cover both allowed actors,
unlisted original/rerun actors, default/other ref, altered workflow identity,
fork repository, disabled flag and wrong event. The remaining new cases bind all
jobs/runners and demonstrate the mutable-condition bypass. These do not simulate
an independent organization policy or prove live authorization.

The intermediate group-format failure is retained: an old validator fixture
expected an array, while the source now explicitly names group vypdev. Updating
that positive shape retains the forbidden-hosted-runner assertion. Initial
502-test success, the 502/503 attempt and the final pass remain in compressed
logs. There was no credential or model call and no evaluated-PR write attempt.

Primary contracts checked on 2026-11-19:
[manual dispatch](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow),
[runner-group restrictions](https://docs.github.com/en/rest/actions/self-hosted-runner-groups?apiVersion=2026-03-10),
and [self-hosted trust](https://docs.github.com/en/actions/reference/security/secure-use).
Loading