gh-aw icon indicating copy to clipboard operation
gh-aw copied to clipboard

arc-dind: agent log path split, detection sandbox scope, and safe-output file ownership

Open jonas-harmoney opened this issue 1 month ago • 16 comments

We migrated four production agentic workflows to self-hosted ARC runners with runner.topology: arc-dind and hit four issues that all required local overrides to work around. Filing them together because three share a root cause — code that assumes the runner and the agent see the same filesystem — but happy to split them into separate issues if you prefer.

Environment

gh-aw v0.89.21 (compiler), github/gh-aw-actions/setup pinned at v0.85.4
awf v0.27.44, firewall type squid
runners actions-runner-controller on GKE, dind sidecar docker:28.2-dind
engine copilot CLI 1.0.79

1. The agent log directory is written to $RUNNER_TEMP and read from /tmp

With topology: arc-dind, codegen launches copilot with:

--log-dir ${RUNNER_TEMP}/gh-aw/sandbox/agent/logs/

but the Parse agent logs for step summary step in the same job sets:

GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/

parse_copilot_log.cjs therefore prints No log files found in directory and exits 0. Because both the Agentic Conversation and the Safe Outputs summary panels are rendered by that one step, both disappear from the run summary. Nothing fails, so the run is green and the panels are simply gone — we only found it by diffing a self-hosted summary against a GitHub-hosted one side by side.

The artifacts are complete; only the rendering is lost. (Ours were actually larger than the hosted equivalents — 662 KB vs 578 KB for the agent artifact.)

This looks like the same bug as the firewall log directory fixed in #66223 and released in v0.91.4, but in a second consumer. We could not find a corresponding fix for the agent half.

Evidence: run 37612927710.

Our workaround: symlink /tmp/gh-aw/sandbox/{firewall,agent}/logs to the $RUNNER_TEMP equivalents in a pre-step, and remove the symlinks in a post-step — artifact consolidation copies /tmp/gh-aw into $RUNNER_TEMP/gh-aw and cannot replace a directory with a link.


2. The threat detection job gets no --add-dir, and fails open

Grepping a compiled lock, the only --add-dir is in the agent job. The detection job's agent can therefore read /tmp/gh-aw and the workspace only. The threat-detection directory is mounted, but it is outside the agent's permitted scope, so every read is refused:

Permission denied and could not request permission from user

ten times in a row. The job then renders a verdict and reports green, for inputs it never managed to read. For a security control that is the wrong failure direction — a detection step that cannot see its inputs should fail, not pass.

Our workaround: a prompt override pointing the detection agent at /tmp/gh-aw/ instead. This is the one finding with no upstream issue that we could locate.


3. The MCP gateway does not pass --user to its stdio containers, so secret redaction is skipped

The gateway container itself is started with --user ${MCP_GATEWAY_UID}:${MCP_GATEWAY_GID}, but the nested safeoutputs server config has no user field. That container therefore runs as root and creates outputs.jsonl root-owned. The runner user cannot rewrite it, so secret redaction fails:

Secret redaction could not rewrite .../safeoutputs/outputs.jsonl

gh-aw treats this as a warning and continues, which means safe outputs are published unredacted. That is the most serious of the four: the failure is silent and the consequence is leaked secrets in a comment or a PR body.

Evidence: run 37600156028.

Our workaround: pre-create outputs.jsonl runner-owned with mode 666 before the gateway starts, so the container can append and redaction can still rewrite it, plus a post-step that fails the run closed if the redaction warning appears anyway.


4. The v0.91.4 compiler rule blocks the fix for (3)

v0.91.4 added a rule rejecting any step that touches the safe outputs file:

accesses the safe outputs output file directly; use safe-outputs instead

That rejects both halves of our workaround for (3) at compile time — the step that makes the file writable, and the guard that verifies redaction actually ran. So the hardening forbids the only step that makes your own redaction work on this topology, for a bug that is still live.

This blocks our v0.91.4 upgrade, which we otherwise want because it fixes the firewall half of (1). An exemption for a step that only changes ownership or mode, or fixing (3) so the workaround is unnecessary, would both unblock it.


What we are asking for

Each of these is currently patched from a shared imports directory in our repo, one file per bug, specifically so we can delete them again. If (1), (2) and (3) are fixed upstream we can run gh-aw unmodified, which is where we would much rather be. Happy to test prereleases against this setup — we have a reproducible arc-dind environment and can turn a run around in about 20 minutes.

jonas-harmoney avatar Oct 08 '26 15:10 jonas-harmoney

Two more from the same setup, both found after filing. (5) is the same class as the others; (6) is unrelated but turned out to be what triggers (5) in practice.


5. Conclude threat detection ignores RUN_DETECTION=false and fails the run after a cancellation

Every step in the detection job is gated on the guard:

if: always() && steps.detection_guard.outputs.run_detection == 'true'

