|
| 1 | +name: codex-audit-report |
| 2 | + |
| 3 | +# Publishes the red team's report (docs/specs/security-audit.md -> "Red team"): |
| 4 | +# what a maintainer's `scripts/security-audit-local.sh --engine codex` run |
| 5 | +# computed, typed in as dispatch inputs. Nothing here runs a model or reads a |
| 6 | +# secret, and nothing here gates a release: release.yml waits on |
| 7 | +# security-audit.yaml alone. The inputs are non-secret by construction — |
| 8 | +# computed verdicts and counts, never a finding — and |
| 9 | +# `scripts/security-audit-public-body.mjs` checks each against its pattern, |
| 10 | +# and the counts against the CI canary run they share seeds with, before it |
| 11 | +# posts anything. |
| 12 | +on: |
| 13 | + workflow_dispatch: |
| 14 | + inputs: |
| 15 | + commit: |
| 16 | + description: "The commit on main the Codex run audited (40-hex)" |
| 17 | + type: string |
| 18 | + required: true |
| 19 | + model: |
| 20 | + description: "The Codex model the run used" |
| 21 | + type: string |
| 22 | + required: true |
| 23 | + default: gpt-6-sol |
| 24 | + verdicts: |
| 25 | + description: "Each domain's computed verdict: `domain=PASS|FAIL|INCONCLUSIVE …`; empty for a canary alone" |
| 26 | + type: string |
| 27 | + default: "" |
| 28 | + canary_run: |
| 29 | + description: "The CI canary run whose key seeded the Codex canary; empty for verdicts alone" |
| 30 | + type: string |
| 31 | + default: "" |
| 32 | + canary_seeded: |
| 33 | + description: "Seeds applied" |
| 34 | + type: string |
| 35 | + default: "" |
| 36 | + canary_caught: |
| 37 | + description: "Seeds Codex caught" |
| 38 | + type: string |
| 39 | + default: "" |
| 40 | + canary_either: |
| 41 | + description: "Seeds Claude or Codex caught" |
| 42 | + type: string |
| 43 | + default: "" |
| 44 | + canary_unfinished: |
| 45 | + description: "Codex domains that left no finished report" |
| 46 | + type: string |
| 47 | + default: "" |
| 48 | + |
| 49 | +run-name: codex-audit-report (advisory, not an audit) |
| 50 | + |
| 51 | +# Each job declares its own. |
| 52 | +permissions: {} |
| 53 | + |
| 54 | +jobs: |
| 55 | + publish: |
| 56 | + runs-on: ubuntu-latest |
| 57 | + timeout-minutes: 10 |
| 58 | + # `issues: write` for the one comment on the status issue; `actions: read` |
| 59 | + # to read the CI canary run and download its `canary-recall`. |
| 60 | + permissions: |
| 61 | + contents: read |
| 62 | + issues: write |
| 63 | + actions: read |
| 64 | + steps: |
| 65 | + - name: Refuse any ref but main |
| 66 | + run: | |
| 67 | + [ "$GITHUB_REF" = refs/heads/main ] && exit 0 |
| 68 | + echo "::error::A red-team report publishes from main only." |
| 69 | + exit 1 |
| 70 | +
|
| 71 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 72 | + with: |
| 73 | + fetch-depth: 1 |
| 74 | + persist-credentials: false |
| 75 | + |
| 76 | + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 |
| 77 | + with: |
| 78 | + node-version-file: package.json |
| 79 | + |
| 80 | + # Inputs reach the builder through the environment, never interpolated |
| 81 | + # into the script. It refuses a dispatch by anyone but an admin. |
| 82 | + - name: Publish the red-team report |
| 83 | + env: |
| 84 | + GH_TOKEN: ${{ github.token }} |
| 85 | + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 86 | + COMMIT: ${{ inputs.commit }} |
| 87 | + MODEL: ${{ inputs.model }} |
| 88 | + VERDICTS: ${{ inputs.verdicts }} |
| 89 | + CANARY_RUN: ${{ inputs.canary_run }} |
| 90 | + CANARY_SEEDED: ${{ inputs.canary_seeded }} |
| 91 | + CANARY_CAUGHT: ${{ inputs.canary_caught }} |
| 92 | + CANARY_EITHER: ${{ inputs.canary_either }} |
| 93 | + CANARY_UNFINISHED: ${{ inputs.canary_unfinished }} |
| 94 | + run: | |
| 95 | + mkdir -p "$RUNNER_TEMP/codex-recall" |
| 96 | + node scripts/security-audit-public-body.mjs --engine codex \ |
| 97 | + --date "$(date -u +%Y-%m-%dT%H:%MZ)" --run-url "$RUN_URL" \ |
| 98 | + --commit "$COMMIT" --model "$MODEL" --verdicts "$VERDICTS" \ |
| 99 | + --canary-run "$CANARY_RUN" --canary-seeded "$CANARY_SEEDED" \ |
| 100 | + --canary-caught "$CANARY_CAUGHT" --canary-either "$CANARY_EITHER" \ |
| 101 | + --canary-unfinished "$CANARY_UNFINISHED" \ |
| 102 | + --record "$RUNNER_TEMP/codex-recall/codex-recall.json" |
| 103 | +
|
| 104 | + # The counts website/scripts/generate-canary-recall.js reads beside the |
| 105 | + # CI canary run's own `canary-recall`. |
| 106 | + - name: Upload the red-team recall |
| 107 | + if: inputs.canary_run != '' |
| 108 | + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
| 109 | + with: |
| 110 | + name: codex-recall |
| 111 | + path: ${{ runner.temp }}/codex-recall/codex-recall.json |
| 112 | + retention-days: 90 |
| 113 | + if-no-files-found: error |
0 commit comments