Skip to main content

SKY-D351 · CI/CD pipelines

AI agent action's write-access check switched off

Critical

CRITICAL when the agent can run any shell command, HIGH when its tools can change things, MEDIUM when they only read. allowed_bots: "*" on its own is capped at HIGH, and so is a job with a fixed environment: name. A job with no secrets and no write token is reported only for a shell agent, at MEDIUM.

claude-code-action and codex-action refuse to run when the account that started the workflow has no write access to the repository. A "*" in allowed_non_write_users, allowed_bots or allow-users switches that check off, so anyone who can open an issue or comment can start the agent.

Languages
GitHub Actions workflows
Quality gate
counted toward the gate limits; a CRITICAL finding fails the gate on its own (full and diff scans). skylos cicd risk-review also marks a new HIGH or CRITICAL finding of this rule as "CI weakened", which needs a human approval.
Finding type
review
Catalog name
GitHub Actions AI agent write-access check widened
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

The wildcard is often added so a triage bot can answer new issues. The issue author then controls text the agent reads, and a crafted issue can make the agent use its tools, its API key and the job's write token for the attacker.

What Skylos flags

.github/workflows/triage.yml · YAMLReported on line 16
name: Issue triageon:  issues:    types: [opened]permissions:  contents: read  issues: writejobs:  triage:    runs-on: ubuntu-latest    steps:      - uses: anthropics/claude-code-action@v1        with:          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}          github_token: ${{ secrets.GITHUB_TOKEN }}          allowed_non_write_users: "*"          prompt: "Add area and priority labels to #${{ github.event.issue.number }}."          claude_args: >-            --allowedTools "Bash(gh issue view:*),Bash(gh issue edit:*)"

What Skylos leaves alone

.github/workflows/triage.yml · YAML
name: Issue triageon:  issues:    types: [opened]permissions:  contents: read  issues: writejobs:  triage:    runs-on: ubuntu-latest    steps:      - uses: anthropics/claude-code-action@v1        with:          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}          allowed_non_write_users: "*"          prompt: "Add area and priority labels to #${{ github.event.issue.number }}."          claude_args: >-            --allowedTools "Bash(gh issue view:*),Bash(gh issue edit:*)"

Why Skylos leaves it alone

claude-code-action honours allowed_non_write_users only when a github_token is passed to it. Without one, as here, the action still refuses accounts without write access, so the wildcard has no effect.

How Skylos decides

  1. Reads workflow files under .github/workflows and finds steps that use anthropics/claude-code-action or openai/codex-action, the agent actions with a built-in write-access check.
  2. Looks for an exact "*": allowed_non_write_users (claude-code-action v1 and later, and only together with github_token), allowed_bots (any GitHub App), or codex-action's allow-users. A list of named accounts is not reported.
  3. For each trigger an outsider can cause (as for SKY-D350) that the action would normally check, evaluates the job's if:, its needs: jobs and earlier steps. If none of them checks the account either, the wildcard is what lets the outsider in.
  4. Needs the same two things as SKY-D350: a way for the outsider's text to reach the agent (the prompt, an earlier step, a tool such as gh issue view with a prompt about the issue, or a checkout of the pull request), and something to steal (a secret, a write permission, id-token: write, or no permissions: at all). An agent with no tools is not reported.
  5. Reports once per agent step, on the line of the first widened setting. The inline marker must be a YAML comment.

How to fix it

Name the accounts that may start the agent instead of using "*", or remove the setting. The action then refuses everyone else. Any wildcard combined with an API key secret and tools stays reported, graded by what the tools can do.

.github/workflows/triage.yml · YAML · the fix, against the flagged file
name: Issue triageon:  issues:    types: [opened]permissions:  contents: read  issues: writejobs:  triage:    runs-on: ubuntu-latest    steps:      - uses: anthropics/claude-code-action@v1        with:          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}          github_token: ${{ secrets.GITHUB_TOKEN }}Removed:           allowed_non_write_users: "*"Added:           allowed_non_write_users: "docs-bot,release-helper"          prompt: "Add area and priority labels to #${{ github.event.issue.number }}."          claude_args: >-            --allowedTools "Bash(gh issue view:*),Bash(gh issue edit:*)"

When it can be wrong

  • A job protected by an environment with required reviewers is still reported (at most HIGH): Skylos cannot see the reviewers.
  • allowed_bots: "*" is reported even when only your own GitHub Apps comment in practice: any installed App can trigger the job.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Put a YAML comment with exactly one rule on the reported line or on its own line directly above it.

    YAML
    # skylos: ignore[SKY-D351] label-only job, no secrets but the API keyallowed_non_write_users: "*"
  • [tool.skylos] ignore = ["SKY-D351"] turns the rule off for the whole project. A baseline also works, but it records the absolute file path and the line.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.