except the last one:

- name: Conclude threat detection
  id: detection_conclusion
  if: always()
  env:
    RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
    THREAT_DETECT_INSTALL_OUTCOME: ${{ steps.threat_detect_install.outcome }}

The practical trigger is a cancelled run, which on a busy repo is routine — a new push to the PR cancels the in-flight review through concurrency.cancel-in-progress. When the activation job is cancelled, the agent job never starts, so OUTPUT_TYPES and HAS_PATCH are both empty and the guard correctly logs:

Detection skipped: no agent outputs or patches to analyze

Every step including Install threat-detect binary is then skipped. Conclude threat detection runs anyway, is handed RUN_DETECTION=false and THREAT_DETECT_INSTALL_OUTCOME=skipped in its own env, and still errors:

ERR_SYSTEM: threat-detect binary not found on PATH
##[error]Process completed with exit code 1.

So a run where detection was deliberately skipped fails on a binary that was deliberately not installed. conclude_threat_detection.sh is handed everything it needs to no-op; it just does not act on it.

With threat-detection.continue-on-error: false — which we set deliberately, because warn mode lets a detection without a verdict through unguarded — this turns the whole run red.

It is a race, so it does not fire on every cancellation: if the cancel propagates before the detection job starts, everything is marked cancelled cleanly. Over our last 40 runs, 11 were cancelled and 1 came out as failure this way. On runs where the agent does produce output, the whole detection job including Conclude threat detection completes green, so this is specific to the skipped path.

There is also no local workaround available, because steps injected through safe-outputs.threat-detection.steps are themselves gated on run_detection == 'true', so nothing we can add runs in the case that needs fixing.

Evidence: run 37895063496, job 113706200366. Provable from the compiled lock alone: compare the if: on the conclude step against every other step in the job.


6. The daily AIC guardrail re-resolves every cancelled run whenever its cache misses

On a cache hit, Check daily workflow token guardrail costs about a second. On a miss it took 2m51s for us, and the log shows why — the fallback resolves each run of the day individually, and cancelled runs never come back resolved:

[daily-workflow-aic] Resolving run AIC: {"runId":...,"conclusion":"cancelled","cacheHit":false}
[daily-workflow-aic] Computed component AIC: {"runId":...,"component":"agent","aic":0,"reason":"runner_not_assigned"}

Two API calls and roughly two seconds per cancelled run. aic: 0, reason: runner_not_assigned is a terminal fact — a run whose agent job never got a runner cannot later acquire usage — but it does not appear to be written back as a resolved entry, so every later cache miss redoes all of them. The cost of a miss is therefore proportional to the number of runs cancelled that day, and on a repo with cancel-in-progress enabled that number only goes up as the day progresses.

To be precise about the scope: this is not a steady-state cost, and we have since seen the same step complete in one second when the cache was warm. The problem is the miss path, not every run.

It still closes a loop with (5): a slow activation job is a wider window for the next push to cancel the run, and every cancellation adds another entry that the next cache miss will re-resolve. Caching a cancelled run's zero as terminal would break that loop. Worth noting that on self-hosted runners this time is charged to our own compute rather than to GitHub-hosted minutes.

jonas-harmoney avatar Oct 09 '26 07:10 jonas-harmoney

🔗 AWF tracking issue: github/gh-aw-firewall#9779

Generated by Firewall Issue Dispatcher · copilot · auto · 18.2 AIC · ⊞ 9.3K · ◷

lpcox avatar Oct 10 '26 01:10 lpcox

Follow-up on (5), with the root cause pinned down and one correction to what I wrote above.

The script states the intended behaviour, and it is not what happens

actions/setup/sh/conclude_threat_detection.sh carries this comment, immediately above the install-outcome guard:

The guard is scoped to runs where detection was expected: when the guard step skipped detection the install step is skipped too, and threat-detect conclude reports conclusion=skipped.

That is exactly right, and the install-outcome guard directly beneath it is correctly scoped:

if [ "${RUN_DETECTION:-}" = "true" ] && [ -n "${THREAT_DETECT_INSTALL_OUTCOME}" ] && [ "${THREAT_DETECT_INSTALL_OUTCOME}" != "success" ]; then
  report_detector_unavailable "threat-detect installation did not complete verification ..."
fi

The next guard is not:

if ! command -v threat-detect >/dev/null 2>&1; then
  report_detector_unavailable "threat-detect binary not found on PATH"
fi

So control never reaches threat-detect conclude, and the conclusion=skipped the comment promises is never emitted. The skipped path falls into the unavailable-detector path instead. One guard was scoped to RUN_DETECTION, the one below it was not.

Warn mode is not a workaround either

Worth separating from the exit code: on this path report_detector_unavailable writes reason=agent_failure. With continue-on-error: true the job stays green, but the run is still recorded as an agent failure when in fact detection was deliberately skipped and nothing failed. So the mislabelling is independent of strict vs warn mode — warn mode only hides it.

