awguard 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +274 -0
- package/action.yml +46 -0
- package/bin/awguard.js +8 -0
- package/docs/launch-plan.md +52 -0
- package/docs/market-analysis.md +162 -0
- package/examples/README.md +16 -0
- package/examples/awguard.config.example.json +14 -0
- package/examples/pull-request-target.yml +16 -0
- package/examples/safe-agent.yml +20 -0
- package/examples/suppressed-agent.yml +15 -0
- package/examples/unsafe-agent.yml +19 -0
- package/package.json +46 -0
- package/src/baseline.js +67 -0
- package/src/cli.js +172 -0
- package/src/config.js +166 -0
- package/src/fingerprints.js +13 -0
- package/src/graph.js +278 -0
- package/src/migration.js +258 -0
- package/src/presets.js +67 -0
- package/src/remediation.js +118 -0
- package/src/reporters.js +231 -0
- package/src/scanner.js +604 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
- Add npm package metadata for the public `awguard` package.
|
|
6
|
+
- Update README install wording now that the package is ready for npm publishing.
|
|
7
|
+
|
|
8
|
+
## 1.1.0
|
|
9
|
+
|
|
10
|
+
- Rename the npm package target to `awguard` to avoid the already-taken `agentic-workflow-guard` npm name.
|
|
11
|
+
- Add `--format migration` for safe-output migration plans.
|
|
12
|
+
- Add migration guidance that converts unsafe agent jobs into read-only proposal jobs plus validated safe outputs or approved apply jobs.
|
|
13
|
+
- Document the migration report in the README and GitHub Action metadata.
|
|
14
|
+
|
|
15
|
+
## 1.0.0
|
|
16
|
+
|
|
17
|
+
- Add `graph` output with Mermaid attack-chain diagrams.
|
|
18
|
+
- Add standalone `html` attack graph reports.
|
|
19
|
+
- Add `--fix-dry-run` remediation guidance.
|
|
20
|
+
- Add built-in presets: `strict`, `claude-code`, `codex`, `aider`, and `triage-bot`.
|
|
21
|
+
- Add README launch polish with badges and an attack graph hook.
|
|
22
|
+
|
|
23
|
+
## 0.4.0
|
|
24
|
+
|
|
25
|
+
- Add `awguard.config.json` and `.awguard.json` auto-discovery.
|
|
26
|
+
- Add `--config` and GitHub Action `config` input.
|
|
27
|
+
- Support rule severity overrides and disabled rules.
|
|
28
|
+
- Support suppression policies with allowed rule ids and minimum reason length.
|
|
29
|
+
|
|
30
|
+
## 0.3.0
|
|
31
|
+
|
|
32
|
+
- Add inline suppression comments with required justifications.
|
|
33
|
+
- Add `AWG011` for invalid suppressions.
|
|
34
|
+
- Support same-line and next-line suppressions for specific rule ids.
|
|
35
|
+
- Document audited suppression usage.
|
|
36
|
+
|
|
37
|
+
## 0.2.0
|
|
38
|
+
|
|
39
|
+
- Add baseline files with `--write-baseline`.
|
|
40
|
+
- Add `--baseline` so CI can fail only on findings that are not already known.
|
|
41
|
+
- Add stable finding fingerprints to text, JSON, and SARIF output.
|
|
42
|
+
- Add GitHub Action inputs for baseline workflows.
|
|
43
|
+
|
|
44
|
+
## 0.1.0
|
|
45
|
+
|
|
46
|
+
- Initial CLI and GitHub Action.
|
|
47
|
+
- Add rules for AI-agent prompt injection, unsafe permissions, secrets, shell interpolation, `pull_request_target`, workflow artifacts, unsafe autonomous-agent flags, and unpinned third-party actions.
|
|
48
|
+
- Add text, JSON, Markdown, GitHub annotation, and SARIF output.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agentic Workflow Guard contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# Agentic Workflow Guard
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Mughal-Baig/agentic-workflow-guard/actions/workflows/test.yml)
|
|
4
|
+
[](https://github.com/Mughal-Baig/agentic-workflow-guard/actions/workflows/code-scanning.yml)
|
|
5
|
+
[](https://github.com/Mughal-Baig/agentic-workflow-guard/releases)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
`agentic-workflow-guard` is a small, zero-dependency scanner for GitHub Actions workflows that use AI coding agents, LLMs, or automated review bots.
|
|
9
|
+
|
|
10
|
+
It looks for a new class of CI/CD risk: untrusted issue, pull request, comment, or branch text flowing into an AI agent prompt, then into write-capable tools, secrets, or shell scripts.
|
|
11
|
+
|
|
12
|
+
Its unique output is an **Agentic Workflow Injection attack graph**:
|
|
13
|
+
|
|
14
|
+
```mermaid
|
|
15
|
+
flowchart LR
|
|
16
|
+
s["GitHub issue/comment/PR text"] --> p["AI agent prompt"]
|
|
17
|
+
p --> c["agent tools or shell"]
|
|
18
|
+
c --> a["secrets / write token"]
|
|
19
|
+
a --> i["repo modification or secret exposure"]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Why This Project Can Reach People
|
|
23
|
+
|
|
24
|
+
Developers want AI speed, but they also want a safety net. Stack Overflow's 2025 Developer Survey found that agent users report productivity gains, while 81% of respondents still worry about security and data privacy for AI agents. GitHub's Octoverse 2025 says AI is now standard in development, with more than 1.1 million public repositories using an LLM SDK and 80% of new developers using Copilot in their first week.
|
|
25
|
+
|
|
26
|
+
The missing piece is a tool that is easy enough for maintainers to add before they fully understand the security problem. This project gives them one command and one GitHub Action.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
For local development:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm test
|
|
34
|
+
node ./bin/awguard.js .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Install from npm:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx awguard .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Use In GitHub Actions
|
|
44
|
+
|
|
45
|
+
After you upload this repository to GitHub, users can add:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
name: Agentic Workflow Guard
|
|
49
|
+
|
|
50
|
+
on:
|
|
51
|
+
pull_request:
|
|
52
|
+
workflow_dispatch:
|
|
53
|
+
|
|
54
|
+
permissions:
|
|
55
|
+
contents: read
|
|
56
|
+
|
|
57
|
+
jobs:
|
|
58
|
+
scan-agent-workflows:
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
- uses: Mughal-Baig/agentic-workflow-guard@v0
|
|
63
|
+
with:
|
|
64
|
+
config: awguard.config.json
|
|
65
|
+
preset: strict
|
|
66
|
+
fail-on: high
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
To adopt the scanner without breaking CI on old findings, commit a baseline file and use:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
- uses: Mughal-Baig/agentic-workflow-guard@v0
|
|
73
|
+
with:
|
|
74
|
+
baseline: awguard.baseline.json
|
|
75
|
+
fail-on: high
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Use With GitHub Code Scanning
|
|
79
|
+
|
|
80
|
+
Generate SARIF and upload it with GitHub's official CodeQL SARIF upload action:
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
name: Agentic Workflow Guard Code Scanning
|
|
84
|
+
|
|
85
|
+
on:
|
|
86
|
+
push:
|
|
87
|
+
schedule:
|
|
88
|
+
- cron: '22 5 * * 1'
|
|
89
|
+
workflow_dispatch:
|
|
90
|
+
|
|
91
|
+
permissions:
|
|
92
|
+
contents: read
|
|
93
|
+
security-events: write
|
|
94
|
+
|
|
95
|
+
jobs:
|
|
96
|
+
scan:
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@v4
|
|
100
|
+
- uses: Mughal-Baig/agentic-workflow-guard@v0
|
|
101
|
+
with:
|
|
102
|
+
format: sarif
|
|
103
|
+
output: awguard.sarif
|
|
104
|
+
fail-on: none
|
|
105
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
106
|
+
with:
|
|
107
|
+
sarif_file: awguard.sarif
|
|
108
|
+
category: agentic-workflow-guard
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## CLI
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
awguard [path] [--config file] [--preset name] [--format text|json|markdown|github|sarif|graph|html|migration] [--output file] [--baseline file] [--write-baseline file] [--fix-dry-run] [--fail-on none|low|medium|high|critical]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Examples:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
node ./bin/awguard.js examples/unsafe-agent.yml
|
|
121
|
+
node ./bin/awguard.js . --config awguard.config.json
|
|
122
|
+
node ./bin/awguard.js . --preset strict --format graph
|
|
123
|
+
node ./bin/awguard.js . --format html --output awguard-report.html
|
|
124
|
+
node ./bin/awguard.js . --format migration --output awguard-migration.md
|
|
125
|
+
node ./bin/awguard.js . --fix-dry-run
|
|
126
|
+
node ./bin/awguard.js . --format markdown --fail-on medium
|
|
127
|
+
node ./bin/awguard.js . --format sarif --output awguard.sarif --fail-on none
|
|
128
|
+
node ./bin/awguard.js . --write-baseline awguard.baseline.json
|
|
129
|
+
node ./bin/awguard.js . --baseline awguard.baseline.json --fail-on high
|
|
130
|
+
node ./bin/awguard.js . --format github --fail-on high
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Baseline Mode
|
|
134
|
+
|
|
135
|
+
Baseline mode lets a project start using the scanner without failing CI for already-known issues.
|
|
136
|
+
|
|
137
|
+
Create a baseline:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
node ./bin/awguard.js . --write-baseline awguard.baseline.json --fail-on none
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Then fail only on findings that are not in the baseline:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
node ./bin/awguard.js . --baseline awguard.baseline.json --fail-on high
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The baseline stores stable finding fingerprints, not secrets or workflow contents.
|
|
150
|
+
|
|
151
|
+
## Configuration
|
|
152
|
+
|
|
153
|
+
Agentic Workflow Guard automatically loads `awguard.config.json` or `.awguard.json` from the scan root. You can also pass `--config`.
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"rules": {
|
|
158
|
+
"AWG010": "off",
|
|
159
|
+
"AWG008": "low",
|
|
160
|
+
"AWG004": {
|
|
161
|
+
"severity": "critical"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"suppressions": {
|
|
165
|
+
"allowedRules": ["AWG001", "AWG002"],
|
|
166
|
+
"minimumReasonLength": 20
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Rule values can be `"off"`, `"low"`, `"medium"`, `"high"`, or `"critical"`.
|
|
172
|
+
See `examples/awguard.config.example.json` for a complete template.
|
|
173
|
+
|
|
174
|
+
Built-in presets:
|
|
175
|
+
|
|
176
|
+
- `strict`
|
|
177
|
+
- `claude-code`
|
|
178
|
+
- `codex`
|
|
179
|
+
- `aider`
|
|
180
|
+
- `triage-bot`
|
|
181
|
+
|
|
182
|
+
Use them with `--preset strict` or in config with `"extends": ["strict"]`.
|
|
183
|
+
|
|
184
|
+
## Attack Graph And HTML Reports
|
|
185
|
+
|
|
186
|
+
Generate a Mermaid attack graph:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --format graph
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Generate a standalone HTML report:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --format html --output awguard-report.html
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The report maps source, prompt boundary, capability, authority, and impact for each finding.
|
|
199
|
+
|
|
200
|
+
## Safe-Output Migration Plans
|
|
201
|
+
|
|
202
|
+
Generate a migration checklist for converting unsafe agent workflows into read-only agent jobs plus validated safe outputs or approved apply jobs:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --format migration --output awguard-migration.md
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
The migration report groups findings by workflow file, explains the risk shape, suggests allowed GitHub operations, and gives a reference two-stage pattern:
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
untrusted GitHub event text
|
|
212
|
+
-> read-only agent job
|
|
213
|
+
-> structured proposal artifact
|
|
214
|
+
-> schema and policy validation
|
|
215
|
+
-> safe outputs or approved apply job
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Fix Dry Run
|
|
219
|
+
|
|
220
|
+
Print remediation guidance without editing files:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --fix-dry-run
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Inline Suppressions
|
|
227
|
+
|
|
228
|
+
Suppressions are for reviewed false positives. They must include a reason after `--`.
|
|
229
|
+
|
|
230
|
+
```yaml
|
|
231
|
+
# awguard-disable-next-line AWG001,AWG002 -- Reviewed: this workflow only runs after maintainer approval.
|
|
232
|
+
- run: openai --prompt "${{ github.event.comment.body }}"
|
|
233
|
+
|
|
234
|
+
permissions: write-all # awguard-disable-line AWG004 -- Reviewed: release job needs tag write access.
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
If you omit rule ids, the suppression applies to all findings on the target line. Suppression comments without a clear reason are reported as `AWG011`.
|
|
238
|
+
|
|
239
|
+
## What It Detects
|
|
240
|
+
|
|
241
|
+
| Rule | Severity | What it finds |
|
|
242
|
+
| --- | --- | --- |
|
|
243
|
+
| AWG001 | High/Critical | Untrusted GitHub event text passed into an AI agent prompt |
|
|
244
|
+
| AWG002 | High | Untrusted GitHub context interpolated in a shell script |
|
|
245
|
+
| AWG003 | Critical | `pull_request_target` checking out PR head code |
|
|
246
|
+
| AWG004 | High | AI-agent workflows with broad write permissions |
|
|
247
|
+
| AWG005 | High | Secrets exposed to untrusted agent workflows |
|
|
248
|
+
| AWG006 | High | Agent flags such as `--dangerously-skip-permissions` or `--yolo` |
|
|
249
|
+
| AWG007 | High | Model/agent output names flowing into command execution |
|
|
250
|
+
| AWG008 | Medium | Agent workflow missing explicit `permissions` |
|
|
251
|
+
| AWG009 | Medium | `workflow_run` consuming artifacts before scripts |
|
|
252
|
+
| AWG010 | Low | Third-party actions in agent workflows not pinned to a SHA |
|
|
253
|
+
| AWG011 | Medium | Invalid suppression comments |
|
|
254
|
+
|
|
255
|
+
## Example Finding
|
|
256
|
+
|
|
257
|
+
```text
|
|
258
|
+
[CRITICAL] AWG001 Untrusted text reaches an AI agent prompt
|
|
259
|
+
.github/workflows/ai-triage.yml:24
|
|
260
|
+
User-controlled GitHub event text appears to be used as prompt/input for an AI agent.
|
|
261
|
+
Fix: Keep issue, PR, comment, and branch text out of privileged agent prompts unless it is reviewed, delimited, and sanitized.
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Roadmap
|
|
265
|
+
|
|
266
|
+
- Safe autofix for low-risk permission changes.
|
|
267
|
+
- Safe-output migration patch previews for common triage and review bots.
|
|
268
|
+
- GitHub App integration for always-on repository monitoring.
|
|
269
|
+
- Rule packs for Claude Code, Codex, Gemini, Copilot, Aider, and custom agents.
|
|
270
|
+
- Public vulnerable workflow lab with attack and fix walkthroughs.
|
|
271
|
+
|
|
272
|
+
## Research Backing
|
|
273
|
+
|
|
274
|
+
See [docs/market-analysis.md](docs/market-analysis.md) for the demand analysis, gap, audience, and launch plan.
|
package/action.yml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Agentic Workflow Guard
|
|
2
|
+
description: Scan GitHub Actions workflows for AI-agent injection and unsafe permission patterns.
|
|
3
|
+
author: agentic-workflow-guard
|
|
4
|
+
inputs:
|
|
5
|
+
path:
|
|
6
|
+
description: Repository path or workflow file to scan.
|
|
7
|
+
required: false
|
|
8
|
+
default: .
|
|
9
|
+
format:
|
|
10
|
+
description: Output format: github, text, json, markdown, sarif, graph, html, or migration.
|
|
11
|
+
required: false
|
|
12
|
+
default: github
|
|
13
|
+
fail-on:
|
|
14
|
+
description: Minimum severity that fails the check: none, low, medium, high, or critical.
|
|
15
|
+
required: false
|
|
16
|
+
default: high
|
|
17
|
+
output:
|
|
18
|
+
description: Optional file path for json, markdown, sarif, graph, html, or migration output.
|
|
19
|
+
required: false
|
|
20
|
+
default: ''
|
|
21
|
+
baseline:
|
|
22
|
+
description: Optional Agentic Workflow Guard baseline file. Matching findings are treated as known and do not fail the check.
|
|
23
|
+
required: false
|
|
24
|
+
default: ''
|
|
25
|
+
write-baseline:
|
|
26
|
+
description: Optional path to write a baseline file for the current scan.
|
|
27
|
+
required: false
|
|
28
|
+
default: ''
|
|
29
|
+
config:
|
|
30
|
+
description: Optional path to an Agentic Workflow Guard JSON config file.
|
|
31
|
+
required: false
|
|
32
|
+
default: ''
|
|
33
|
+
preset:
|
|
34
|
+
description: Optional comma-separated presets such as strict, claude-code, codex, aider, or triage-bot.
|
|
35
|
+
required: false
|
|
36
|
+
default: ''
|
|
37
|
+
fix-dry-run:
|
|
38
|
+
description: Print remediation guidance instead of the normal report.
|
|
39
|
+
required: false
|
|
40
|
+
default: 'false'
|
|
41
|
+
runs:
|
|
42
|
+
using: node20
|
|
43
|
+
main: bin/awguard.js
|
|
44
|
+
branding:
|
|
45
|
+
icon: shield
|
|
46
|
+
color: blue
|
package/bin/awguard.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Launch Plan
|
|
2
|
+
|
|
3
|
+
## Positioning
|
|
4
|
+
|
|
5
|
+
Agentic Workflow Guard should be described as an Agentic Workflow Injection mapper, not just a GitHub Actions scanner.
|
|
6
|
+
|
|
7
|
+
Short pitch:
|
|
8
|
+
|
|
9
|
+
> Find where untrusted GitHub issue, PR, comment, branch, or artifact text can steer AI agents inside CI.
|
|
10
|
+
|
|
11
|
+
## Star-Worthy Demo
|
|
12
|
+
|
|
13
|
+
1. Show `examples/unsafe-agent.yml`.
|
|
14
|
+
2. Run:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --format graph
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. Show the generated Mermaid chain.
|
|
21
|
+
4. Run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --fix-dry-run
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
5. Show the safe remediation steps.
|
|
28
|
+
6. Run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
node ./bin/awguard.js examples/unsafe-agent.yml --format migration
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
7. Show the migration from unsafe agent job to read-only proposal job plus safe outputs or an approved apply job.
|
|
35
|
+
|
|
36
|
+
## Release Checklist
|
|
37
|
+
|
|
38
|
+
- Publish GitHub release notes for `v1.0.0`.
|
|
39
|
+
- Add the action to GitHub Marketplace from the release UI.
|
|
40
|
+
- Publish the npm package as `awguard`; do not use `agentic-workflow-guard` because that npm name is already controlled by another maintainer.
|
|
41
|
+
- Pin the README demo to the attack graph, not the rule table.
|
|
42
|
+
- Post with the headline: "I built a scanner that maps and migrates Agentic Workflow Injection in GitHub Actions."
|
|
43
|
+
- Include the AWI attack chain screenshot in social posts.
|
|
44
|
+
- Include the migration report screenshot after the graph screenshot.
|
|
45
|
+
|
|
46
|
+
## Distribution Targets
|
|
47
|
+
|
|
48
|
+
- Hacker News: Show HN.
|
|
49
|
+
- Reddit: `r/github`, `r/devsecops`, `r/cybersecurity`.
|
|
50
|
+
- GitHub Community Discussions.
|
|
51
|
+
- OWASP GenAI / LLM app security communities.
|
|
52
|
+
- Maintainers of AI triage, AI review, and coding-agent GitHub Actions.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Market Analysis
|
|
2
|
+
|
|
3
|
+
## The Opportunity
|
|
4
|
+
|
|
5
|
+
The public GitHub project with the best reach right now is not another general AI wrapper. The stronger opportunity is a safety tool for teams adopting AI coding agents inside GitHub Actions.
|
|
6
|
+
|
|
7
|
+
Why:
|
|
8
|
+
|
|
9
|
+
- GitHub's Octoverse 2025 says AI is now standard in development, more than 1.1 million public repositories use an LLM SDK, and 80% of new GitHub developers use Copilot in their first week.
|
|
10
|
+
- Stack Overflow's 2025 Developer Survey reports that AI agents help developers move faster, but 81% of respondents are concerned about security and privacy of data when using AI agents.
|
|
11
|
+
- OWASP's GenAI Security Project exists because LLM and agentic systems created a new security category, not just a new developer convenience.
|
|
12
|
+
- GitHub's own Actions security docs warn that attacker-controlled `github` context values such as issue bodies, PR titles, branch names, and comments must be treated as untrusted.
|
|
13
|
+
- A 2026 paper on Agentic Workflow Injection found real GitHub Actions workflows where untrusted event text entered agent prompts or downstream scripts, with hundreds of exploitable cases.
|
|
14
|
+
|
|
15
|
+
## What Is Missing
|
|
16
|
+
|
|
17
|
+
Existing GitHub Actions security tools tend to focus on broad CI/CD issues: unpinned actions, `pull_request_target`, dangerous permissions, and secrets. Existing AI safety tools tend to focus on app prompts, RAG pipelines, or runtime model behavior.
|
|
18
|
+
|
|
19
|
+
The gap is the intersection:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
untrusted GitHub event text -> AI agent prompt -> privileged GitHub Actions environment
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Maintainers need a tool that explains this specific risk in their workflow files, without asking them to adopt a full enterprise scanner.
|
|
26
|
+
|
|
27
|
+
## Who Wants It
|
|
28
|
+
|
|
29
|
+
- Open-source maintainers adding AI issue triage, PR review, or coding agents.
|
|
30
|
+
- Small teams experimenting with Claude Code, Codex, Copilot, Gemini, Aider, or custom LLM scripts in CI.
|
|
31
|
+
- DevSecOps engineers who need a quick control before allowing AI agents in repositories.
|
|
32
|
+
- Security researchers looking for a small, readable rule engine they can improve.
|
|
33
|
+
|
|
34
|
+
## Product Shape
|
|
35
|
+
|
|
36
|
+
The first version should be:
|
|
37
|
+
|
|
38
|
+
- Zero dependency, so people trust and inspect it quickly.
|
|
39
|
+
- CLI first, because developers can test it locally before adding CI.
|
|
40
|
+
- GitHub Action ready, because maintainers want one copy-paste workflow step.
|
|
41
|
+
- Text, JSON, Markdown, GitHub annotation, and SARIF output.
|
|
42
|
+
- Conservative rules with useful explanations, not a noisy wall of generic warnings.
|
|
43
|
+
|
|
44
|
+
## Second-Pass Improvement: SARIF
|
|
45
|
+
|
|
46
|
+
The strongest improvement after the MVP is SARIF output. GitHub code scanning can ingest third-party SARIF files, which means findings can appear as native security alerts instead of only terminal logs. GitHub's SARIF upload workflow requires `security-events: write`, `contents: read`, and the official `github/codeql-action/upload-sarif` action.
|
|
47
|
+
|
|
48
|
+
This makes the project more valuable to maintainers because:
|
|
49
|
+
|
|
50
|
+
- It meets teams where they already review security alerts.
|
|
51
|
+
- It makes the scanner useful on a schedule, not only during PR checks.
|
|
52
|
+
- It allows future severity, fingerprint, and suppression workflows.
|
|
53
|
+
- It positions the tool next to existing static analyzers instead of as a one-off script.
|
|
54
|
+
|
|
55
|
+
## Third-Pass Improvement: Baselines
|
|
56
|
+
|
|
57
|
+
The next strongest adoption feature is baseline mode. Mature scanners invest heavily in triage, ignore states, deduplication, and separating new findings from known findings because teams rarely enable a new security gate if it immediately blocks work on historical issues.
|
|
58
|
+
|
|
59
|
+
Agentic Workflow Guard now supports:
|
|
60
|
+
|
|
61
|
+
- `--write-baseline awguard.baseline.json` to record current findings.
|
|
62
|
+
- `--baseline awguard.baseline.json` to mark matching findings as known.
|
|
63
|
+
- CI failure based only on findings that are not already in the baseline.
|
|
64
|
+
- Stable fingerprints based on rule, file, and normalized evidence.
|
|
65
|
+
|
|
66
|
+
This improves public reach because a maintainer can add the tool to a real repository with risk already present, keep visibility into the existing risk, and still block new high-severity agent-workflow mistakes.
|
|
67
|
+
|
|
68
|
+
## Fourth-Pass Improvement: Auditable Suppressions
|
|
69
|
+
|
|
70
|
+
Baseline mode helps teams start. Inline suppressions help them stay. Mature scanners support local suppressions because false positives and intentionally accepted risks happen, but the useful pattern is to require a reason so the exception is reviewable later.
|
|
71
|
+
|
|
72
|
+
Agentic Workflow Guard now supports:
|
|
73
|
+
|
|
74
|
+
- `# awguard-disable-next-line AWG001 -- reason` for the next reported line.
|
|
75
|
+
- `# awguard-disable-line AWG004 -- reason` for same-line findings.
|
|
76
|
+
- Multiple rule ids separated by spaces or commas.
|
|
77
|
+
- `AWG011` findings when suppression comments omit a clear justification or reference unknown rules.
|
|
78
|
+
|
|
79
|
+
This makes the project safer to adopt publicly because it gives maintainers a practical false-positive escape hatch without normalizing silent ignores.
|
|
80
|
+
|
|
81
|
+
## Fifth-Pass Improvement: Project Configuration
|
|
82
|
+
|
|
83
|
+
The next adoption layer is project configuration. ESLint and Semgrep both normalize the idea that teams should tune rule severity, disable specific rules, and define policy in a checked-in file. Agentic Workflow Guard now supports the same shape for this narrower security domain.
|
|
84
|
+
|
|
85
|
+
Agentic Workflow Guard now supports:
|
|
86
|
+
|
|
87
|
+
- `awguard.config.json` and `.awguard.json` auto-discovery from the scan root.
|
|
88
|
+
- `--config path/to/config.json` for explicit config.
|
|
89
|
+
- Rule severity overrides such as `"AWG004": "critical"`.
|
|
90
|
+
- Disabled rules such as `"AWG010": "off"`.
|
|
91
|
+
- Suppression policy such as allowed suppression rule ids and minimum reason length.
|
|
92
|
+
|
|
93
|
+
This improves public reach because teams can adopt the scanner without forking it or arguing with one-size-fits-all severity choices.
|
|
94
|
+
|
|
95
|
+
## V1 Improvement: Attack Graph Reports
|
|
96
|
+
|
|
97
|
+
The strongest unique hook is the attack graph report. Existing GitHub Actions scanners focus on workflow hygiene or supply-chain risk. Agentic Workflow Guard should own the Agentic Workflow Injection path:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
untrusted GitHub event text -> agent prompt -> tool capability -> authority -> impact
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This is what makes the project easy to screenshot, explain, and share. It also follows the shape of AWI research more closely than a flat list of findings.
|
|
104
|
+
|
|
105
|
+
The v1 release adds:
|
|
106
|
+
|
|
107
|
+
- `--format graph` for Mermaid attack chains.
|
|
108
|
+
- `--format html --output awguard-report.html` for a standalone report.
|
|
109
|
+
- `--fix-dry-run` for safe remediation guidance.
|
|
110
|
+
- Built-in presets for strict mode and common agent stacks.
|
|
111
|
+
|
|
112
|
+
## Deep Research Refresh: Unique Angle After V1
|
|
113
|
+
|
|
114
|
+
The stronger post-v1 position is not to become a broad AI security scanner. Popular neighboring projects already own the broad categories:
|
|
115
|
+
|
|
116
|
+
- `zizmorcore/zizmor` and `rhysd/actionlint` own general GitHub Actions static analysis and linting.
|
|
117
|
+
- `ossf/scorecard` owns open-source security health scoring.
|
|
118
|
+
- `step-security/harden-runner` owns runner runtime hardening and egress visibility.
|
|
119
|
+
- `affaan-m/agentshield`, `splx-ai/agentic-radar`, and `cisco-ai-defense/skill-scanner` own broader AI-agent, MCP, and skill-scanning surfaces.
|
|
120
|
+
- `github/gh-aw` owns the emerging GitHub Agentic Workflows ecosystem.
|
|
121
|
+
|
|
122
|
+
The gap Agentic Workflow Guard can still own is narrower and more memorable:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
find Agentic Workflow Injection -> explain the attack path -> migrate to safe outputs
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This is why v1.1 adds `--format migration`. The output turns findings into a practical plan for moving unsafe agent jobs into a two-stage architecture:
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
untrusted GitHub event text -> read-only agent job -> structured proposal -> validation -> safe outputs or approved apply job
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
This makes the project more distinctive because maintainers do not only get a red finding. They get a path from "my AI triage bot is risky" to "my bot can only perform allowed GitHub operations after validation."
|
|
135
|
+
|
|
136
|
+
## Discovery Risk Found During Research
|
|
137
|
+
|
|
138
|
+
The unscoped npm package name `agentic-workflow-guard` is already published by another maintainer and points to a different GitHub repository. Keeping that name in this repository would confuse users and could send `npx agentic-workflow-guard` traffic to the wrong code.
|
|
139
|
+
|
|
140
|
+
The v1.1 package target is now `awguard`, matching the existing CLI binary and leaving the GitHub Action name unchanged.
|
|
141
|
+
|
|
142
|
+
## Distribution Plan
|
|
143
|
+
|
|
144
|
+
1. Publish the repo with a short demo GIF or screenshot.
|
|
145
|
+
2. Add topics: `github-actions`, `ai-agents`, `prompt-injection`, `security`, `devsecops`, `llm`.
|
|
146
|
+
3. Post a concrete example: "Your AI triage workflow may be letting issue comments steer an agent with write tokens."
|
|
147
|
+
4. Submit to security and GitHub communities with before/after workflow snippets.
|
|
148
|
+
5. Add a short terminal demo and code-scanning screenshot after the first public run.
|
|
149
|
+
|
|
150
|
+
## Sources
|
|
151
|
+
|
|
152
|
+
- Stack Overflow 2025 Developer Survey, AI section: https://survey.stackoverflow.co/2025/ai
|
|
153
|
+
- GitHub Octoverse 2025: https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/
|
|
154
|
+
- GitHub Actions script injection docs: https://docs.github.com/en/actions/concepts/security/script-injections
|
|
155
|
+
- GitHub SARIF upload docs: https://docs.github.com/en/code-security/how-tos/find-and-fix-code-vulnerabilities/integrate-with-existing-tools/uploading-a-sarif-file-to-github
|
|
156
|
+
- GitHub Actions secure use reference: https://docs.github.com/en/enterprise-cloud@latest/actions/reference/security/secure-use
|
|
157
|
+
- GitHub Agentic Workflows security architecture: https://github.github.com/gh-aw/
|
|
158
|
+
- OpenSSF Scorecard dangerous workflow check: https://github.com/ossf/scorecard/blob/main/docs/checks.md#dangerous-workflow
|
|
159
|
+
- Semgrep inline ignore docs: https://semgrep.dev/docs/ignoring-files-folders-code
|
|
160
|
+
- ESLint configuration comment descriptions: https://eslint.org/docs/latest/use/configure/rules#configuration-comment-descriptions
|
|
161
|
+
- OWASP Top 10 for Large Language Model Applications: https://owasp.org/www-project-top-10-for-large-language-model-applications/
|
|
162
|
+
- Agentic Workflow Injection paper: https://arxiv.org/abs/2605.07135
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
- `unsafe-agent.yml`: intentionally vulnerable AI triage workflow.
|
|
4
|
+
- `safe-agent.yml`: quieter workflow with read-only permissions and bounded prompt file.
|
|
5
|
+
- `suppressed-agent.yml`: demonstrates audited inline suppressions.
|
|
6
|
+
- `pull-request-target.yml`: demonstrates privileged PR checkout risk.
|
|
7
|
+
- `awguard.config.example.json`: sample config with a strict preset and overrides.
|
|
8
|
+
|
|
9
|
+
Try:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
node ../bin/awguard.js unsafe-agent.yml --format graph
|
|
13
|
+
node ../bin/awguard.js unsafe-agent.yml --format html --output awguard-report.html
|
|
14
|
+
node ../bin/awguard.js unsafe-agent.yml --format migration
|
|
15
|
+
node ../bin/awguard.js unsafe-agent.yml --fix-dry-run
|
|
16
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Unsafe PR target
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
with:
|
|
15
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
16
|
+
- run: npm test
|