Repository navigation
feat: add protected command output capture #10169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lpcox
merged 11 commits into
main
from
copilot/feat-native-protected-command-output-capture
Oct 18, 2026
+1,676
−51
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aa271bd
Initial plan
Copilot f96a698
feat: add protected command output capture
Copilot 6b12df9
fix: finalize interrupted output captures
Copilot 1c397e1
fix: suppress gVisor retries after cancellation
Copilot aff73ad
fix: harden protected command output capture
Copilot 7777f97
Potential fix for pull request finding
lpcox bbbd073
test: expect visible capture diagnostics
Copilot adbfa63
fix: pin protected capture directory operations to descriptors
Copilot d552795
fix: isolate entrypoint diagnostics from captured output
Copilot 155c91f
Merge remote-tracking branch 'origin/main' into copilot/feat-native-p…
Copilot dcac7be
fix: repair protected output CI fixtures and compiler acceptance
lpcox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Protected command output capture | ||
|
|
||
| Use `--capture-command-output <directory>` to ask AWF to retain the command's | ||
| raw stdout and stderr for a trusted caller: | ||
|
|
||
| ```sh | ||
| awf --capture-command-output "$RUNNER_TEMP/awf-capture-$GITHUB_RUN_ID" \ | ||
| --allow-domains github.com -- your-command | ||
| ``` | ||
|
|
||
| The directory must be an absolute path whose parent exists; the directory itself | ||
| must not already exist. AWF resolves symlinks and checks the candidate against agent-visible mounts, | ||
| including custom read-only mounts and Docker host-path-prefix translations. | ||
| It fails before starting the command if the directory could be exposed. A | ||
| caller must not assume that `$RUNNER_TEMP` or any other chosen path is private. | ||
|
|
||
| AWF creates `metadata.json` and one `.stdout.bin` and `.stderr.bin` file per | ||
| runtime attempt with private permissions. Capture is bounded to 64 MiB total by | ||
| default; `--capture-command-output-max-bytes <bytes>` can lower that limit. | ||
| Output continues to drain and appear on the usual console streams after the | ||
| limit is reached. Metadata reports observed and retained byte counts, truncation, | ||
| log-drain status, per-attempt exit/outcome, command outcome, console-presentation | ||
| failures, and teardown outcome. An interrupted capture records incomplete draining. | ||
| A capture is `complete` only when the command exit was observed, all | ||
| logs drained, no capture failure or truncation occurred, and teardown completed. | ||
| A nonzero command exit can still have a complete capture. | ||
|
|
||
| Stdout and stderr are saved separately. Byte order is preserved within each | ||
| stream and attempt; AWF does not claim a total order between the two streams. | ||
| Capture currently supports non-TTY Compose-managed runtimes (including Docker | ||
| and gVisor). TTY, external microVM runtimes, and configurations that expose a | ||
| Docker socket to the agent are rejected explicitly. | ||
|
|
||
| AWF leaves the raw files in the requested host directory and does not copy or | ||
| publish them. The caller owns parsing, provenance checks, redaction, and | ||
| publication. Captured bytes prove only what AWF observed; they do not make | ||
| guest-emitted claims authoritative. Treat the files as sensitive and apply the | ||
| caller’s retention policy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.