Correction: it is not only a race

Above I described this as a race on concurrency.cancel-in-progress, reproducing on roughly 1 in 11 cancellations. That was too narrow. It reproduces deterministically when a repository-owned job cancels the run through the Actions API rather than through concurrency.

We have a job that detects a merge-from-base-only push and cancels the run, to avoid re-reviewing a PR for a merge commit that changes no code. The cancel lands after the detection job has been scheduled, and because the detection job carries if: always() it runs through to completion during the cancellation. Every such push fails the same way:

RUN_DETECTION: false
DETECTION_AGENTIC_EXECUTION_OUTCOME: skipped
THREAT_DETECT_INSTALL_OUTCOME: skipped
GH_AW_DETECTION_CONTINUE_ON_ERROR: false

ERR_SYSTEM: threat-detect binary not found on PATH
##[error]Process completed with exit code 1.

Job step list for that run, abbreviated:

# Step Conclusion
11 Check if detection needed success (run_detection=false)
14-17 Prepare / Link / Setup / Ensure skipped
25 Install threat-detect binary skipped
26 Execute threat detection with AWF skipped
32 Conclude threat detection failure

This matters for the severity: any repo that cancels its own runs for a reason other than concurrency hits this on every single occurrence, not occasionally. The same PR passes cleanly when the push contains real changes — run 36714402966 on the identical branch, with a code commit, is green end to end.

New evidence: run 38230997554, job 114751268807. Previously cited: run 37895063496, job 113706200366.

Suggested fix

Scope the PATH check the way the comment already describes, so the skipped path reports what it is:

if ! command -v threat-detect >/dev/null 2>&1; then
  if [ "${RUN_DETECTION:-}" != "true" ]; then
    echo "success=true" >> "${GITHUB_OUTPUT}"
    echo "reason=detection_skipped" >> "${GITHUB_OUTPUT}"
    echo "conclusion=skipped" >> "${GITHUB_OUTPUT}"
    exit 0
  fi
  report_detector_unavailable "threat-detect binary not found on PATH"
fi

Adding && steps.detection_guard.outputs.run_detection == 'true' to the conclude step's if: would also stop the failure, but it leaves the step's outputs unset, which downstream consumers may not expect. Handling it in the script keeps the conclusion contract intact.

Happy to open a PR for this if it would help.

jonas-harmoney avatar Oct 12 '26 10:10 jonas-harmoney

Noting the state of the AWF side, so the scope stays clear for anyone arriving from the tracking issue.

github/gh-aw-firewall#9779 is closed as completed, by github/gh-aw-firewall#9792. That PR states its own scope as:

Scope: No production behavior changes. The reported runtime failures require gh-aw compiler and MCP Gateway changes.

So what landed there is regression coverage and documentation of the arc-dind filesystem boundaries, not a behaviour change. That split looks right to us — the fixes do belong here and in the MCP gateway rather than in AWF — but it does mean none of the six is resolved yet, and all of our overrides are still carried.

Where we understand each one to sit:

# Where the fix belongs State
1 gh-aw — agent log dir producer/consumer path open, local symlink workaround
2 gh-aw — detection --add-dir, fail closed on unreadable inputs open, local prompt override
3 MCP gateway — --user on nested stdio containers open, local pre-create + fail-closed guard
4 gh-aw — compiler rule rejecting the (3) workaround open, blocks our v0.91.4 upgrade
5 gh-aw — conclude_threat_detection.sh open, no local workaround possible
6 gh-aw — daily AIC resolution cache open, cost only

We are not blocked day to day; the overrides hold and the workflows run green. The one worth flagging beyond our own setup is (3), because it fails silently in the direction of publishing unredacted output — another arc-dind adopter would not notice they had it.

The offer from my previous comment stands for (5): it is about six lines in a shell script, and the intended behaviour is already written in the comment directly above the code that does not implement it. Say the word and I will open a PR.

jonas-harmoney avatar Oct 12 '26 10:10 jonas-harmoney

One more, from the same setup. It is the same step as (6) — Check daily workflow token guardrail on the activation job — but a different defect. In (6) a cache miss was only expensive; here it is fatal.


7. A single transient 5xx during the AIC scan fails the whole run, with no retry and a ~1 hour cooldown

The scan opened normally, on an empty cache:

[daily-workflow-aic] Resolved daily AIC guardrail limits: {"dailyAICThreshold":100000,"perRunMaxAICredits":1500,"perRunFallbackAvailable":true}
[daily-workflow-aic] Started authoritative AIC scan: {"repository":"...","currentRunId":38391902483,"workflowId":255775895,"fallbackAIC":1500}
[daily-workflow-aic] Loaded scan observations: {"workflowId":255775895,"cachedEntries":0}
[daily-workflow-aic] Listed workflow run candidates: {"page":1,"lookupMode":"workflow_id","sourceRunCount":100,"returnedRunCount":100}
[daily-workflow-aic] Listed workflow run candidates: {"page":2,"lookupMode":"workflow_id","sourceRunCount":100,"returnedRunCount":100}

