-
Notifications
You must be signed in to change notification settings - Fork 327
docs: add guide for consuming audit reports with agents #24454
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
Changes from all commits
8229b2e
5f09a9e
6a99e4b
0833128
a79c21e
1ccc24f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,126 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||
| title: Consuming Audit Reports with Agents | ||||||||||||||||||||||||||||||||||||||||||||||||
| description: How to feed structured audit output into agentic workflows for automated triage, trend analysis, and remediation. | ||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| When running locally, all three audit commands accept `--json` to write structured output to stdout. Pipe through `jq` to extract the fields a model needs. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| | Command | Use case | | ||||||||||||||||||||||||||||||||||||||||||||||||
| |---------|----------| | ||||||||||||||||||||||||||||||||||||||||||||||||
| | `gh aw audit <run-id> --json` | Single run — `key_findings`, `recommendations`, `metrics` | | ||||||||||||||||||||||||||||||||||||||||||||||||
| | `gh aw logs [workflow] --last 10 --json` | Trend analysis — `per_run_breakdown`, `domain_inventory` | | ||||||||||||||||||||||||||||||||||||||||||||||||
| | `gh aw audit diff <id1> <id2> --json` | Before/after — `run_metrics_diff`, `firewall_diff` | | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Inside GitHub Actions workflows, agents access these commands through the `agentic-workflows` MCP tool rather than calling the CLI directly. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| ## Posting findings as a PR comment | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| ```aw wrap | ||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||
| description: Post audit findings as a PR comment after each agent run | ||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_run: | ||||||||||||||||||||||||||||||||||||||||||||||||
| workflows: ['my-workflow'] | ||||||||||||||||||||||||||||||||||||||||||||||||
| types: [completed] | ||||||||||||||||||||||||||||||||||||||||||||||||
| engine: copilot | ||||||||||||||||||||||||||||||||||||||||||||||||
| tools: | ||||||||||||||||||||||||||||||||||||||||||||||||
| github: | ||||||||||||||||||||||||||||||||||||||||||||||||
| toolsets: [pull_requests] | ||||||||||||||||||||||||||||||||||||||||||||||||
| agentic-workflows: | ||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||
| actions: read | ||||||||||||||||||||||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Summarize Audit Findings | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Use the `agentic-workflows` MCP tool `audit` with run ID ${{ github.event.workflow_run.id }}, identify the pull request that triggered it, and post a comment summarizing key findings and blocked domains. Highlight issues with severity `high` or `critical`. If there are no findings, post a brief "no issues found" comment. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+27
to
+38
|
||||||||||||||||||||||||||||||||||||||||||||||||
| github: | |
| toolsets: [pull_requests] | |
| agentic-workflows: | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write | |
| --- | |
| # Summarize Audit Findings | |
| Use the `agentic-workflows` MCP tool `audit` with run ID ${{ github.event.workflow_run.id }}, identify the pull request that triggered it, and post a comment summarizing key findings and blocked domains. Highlight issues with severity `high` or `critical`. If there are no findings, post a brief "no issues found" comment. | |
| agentic-workflows: | |
| safe-outputs: | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: read | |
| --- | |
| # Summarize Audit Findings | |
| Use the `agentic-workflows` MCP tool `audit` with run ID ${{ github.event.workflow_run.id }}, identify the pull request that triggered it, and then use the `safe-outputs` tool `add-comment` to request a pull request comment summarizing key findings and blocked domains. Highlight issues with severity `high` or `critical`. If there are no findings, request a brief "no issues found" comment instead. |
Copilot
AI
Apr 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section instructs calling the noop safe output tool, but the workflow frontmatter doesn’t define any safe-outputs:. If the intent is to use safe outputs (recommended for creating issues/labels), add the appropriate safe-outputs configuration (e.g., create-issue, optionally add-labels) and then reference noop as the fallback when no action is needed.
Copilot
AI
Apr 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The agentic-workflows MCP logs tool parameters in the prompt don’t match the documented schema (workflow_name and count, not workflow and last). Updating the parameter names will help readers copy/paste this into a working workflow.
| 1. Use the `agentic-workflows` MCP tool `logs` with parameters `workflow: my-workflow, last: 10` and read `/tmp/gh-aw/cache-memory/audit-trends.json` as the previous baseline. | |
| 1. Use the `agentic-workflows` MCP tool `logs` with parameters `workflow_name: my-workflow, count: 10` and read `/tmp/gh-aw/cache-memory/audit-trends.json` as the previous baseline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
gh aw logsrow suggests that--jsonalone returns cross-run report fields likeper_run_breakdown/domain_inventory, but those fields are part of the cross-run report output which is generated when--formatis set (and--jsonis used alongside it). Consider updating the example to include--format markdown(orpretty) when describing those fields, or adjust the listed fields to match the non---formatJSON output.