200 candidates, resolved one at a time. After 63 of them, one jobs call came back 502:

GET /repos/.../actions/runs/38290669506/jobs?filter=all&per_page=100&page=1 - 502 with id C401:2042B1:315A9C:490B84:6ACE195C in 10522ms
[daily-workflow-aic] Run AIC resolution failed: {"runId":38290669506,"runAttempt":1,"status":502,"error":"Server Error","fallbackAvailable":false}
[daily-workflow-aic] Persisted scan observations: {"cachePath":"/tmp/gh-aw/agentic-workflow-usage-scan-v2.jsonl","entries":63}
[daily-workflow-aic] AIC inspection failed: {"status":"transient_error","error":"Server Error"}
Daily AIC inspection must not retry before 2026-10-13T12:37:06.000Z
##[error]Daily workflow AI Credits are unknown: Server Error

The run ends there. Steps 7 to 18 of the activation job are skipped, activation is failure, and agent, detection and safe_outputs are all skipped with it. Nothing was reviewed.

Three things compound:

The error is classified as transient and then treated as fatal. "status":"transient_error" is gh-aw's own classification, and there is no retry of the failed call — one 502 ends the scan. The scan makes one to three API calls per candidate run, so the number of opportunities to hit a transient 5xx grows with the number of runs that day. That is the same shape as (6): the cost and now the risk both scale with how busy the repo has been since midnight.

The fallback the scan announced was not applied. The scan opened with "perRunFallbackAvailable":true and "fallbackAIC":1500, but the one run it could not resolve reported "fallbackAvailable":false. Charging that run its 1500 AIC ceiling and carrying on is what we would expect a per-run fallback to exist for. Instead the entire inspection was abandoned over a single unresolved entry out of 200. If fallbackAvailable is deliberately false for this class of error, the reasoning is not visible in the log.

The cooldown multiplies it. must not retry before 2026-10-13T12:37:06.000Z is 54 minutes after the failure, so Re-run failed jobs is not a remedy inside that window. We have not verified whether that gate is held per run or restored from the shared aic-usage-scan-v2 artifact by the next run's Restore daily AIC scan observations step. If it is the latter, one 502 blocks every run of the workflow for the rest of the window, not only the run that saw it. Worth confirming either way, because the two cases have very different blast radii.

What we would expect

Retry the jobs call on 5xx before giving up on a run. If it still fails, charge that run fallbackAIC and continue, and reserve the hard failure for the case where the fallback-inflated total actually crosses dailyAICThreshold. Failing closed is the right call when the total might be over the limit. It is a heavy price when one run out of 200 is merely unknown and the guardrail already carries a number for exactly that case.

Evidence: run 38391902483, job 115277587127, step Check daily workflow token guardrail (1m53s, failed). The GitHub request id for the 502 is in the quoted log above if it is useful for tracing on your side. Environment unchanged from the issue body.

jonas-harmoney avatar Oct 13 '26 12:10 jonas-harmoney

@lpcox

pelikhan avatar Oct 14 '26 19:10 pelikhan

@jonas-harmoney could you split this into (sub-)issues?

pelikhan avatar Oct 14 '26 22:10 pelikhan

Current-state refresher (2026-10-16): Partially addressed; this is no longer seven wholly-unfixed findings.

Since the last detailed follow-up:

  • (5) Skipped detection: merged #67810 explicitly returns conclusion=skipped when detection is disabled and installation was skipped (script).
  • (6–7) AIC scans: #67884, #68056 and #68079 added bounded transient-read recovery, conservative fallback accounting and confirmed-unstarted-job handling. Current scan code permits fallback after ordinary transient failures; the reader records confirmed-zero results. A plain 502 no longer automatically means an hour-long cooldown.
  • (3) Redaction: current code attempts atomic replacement of non-writable files and fails/removes the source on unrecoverable redaction, rather than merely warning and retaining it.

These do not establish nested-container UID propagation or an end-to-end ARC fix. The parser path, detection scope and ownership/workaround restrictions still need topology-specific verification. AWF #9792 was coverage/docs only. Splitting the remaining concerns as requested would clarify closure. Static review; no ARC environment was run.

pelikhan avatar Oct 16 '26 18:10 pelikhan

@jonas-harmoney, could you share a redacted detection-job excerpt from the compiled lockfile used by a run showing the permission errors in item 2? The uses: github/gh-aw-actions/setup@… line and the detector install, execution, and conclusion steps from that lockfile would help.

In your later item 5 follow-up you mentioned enabling threat-detection.continue-on-error: false (and shared the step env for a skipped run). For the item 2 run where detection executed and reported green after the permission errors, could you share whether strict mode was also active there, along with the conclusion step's environment and final conclusion/reason outputs from that item 2 run? No prompts, payloads, or secrets needed.

This would help verify the exact setup reference and conclusion path that ran in the lockfile alongside the detector’s file-access scope. So far, this is AI-assisted source inspection, not an ARC reproduction.

Rul1an avatar Oct 18 '26 21:10 Rul1an

Answering @Rul1an on item 2 first, then @pelikhan on the split and the refresher.

@Rul1an — the detection job as compiled today

Two corrections to the environment table in the issue body before the excerpt, both relevant to your question about the exact setup reference:

At filing Today
compiler v0.89.21 v0.89.21
github/gh-aw-actions/setup v0.85.4 v0.89.21
awf v0.27.44 v0.28.23

The setup pin and the compiler are the same version now. The excerpt below is from the current ai-code-review.lock.yml.

Setup step of the detection job:

  detection:
    needs: [activation, agent]
    if: always() && needs.agent.result != 'skipped'
    runs-on: arc-ai-runner-set
    timeout-minutes: 10
    steps:
      - name: Setup Scripts
        id: setup
        uses: github/gh-aw-actions/setup@924af5fdc64061cfbf66fb584c8b07e2ac230c60 # v0.89.21

Install:

      - name: Install threat-detect binary
        id: threat_detect_install
        if: always() && steps.detection_guard.outputs.run_detection == 'true'
        run: |
          bash "${RUNNER_TEMP}/gh-aw/actions/install_threat_detect_binary.sh" v0.5.2 \
            --artifact-base-url https://github.com/github/gh-aw-threat-detection/releases/download \
            --sha256-amd64 b4ecda6a… --sha256-arm64 f6260a0f… --rootless

Execute (env trimmed to what bears on your question, the long awf-config.json heredoc elided as …):

      - name: Execute threat detection with AWF
        id: detection_agentic_execution
        if: always() && steps.detection_guard.outputs.run_detection == 'true' && steps.threat_detect_install.outcome == 'success' && steps.detection_staging_reset.outcome == 'success'
        continue-on-error: true
        timeout-minutes: 10
        env:
          GH_AW_PHASE: detection
          GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
          GH_AW_VERSION: v0.89.21
          GH_AW_DETECTION_CONTINUE_ON_ERROR: "false"
          CUSTOM_PROMPT: "The artifacts under $RUNNER_TEMP/gh-aw/threat-detection are not readable in this sandbox.\nRead the identical copies under /tmp/gh-aw/ instead …"
          THREAT_DETECT_BINARY: ${{ steps.threat_detect_install.outputs.binary-path }}
        run: |
          …
          awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" \
            --container-workdir "${GITHUB_WORKSPACE}" \
            --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" \
            --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" \
            --mount "${RUNNER_TEMP}/gh-aw/home:${RUNNER_TEMP}/gh-aw/home:rw" \
            --mount "${RUNNER_TEMP}/gh-aw/sandbox/agent:${RUNNER_TEMP}/gh-aw/sandbox/agent:rw" \
            --mount "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:rw" \
            --mount "${RUNNER_TEMP}/gh-aw/threat-detection:${RUNNER_TEMP}/gh-aw/threat-detection:rw" \
            --mount /tmp/gh-aw:/tmp/gh-aw:rw --env-all … --skip-pull \
            -- /bin/bash -c '… threat-detect --engine copilot \
                 --output "${RUNNER_TEMP}/gh-aw/threat-detection/detection_result.json" \
                 "${RUNNER_TEMP}/gh-aw/threat-detection"' \
            2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log

Conclude:

      - name: Conclude threat detection
        id: detection_conclusion
        if: always()
        env:
          RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
          DETECTION_AGENTIC_EXECUTION_OUTCOME: ${{ steps.detection_agentic_execution.outcome }}
          THREAT_DETECT_INSTALL_OUTCOME: ${{ steps.threat_detect_install.outcome }}
          GH_AW_DETECTION_CONTINUE_ON_ERROR: "false"
        run: |
          bash "${RUNNER_TEMP}/gh-aw/actions/conclude_threat_detection.sh" /tmp/gh-aw/threat-detection/detection_result.json

On strict mode

Yes, strict was active on the item 2 runs too, and it is not a per-run setting on our side: continue-on-error: false sits in the safe-outputs.threat-detection frontmatter of a shared import, committed 2026-10-08 and unchanged since. The compiler emits it as GH_AW_DETECTION_CONTINUE_ON_ERROR: "false" into both the execute step and the conclude step, as above. So the same value applied to the item 2 runs and to the item 5 skipped-path runs.

The scope mechanism, provable from the lock alone

--add-dir occurs exactly once in the entire compiled file, in the agent job:

--add-dir "${GITHUB_WORKSPACE}"

There is no --add-dir anywhere in the detection job. Meanwhile the detector is invoked against ${RUNNER_TEMP}/gh-aw/threat-detection — mounted rw, as the invocation shows, but never added to the agent's permitted scope. That is the whole of item 2, and it is still true on v0.89.21 with the setup action at the same version. The CUSTOM_PROMPT line is our workaround and the only thing standing between that wiring and the permission errors.

What I cannot give you, and what I can do instead

I cannot produce the conclusion step's conclusion/reason outputs from the original item 2 run. Our Actions history is purged far more aggressively than I assumed: every run cited in this issue now returns 404, including 38391902483, which I cited six days ago in item 7 and could still read at the time. So the logs are gone, not redacted away.

What I can do, and would rather do than reconstruct from memory: drop the CUSTOM_PROMPT override on a throwaway PR, let it run on our ARC setup, and post the detection job log with the permission errors plus the conclusion step's full env and its conclusion/reason/success outputs. That gives you a current v0.89.21 capture rather than a two-week-old one. Say the word and I will run it — turnaround is about 20 minutes.

@pelikhan — on splitting, and on the 2026-10-16 refresher

Yes to splitting. Proposed split, keeping the numbering so the cross-references in this thread survive:

New issue Covers Component
A (1) agent log dir producer/consumer path split gh-aw compiler
B (2) detection job scope, and failing open on unreadable inputs gh-aw compiler
C (3) + (4) nested stdio container UID, and the compiler rule that rejects the workaround MCP gateway + compiler
D (5) conclude_threat_detection.sh skipped path gh-aw actions
E (6) + (7) daily AIC scan cost and transient-failure handling gh-aw actions

(3) and (4) belong together because (4) only exists as a blocker for the (3) workaround — fix (3) and (4) resolves itself. Same for (6) and (7): one step, one cache, two symptoms. Happy to open these and leave this issue as the umbrella, or to reorganise if you would rather have one per number.

On the refresher: thank you, that is a useful state of play, and I should be clear that we have verified none of it yet. We are still pinned at compiler and setup v0.89.21, so #67810, #67884, #68056, #68079 and the redaction change are all ahead of us — our workarounds are still carried not because the fixes failed but because we have not picked them up.

The ordering that matters for us is (4). It is what gates the upgrade past v0.91.4, and it only gates it because of the (3) workaround. If the new atomic-replacement path in redact_secrets.cjs means our pre-create step can simply be deleted, then (4) stops applying, we can go to v0.92.0, and (3), (5), (6) and (7) all become verifiable on real ARC hardware in one pass. That is the single most useful thing we can contribute here, since you note the inspection so far has been static with no ARC reproduction.

I will do that upgrade and report per finding. If any of them turn out to be already fixed in our environment, I will say so plainly on the relevant sub-issue so they can be closed.

jonas-harmoney avatar Oct 19 '26 09:10 jonas-harmoney

@jonas-harmoney, yes please — the throwaway-PR capture on v0.89.21 would help. Thanks for clarifying the setup pin and strict-mode setting.

Could you include the workflow commit, the executed detection-job lockfile excerpt with its full setup SHA, and the compiler, AWF and threat-detect versions/pins used? Please redact prompt values and confirm that CUSTOM_PROMPT was removed with the other detection settings unchanged.

For the result, the detection log, any permission errors, the conclusion step’s relevant non-secret environment and its conclusion/reason/success outputs are the key pieces. Please mark outputs that were not set. If readily available, include the conclusion step’s exit status and run/job IDs. A redacted attachment would preserve the evidence if Actions history expires again; no prompts, payloads or secrets needed.

Please keep this capture separate from the v0.92.0 upgrade results. It would document a new run, not recover the missing historical outputs.

Prepared with AI assistance; our work so far is source inspection, not an ARC reproduction.

Rul1an avatar Oct 19 '26 14:10 Rul1an

@Rul1an @jonas-harmoney setting aside time this week to help with this. sorry i haven't addressed sooner!

lpcox avatar Oct 19 '26 17:10 lpcox

Rechecked 2026-10-22: keep this umbrella open; source fixes and ARC acceptance are not the same thing. Reviewed the full discussion, including the corrected v0.89.21 pins, expired historical runs, the separate old-version capture/upgrade plan, and the recent maintainer follow-up. Current remote main: ffdd9c9efe6acef74b5529d63d7dc6103d6a0889.

Finding Current assessment / remaining acceptance
1. Log paths Still actionable: the summary parser consumes the unadjusted engine path, while ARC execution rewrites paths. github/gh-aw-firewall#10280 closed unmerged, with no compiler change. Align producer/parser/artifact paths, then verify both summary panels and artifact consolidation without symlinks.
2. Detection scope / green verdict Unresolved runtime claim. Mounting inputs does not grant the detector subprocess file scope. Merged github/gh-aw-firewall#10281 adds boundary coverage/documentation and explicitly leaves subprocess scope and fail-closed verification upstream. Preserve the promised no-CUSTOM_PROMPT capture with exact compiler/setup/AWF/threat-detect pins, permission failures, and conclusion outputs; do not treat missing historical outputs as proof of current behavior.
3. Ownership / redaction Partially mitigated: current redaction atomically replaces non-writable files and removes the source / fails on unrecoverable redaction, not the original warn-and-retain behavior. This does not prove nested UID propagation or successful replacement on ARC. Verify child UID/GID, parent-directory writability, sanitized publication and failure behavior.
4. Upgrade blocker Still conditional on (3): establish that the ownership workaround can be deleted and the workflow compiles/runs without it. Do not weaken the safe-output access restriction merely to retain the workaround.
5. Skipped detection Fixed in source by merged #67810: the explicit false/skipped branch returns conclusion=skipped, success=true, empty reason before requiring a binary. Still needs the planned upgraded ARC/cancellation confirmation.
6. Repeated cancelled-run resolution Source addressed: confirmed-unstarted jobs produce recorded zero, and the scan reuses/persists recorded observations. Verify cold/restored/repeated scans on the upgraded setup rather than assuming every cancelled run is zero.
7. Transient 5xx Source addressed by merged #67884/#68056/#68079: bounded read recovery and conservative fallback for ordinary transient errors. Quota/Retry-After restrictions remain intentionally distinct. Verify controlled 5xx recovery, threshold accounting and a subsequent scan; the old blanket cooldown description is not the current ordinary-502 contract.

The highest-value next step remains (3)/(4) upgrade-unblock verification, then a per-finding upgrade report, kept separate from the v0.89.21 detection capture. The closed firewall subtrackers/merged documentation do not establish an end-to-end gh-aw fix. This assessment is static source/history review, not an ARC reproduction; no workflows were dispatched.

pelikhan avatar Oct 22 '26 21:10 pelikhan

Split done, and the upgrade @pelikhan called the highest-value next step is done too. Report per finding below.

The split

Numbering kept so the cross-references in this thread survive.

Covers New issue
A (1) agent log dir producer/parser path split #72896
B (2) detection scope, green verdict over unread inputs #72897
C (3) + (4) nested stdio container UID, and the compiler rule #72898
D (5) conclude_threat_detection.sh skipped path #72899
E (6) + (7) daily AIC scan cost and transient handling #72900

D and E are already fixed in source. I filed them anyway, marked as such, so the runtime confirmation has somewhere to land and they can be closed on an observation rather than on an assumption. Happy to close either immediately if you would rather not carry them.

Suggest keeping this issue as the umbrella.

We are on v0.92.0

Compiler and github/gh-aw-actions/setup both at v0.92.0 (458b269), awf at v0.28.57, threat-detect v0.5.2. So #66160, #66223, #67810, #67884, #68056 and #68079 are all in our environment now.

What unblocked it was exactly what I guessed in my last comment: the fail-closed redaction path from #66160 means our post-step net had no job left to do, and deleting it removed the thing the new safe-output access rule was objecting to. (4) is resolved, and it did not need the rule weakened.

Two of the three workaround files shrank as a result:

Workaround Then Now
awf log path symlinks firewall + agent, with an unlink post-step agent only, firewall half deleted (#66223)
safeoutputs redaction pre-create + fail-closed post-step pre-create only, post-step deleted (#66160)
detection prompt: override carried carried, unchanged

Per finding on v0.92.0

# State
1 Half closed. Firewall parser fixed, link removed and verified. Agent parser unchanged, symlink still carried → #72896
2 Open, and sharper than when filed. The agent job now carries --add-dir ${RUNNER_TEMP}/gh-aw/, --allow-all-paths and --add-dir "${GITHUB_WORKSPACE}". The detection job's threat-detect invocation carries none of the three, with the staged input dir mounted rw. Override still carried → #72897
3 Symptom fixed, cause open. Unredacted publication is gone. Pre-create still required, so nested container UID is unchanged → #72898
4 Resolved. Not reopening
5 Fixed in source, confirmation pending → #72899
6, 7 Fixed in source, confirmation pending → #72900

That is static review of our own compiled lock plus the upgrade actually being in place. It is not yet runtime observation on ARC, and I am not claiming it is.

The item 2 capture

@Rul1an — I owe you this one and the version has moved under it. You asked for the capture on v0.89.21 and we are now on v0.92.0, so I cannot produce that build any more without pinning backwards, which I would rather not do to a repo that reviews real PRs.

What I will post instead, on #72897, is the same capture on v0.92.0: CUSTOM_PROMPT removed with every other detection setting unchanged, full setup SHA, compiler/AWF/threat-detect pins, the workflow commit, the detection log with the permission errors, and the conclusion step's non-secret environment plus its conclusion/reason/success outputs, with unset outputs marked as unset. Attached as a file so it survives our retention this time. No prompts, payloads or secrets.

Given that (2) reproduces on the current version, a current capture is the more useful evidence anyway — and it keeps your request intact, which was never really about v0.89.21, it was about seeing the detector report green over inputs it could not read.

One note on cadence

v1.0.1 is out and we are eight releases behind again after a week. We will verify the five findings on v0.92.0 first rather than chase the tip, so the results map to the versions discussed in this thread. If you would rather have the numbers on v1.0.1, say so and I will do that pass instead.

jonas-harmoney avatar Oct 29 '26 08:10 jonas-harmoney

Item 2 (threat detection cannot read its inputs on arc-dind) still reproduces on gh-aw v1.2.0 with the external detector, and it now fails in a model-dependent way. Adding evidence and the code that causes it.

Versions: gh-aw v1.2.0 compiler, threat-detect v0.5.3, Copilot CLI 1.0.103 via copilot_harness.cjs, runner.topology: arc-dind, AWF firewall. Main engine pi, so detection runs threat-detect --engine copilot. Claude-engine workflows on the same runners are not affected.

Cause

  • On arc-dind, stage_threat_detection_arc_dind.sh copies the inputs to ${RUNNER_TEMP}/gh-aw/threat-detection (here /home/runner/work/_temp/gh-aw/threat-detection), and buildThreatDetectCommand (pkg/workflow/threat_detection_external.go) passes that path to threat-detect as the input directory. The prompt tells the model to read from it.
  • threat-detect builds the Copilot argv itself (pkg/engine/engine.go, copilotDirectArgs): --add-dir <dir of its temporary prompt file> (so /tmp) and --add-dir $GITHUB_WORKSPACE, plus --allow-all-tools. The input directory is never added. Off ARC the inputs are under /tmp/gh-aw/threat-detection, which /tmp covers; on ARC they are under neither /tmp nor the workspace.
  • Logged argv: copilot_harness.cjs /usr/local/bin/copilot --add-dir . --log-level all --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir <workspace> --prompt-file <prompt-file>. AWF even warns: --mount provides filesystem visibility, not engine file scope. Grant the sandbox-visible input directory to the engine subprocess (e.g. Copilot --add-dir).

Symptom: every read of the staged files is refused:

└ Permission denied because no interactive user response was available. Retry in an interactive
  session so the user can approve it, or try an alternative that does not require this permission.
  Approval check
    └ ✗ Denied, no one to approve

Outcome depends on the model

  • A stronger model keeps trying, never sees the patch or agent_output.json, and still records a verdict (several denials, THREAT_DETECTION_STATUS: reason=result_recorded exit=0): a "clean" verdict for input it did not read.
  • A weaker model gives up after 8 denials and says so: THREAT_DETECTION_STATUS: reason=invalid_report_exhausted exit=2. With continue-on-error: true (warn mode) gh-aw then converts the branch push into a separate review PR, which stopped our automation chain. 4 of 17 runs of one workflow on one day.

So detection fails open or fails noisy depending on the model, for input it cannot read.

What does not help (checked locally with Copilot CLI 1.0.103, no sandbox): COPILOT_ALLOW_ALL=true (it covers tools, not paths; the same denial), and the trustedFolders setting in settings.json/config.json (same denial). Only --add-dir, --allow-all-paths or having the directory as the CLI's working directory allows the read.

Workaround we are trying: safe-outputs.threat-detection.engine: {id: pi, cwd: ${{ runner.temp }}/gh-aw/threat-detection}. engine.cwd becomes GH_AW_ENGINE_CWD in the detection step and the harness spawns the CLI there, so the staged files are readable. Nothing else in the compiled workflow changes. We will report here whether it holds live.

Suggested fix: threat-detect should pass --add-dir <input directory> to the Copilot CLI (the input path is already its positional argument), and ideally fail closed when the model could not read the inputs instead of recording a verdict.

ekbritecore avatar Nov 09 '26 19:11 ekbritecore

Follow-up: the workaround holds live. With safe-outputs.threat-detection.engine.cwd: ${{ runner.temp }}/gh-aw/threat-detection (so GH_AW_ENGINE_CWD is the staging directory in the detection step), the next pi run on arc-dind read its staged files: no "Permission denied because no interactive user response was available" lines, THREAT_DETECTION_STATUS: reason=result_recorded exit=0, detection finished in about 6 seconds, and the safe outputs and the follow-on dispatch ran. The argv logged by threat-detect is unchanged (--add-dir ., then the workspace); only the CLI's starting directory moved.

The underlying gap is still in threat-detect: it should add the input directory to the Copilot CLI's allowed directories itself, so that arc-dind does not need this.

ekbritecore avatar Nov 09 '26 20:11 ekbritecore