awguard 1.6.0 → 1.7.0
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 +32 -0
- package/Dockerfile +8 -1
- package/README.md +176 -12
- package/action.yml +5 -1
- package/docs/comparison.md +161 -16
- package/docs/launch-plan.md +12 -2
- package/docs/marketplace-listing.md +19 -0
- package/docs/npm-publishing.md +68 -0
- package/docs/release-checklist.md +71 -0
- package/docs/report-gallery.md +166 -0
- package/docs/roadmap.md +32 -2
- package/docs/rule-authoring.md +99 -0
- package/docs/schemas.md +16 -0
- package/docs/setup-recipes.md +199 -0
- package/docs/site/index.html +29 -0
- package/examples/.vscode/tasks.json +17 -1
- package/examples/README.md +7 -0
- package/examples/awguard.config.example.json +8 -0
- package/examples/corpus/.cursor/rules/autonomy.mdc +3 -0
- package/examples/corpus/.github/prompts/auto-fix.prompt.md +3 -0
- package/examples/corpus/.github/workflows/agentic-pr-review.yml +20 -0
- package/examples/corpus/.github/workflows/pull-request-target-head.yml +13 -0
- package/examples/corpus/.mcp.json +15 -0
- package/examples/corpus/AGENTS.md +5 -0
- package/examples/corpus/README.md +23 -0
- package/examples/dashboard/README.md +55 -0
- package/examples/dashboard/index.html +313 -0
- package/examples/dashboard/sample-history.json +53 -0
- package/examples/lab/README.md +6 -0
- package/examples/pr-comment-bot.yml +43 -0
- package/examples/pull-request-target.yml +1 -1
- package/examples/safe-agent.yml +1 -1
- package/examples/unsafe-agent.yml +1 -1
- package/examples/vscode-extension/README.md +49 -0
- package/examples/vscode-extension/assets/problems-panel.svg +23 -0
- package/examples/vscode-extension/package.json +68 -0
- package/examples/vscode-extension/src/extension.js +116 -0
- package/package.json +2 -1
- package/schemas/awguard.badge.schema.json +25 -0
- package/schemas/awguard.baseline.schema.json +40 -0
- package/schemas/awguard.comparison.schema.json +146 -0
- package/schemas/awguard.config.schema.json +167 -0
- package/schemas/awguard.inventory.schema.json +124 -0
- package/schemas/awguard.report.schema.json +121 -0
- package/src/autofix.js +201 -0
- package/src/badges.js +63 -0
- package/src/baseline.js +77 -0
- package/src/cli.js +248 -6
- package/src/compare.js +60 -4
- package/src/config.js +31 -2
- package/src/demo.js +90 -0
- package/src/doctor.js +189 -0
- package/src/explain.js +147 -0
- package/src/init.js +4 -1
- package/src/policy-packs.js +99 -0
- package/src/policy-wizard.js +165 -0
- package/src/remediation.js +73 -1
- package/src/reporters.js +86 -3
- package/src/scanner.js +204 -5
- package/src/templates.js +132 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 1.7.0 - 2026-05-30
|
|
6
|
+
|
|
7
|
+
- Add `awguard doctor` for setup, config, scan target, schema, and GitHub Actions summary checks.
|
|
8
|
+
- Add `awguard explain AWG###` for rule-level explanations and remediation guidance.
|
|
9
|
+
- Add `awguard badges` to print copyable README badge snippets.
|
|
10
|
+
- Add `awguard demo` for an offline unsafe-to-fixed vulnerable lab walkthrough.
|
|
11
|
+
- Add `awguard templates` for GitHub Actions, code scanning, GitLab CI, pre-commit, and VS Code snippets.
|
|
12
|
+
- Add `awguard policy-pack` for OSS, strict, and enterprise policy starter configs.
|
|
13
|
+
- Add `scan.include` and `scan.exclude` config globs for narrowing discovered scan files.
|
|
14
|
+
- Add `AWG016`, `AWG017`, and `AWG018` for checkout credentials, unsafe agent writeback, and MCP input injection.
|
|
15
|
+
- Improve SARIF metadata with stable AWGuard fingerprints, categories, snippets, and columns.
|
|
16
|
+
- Move the JavaScript GitHub Action runtime and bundled workflow templates to Node 24-ready actions.
|
|
17
|
+
- Add machine-readable remediation codes to JSON and SARIF findings.
|
|
18
|
+
- Add scan guardrails for maximum discovered files and maximum scanned file size.
|
|
19
|
+
- Add end-to-end golden tests for unsafe/fixed labs, compare, inventory, and score outputs.
|
|
20
|
+
- Add `awguard baseline-review` with explicit `--prune` support for stale baselines.
|
|
21
|
+
- Add `awguard policy-wizard` for reviewed policy allowlist starter configs.
|
|
22
|
+
- Add a safe PR comment workflow example and Docker image publishing workflow.
|
|
23
|
+
- Add `schemas/awguard.config.schema.json` for editor validation of AWGuard config files.
|
|
24
|
+
- Add schemas for JSON scan reports, inventories, comparisons, baselines, and badge endpoints.
|
|
25
|
+
- Add compare report surface diffs and `--compare ... --format json`.
|
|
26
|
+
- Add automatic GitHub Actions job summaries with scan metrics and top findings.
|
|
27
|
+
- Add expanded comparison, setup recipe, report gallery, rule authoring, release checklist, and npm trusted publishing docs.
|
|
28
|
+
- Add a trusted publishing GitHub Actions workflow for tokenless npm releases.
|
|
29
|
+
- Add a real-world pattern corpus for unsafe agent workflow, prompt, instruction, Cursor rule, and MCP examples.
|
|
30
|
+
- Add VS Code task, problem matcher, and extension proof-of-concept assets.
|
|
31
|
+
- Add a local dashboard proof of concept for AWI score and finding trends.
|
|
32
|
+
- Add opt-in `--fix` for narrow workflow hardening edits and improve `--fix-dry-run` with an autofix plan.
|
|
33
|
+
- Add `AWG019` for offline MCP package reputation policy using trusted package scopes.
|
|
34
|
+
|
|
3
35
|
## 1.6.0
|
|
4
36
|
|
|
5
37
|
- Add `awguard init` to print starter GitHub Action, strict config, baseline, report, and badge setup snippets.
|
package/Dockerfile
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
FROM node:
|
|
1
|
+
FROM node:24-alpine
|
|
2
|
+
|
|
3
|
+
LABEL org.opencontainers.image.title="Agentic Workflow Guard"
|
|
4
|
+
LABEL org.opencontainers.image.description="Scan GitHub Actions workflows, agent instructions, and MCP configs for agentic workflow risk."
|
|
5
|
+
LABEL org.opencontainers.image.source="https://github.com/Mughal-Baig/agentic-workflow-guard"
|
|
6
|
+
LABEL org.opencontainers.image.licenses="MIT"
|
|
2
7
|
|
|
3
8
|
WORKDIR /app
|
|
4
9
|
COPY package.json README.md LICENSE action.yml ./
|
|
5
10
|
COPY bin ./bin
|
|
6
11
|
COPY src ./src
|
|
12
|
+
RUN chmod +x /app/bin/awguard.js && ln -s /app/bin/awguard.js /usr/local/bin/awguard
|
|
7
13
|
|
|
14
|
+
WORKDIR /repo
|
|
8
15
|
ENTRYPOINT ["node", "/app/bin/awguard.js"]
|
package/README.md
CHANGED
|
@@ -51,6 +51,20 @@ Generate a starter config, GitHub Action, baseline command, and badge snippet:
|
|
|
51
51
|
npx awguard init
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Check your local setup, config discovery, scan target, and GitHub Actions summary support:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx awguard doctor
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Explain a rule, print README badge snippets, or run the built-in vulnerable lab demo:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx awguard explain AWG001
|
|
64
|
+
npx awguard badges --repo OWNER/REPO --site https://OWNER.github.io/REPO/
|
|
65
|
+
npx awguard demo
|
|
66
|
+
```
|
|
67
|
+
|
|
54
68
|
## Use In GitHub Actions
|
|
55
69
|
|
|
56
70
|
After you upload this repository to GitHub, users can add:
|
|
@@ -69,7 +83,7 @@ jobs:
|
|
|
69
83
|
scan-agent-workflows:
|
|
70
84
|
runs-on: ubuntu-latest
|
|
71
85
|
steps:
|
|
72
|
-
- uses: actions/checkout@
|
|
86
|
+
- uses: actions/checkout@v6
|
|
73
87
|
- uses: Mughal-Baig/agentic-workflow-guard@v0
|
|
74
88
|
with:
|
|
75
89
|
config: awguard.config.json
|
|
@@ -77,6 +91,8 @@ jobs:
|
|
|
77
91
|
fail-on: high
|
|
78
92
|
```
|
|
79
93
|
|
|
94
|
+
When AWGuard runs inside GitHub Actions it also writes a job summary with scanned file count, finding count, highest severity, top findings, and follow-up commands.
|
|
95
|
+
|
|
80
96
|
To adopt the scanner without breaking CI on old findings, commit a baseline file and use:
|
|
81
97
|
|
|
82
98
|
```yaml
|
|
@@ -107,7 +123,7 @@ jobs:
|
|
|
107
123
|
scan:
|
|
108
124
|
runs-on: ubuntu-latest
|
|
109
125
|
steps:
|
|
110
|
-
- uses: actions/checkout@
|
|
126
|
+
- uses: actions/checkout@v6
|
|
111
127
|
- uses: Mughal-Baig/agentic-workflow-guard@v0
|
|
112
128
|
with:
|
|
113
129
|
format: sarif
|
|
@@ -122,14 +138,30 @@ jobs:
|
|
|
122
138
|
## CLI
|
|
123
139
|
|
|
124
140
|
```bash
|
|
125
|
-
awguard [path] [--config file] [--preset name] [--format text|json|markdown|github|sarif|graph|html|migration|score|badge|inventory|inventory-json] [--output file] [--baseline file] [--write-baseline file] [--fix-dry-run] [--fail-on none|low|medium|high|critical]
|
|
141
|
+
awguard [path] [--config file] [--preset name] [--format text|json|markdown|github|sarif|graph|html|migration|score|badge|inventory|inventory-json] [--output file] [--baseline file] [--write-baseline file] [--fix-dry-run] [--fix] [--fail-on none|low|medium|high|critical]
|
|
126
142
|
awguard init
|
|
143
|
+
awguard doctor [path] [--config file] [--preset name]
|
|
144
|
+
awguard explain [AWG###]
|
|
145
|
+
awguard badges [--repo OWNER/REPO] [--branch main] [--badge-file docs/awguard-badge.json] [--site URL]
|
|
146
|
+
awguard demo
|
|
147
|
+
awguard templates [all|github|code-scanning|gitlab|pre-commit|vscode]
|
|
148
|
+
awguard policy-pack [oss|strict|enterprise]
|
|
149
|
+
awguard policy-wizard [path] [--dry-run] [--format markdown|json] [--output awguard.config.json]
|
|
150
|
+
awguard baseline-review [path] --baseline awguard.baseline.json [--format text|json] [--prune]
|
|
127
151
|
awguard --compare previous.json current.json
|
|
128
152
|
```
|
|
129
153
|
|
|
130
154
|
Examples:
|
|
131
155
|
|
|
132
156
|
```bash
|
|
157
|
+
node ./bin/awguard.js doctor
|
|
158
|
+
node ./bin/awguard.js explain AWG013
|
|
159
|
+
node ./bin/awguard.js badges --repo Mughal-Baig/agentic-workflow-guard --site https://mughal-baig.github.io/agentic-workflow-guard/
|
|
160
|
+
node ./bin/awguard.js demo
|
|
161
|
+
node ./bin/awguard.js templates github
|
|
162
|
+
node ./bin/awguard.js policy-pack strict
|
|
163
|
+
node ./bin/awguard.js policy-wizard . --dry-run
|
|
164
|
+
node ./bin/awguard.js baseline-review . --baseline awguard.baseline.json
|
|
133
165
|
node ./bin/awguard.js examples/unsafe-agent.yml
|
|
134
166
|
node ./bin/awguard.js . --config awguard.config.json
|
|
135
167
|
node ./bin/awguard.js . --preset strict --format graph
|
|
@@ -140,6 +172,7 @@ node ./bin/awguard.js . --format inventory-json --output awguard-inventory.json
|
|
|
140
172
|
node ./bin/awguard.js . --format score
|
|
141
173
|
node ./bin/awguard.js . --format badge --output awguard-badge.json
|
|
142
174
|
node ./bin/awguard.js . --fix-dry-run
|
|
175
|
+
node ./bin/awguard.js . --fix
|
|
143
176
|
node ./bin/awguard.js . --format markdown --fail-on medium
|
|
144
177
|
node ./bin/awguard.js . --format sarif --output awguard.sarif --fail-on none
|
|
145
178
|
node ./bin/awguard.js . --write-baseline awguard.baseline.json
|
|
@@ -166,12 +199,29 @@ node ./bin/awguard.js . --baseline awguard.baseline.json --fail-on high
|
|
|
166
199
|
|
|
167
200
|
The baseline stores stable finding fingerprints, not secrets or workflow contents.
|
|
168
201
|
|
|
202
|
+
Review and prune stale baseline entries:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
node ./bin/awguard.js baseline-review . --baseline awguard.baseline.json
|
|
206
|
+
node ./bin/awguard.js baseline-review . --baseline awguard.baseline.json --format json
|
|
207
|
+
node ./bin/awguard.js baseline-review . --baseline awguard.baseline.json --prune
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
`baseline-review` never rewrites the baseline unless `--prune` is present.
|
|
211
|
+
|
|
169
212
|
## Configuration
|
|
170
213
|
|
|
171
214
|
Agentic Workflow Guard automatically loads `awguard.config.json` or `.awguard.json` from the scan root. You can also pass `--config`.
|
|
172
215
|
|
|
173
216
|
```json
|
|
174
217
|
{
|
|
218
|
+
"$schema": "https://raw.githubusercontent.com/Mughal-Baig/agentic-workflow-guard/main/schemas/awguard.config.schema.json",
|
|
219
|
+
"scan": {
|
|
220
|
+
"include": [".github/workflows/*", "AGENTS.md", ".mcp.json"],
|
|
221
|
+
"exclude": ["node_modules/*", "dist/*", "build/*"],
|
|
222
|
+
"maxFiles": 250,
|
|
223
|
+
"maxFileBytes": 262144
|
|
224
|
+
},
|
|
175
225
|
"rules": {
|
|
176
226
|
"AWG010": "off",
|
|
177
227
|
"AWG008": "low",
|
|
@@ -188,6 +238,67 @@ Agentic Workflow Guard automatically loads `awguard.config.json` or `.awguard.js
|
|
|
188
238
|
|
|
189
239
|
Rule values can be `"off"`, `"low"`, `"medium"`, `"high"`, or `"critical"`.
|
|
190
240
|
See `examples/awguard.config.example.json` for a complete template.
|
|
241
|
+
The config schema is published at `schemas/awguard.config.schema.json` for editor completion and validation.
|
|
242
|
+
`scan.maxFiles` and `scan.maxFileBytes` are optional guardrails for very large repositories; leave them out if you do not want hard limits.
|
|
243
|
+
|
|
244
|
+
Generate starter policy packs:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
node ./bin/awguard.js policy-pack oss
|
|
248
|
+
node ./bin/awguard.js policy-pack strict
|
|
249
|
+
node ./bin/awguard.js policy-pack enterprise
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Generate a starter policy from the current repository surfaces:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
node ./bin/awguard.js policy-wizard . --dry-run
|
|
256
|
+
node ./bin/awguard.js policy-wizard . --format json --output awguard.config.json
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Review the generated allowlists before committing them. The wizard preserves existing config fields when you pass `--config`.
|
|
260
|
+
|
|
261
|
+
Generate CI and editor templates:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
node ./bin/awguard.js templates all
|
|
265
|
+
node ./bin/awguard.js templates code-scanning
|
|
266
|
+
node ./bin/awguard.js templates pre-commit
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
PR comment bot starter:
|
|
270
|
+
|
|
271
|
+
- Copy `examples/pr-comment-bot.yml` to `.github/workflows/awguard-pr-comment.yml`.
|
|
272
|
+
- It uses `pull_request`, `contents: read`, and `pull-requests: write`.
|
|
273
|
+
- It only posts comments for same-repository pull requests; forked pull requests still get the scan job without exposing secrets or privileged `pull_request_target` behavior.
|
|
274
|
+
|
|
275
|
+
Docker usage:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
docker run --rm -v "$PWD:/repo" ghcr.io/mughal-baig/agentic-workflow-guard:latest . --preset strict
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
GitHub Actions Docker job:
|
|
282
|
+
|
|
283
|
+
```yaml
|
|
284
|
+
jobs:
|
|
285
|
+
awguard:
|
|
286
|
+
runs-on: ubuntu-latest
|
|
287
|
+
steps:
|
|
288
|
+
- uses: actions/checkout@v6
|
|
289
|
+
- run: docker run --rm -v "$PWD:/repo" ghcr.io/mughal-baig/agentic-workflow-guard:latest . --preset strict --fail-on high
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
GitLab CI container job:
|
|
293
|
+
|
|
294
|
+
```yaml
|
|
295
|
+
awguard:
|
|
296
|
+
image:
|
|
297
|
+
name: ghcr.io/mughal-baig/agentic-workflow-guard:latest
|
|
298
|
+
entrypoint: [""]
|
|
299
|
+
script:
|
|
300
|
+
- awguard . --preset strict --fail-on high
|
|
301
|
+
```
|
|
191
302
|
|
|
192
303
|
Built-in presets:
|
|
193
304
|
|
|
@@ -253,6 +364,12 @@ Then add a badge to your README:
|
|
|
253
364
|
[](docs/awguard-badge.json)
|
|
254
365
|
```
|
|
255
366
|
|
|
367
|
+
Or print all common badge snippets:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
node ./bin/awguard.js badges --repo OWNER/REPO
|
|
371
|
+
```
|
|
372
|
+
|
|
256
373
|
The score starts at 100 and subtracts risk for critical, high, medium, and low findings. This makes AWGuard easy to show in a README without hiding the detailed SARIF, graph, and migration reports.
|
|
257
374
|
|
|
258
375
|
## Agentic Surface Inventory
|
|
@@ -278,9 +395,12 @@ Track newly introduced agentic risk across branches or releases:
|
|
|
278
395
|
```bash
|
|
279
396
|
node ./bin/awguard.js . --format json --output current-awguard.json
|
|
280
397
|
node ./bin/awguard.js --compare previous-awguard.json current-awguard.json
|
|
398
|
+
node ./bin/awguard.js --compare previous-awguard.json current-awguard.json --format json
|
|
281
399
|
```
|
|
282
400
|
|
|
283
|
-
The comparison report shows introduced findings, resolved findings, added scanned files, and
|
|
401
|
+
The comparison report shows introduced findings, resolved findings, added scanned files, removed scanned files, and agentic surface drift by workflows, agent context files, MCP configs, and other scanned files.
|
|
402
|
+
|
|
403
|
+
Machine-readable report schemas are documented in [docs/schemas.md](docs/schemas.md).
|
|
284
404
|
|
|
285
405
|
## Policy Mode
|
|
286
406
|
|
|
@@ -292,6 +412,7 @@ Policy mode makes new agent surfaces visible during review. Add allowlists to `a
|
|
|
292
412
|
"approvedFiles": ["AGENTS.md", ".github/workflows/*"],
|
|
293
413
|
"approvedMcpServers": ["github"],
|
|
294
414
|
"approvedMcpPackages": ["@modelcontextprotocol/server-github@1.2.3"],
|
|
415
|
+
"approvedMcpPackageScopes": ["@modelcontextprotocol/"],
|
|
295
416
|
"approvedMcpCommands": ["npx", "node"]
|
|
296
417
|
}
|
|
297
418
|
}
|
|
@@ -334,6 +455,7 @@ AWGuard also scans project-scoped MCP config files without starting the configur
|
|
|
334
455
|
- `claude_desktop_config.json`
|
|
335
456
|
|
|
336
457
|
It flags MCP configs that start mutable packages such as `npx package`, `uvx package@latest`, or unpinned Docker images, and configs that commit tokens, API keys, passwords, or authorization headers.
|
|
458
|
+
When `policy.approvedMcpPackageScopes` is configured, it also reports MCP packages outside reviewed publisher scopes as `AWG019` without contacting package registries.
|
|
337
459
|
|
|
338
460
|
## Fix Dry Run
|
|
339
461
|
|
|
@@ -343,6 +465,28 @@ Print remediation guidance without editing files:
|
|
|
343
465
|
node ./bin/awguard.js examples/unsafe-agent.yml --fix-dry-run
|
|
344
466
|
```
|
|
345
467
|
|
|
468
|
+
Apply only narrow, deterministic workflow hardening edits:
|
|
469
|
+
|
|
470
|
+
```bash
|
|
471
|
+
node ./bin/awguard.js . --fix
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Autofix currently handles safe `permissions: write-all` replacement, missing top-level `permissions: contents: read`, and `actions/checkout` `persist-credentials: false`. Review `git diff` before committing.
|
|
475
|
+
|
|
476
|
+
## Explain And Demo
|
|
477
|
+
|
|
478
|
+
Explain any rule:
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
node ./bin/awguard.js explain AWG004
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Run the built-in unsafe-to-fixed lab walkthrough without network access:
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
node ./bin/awguard.js demo
|
|
488
|
+
```
|
|
489
|
+
|
|
346
490
|
## Inline Suppressions
|
|
347
491
|
|
|
348
492
|
Suppressions are for reviewed false positives. They must include a reason after `--`.
|
|
@@ -375,11 +519,38 @@ If you omit rule ids, the suppression applies to all findings on the target line
|
|
|
375
519
|
| AWG013 | High | MCP configs that start mutable packages, unpinned containers, or shell wrappers |
|
|
376
520
|
| AWG014 | Critical | MCP configs that hardcode secrets, tokens, passwords, or auth headers |
|
|
377
521
|
| AWG015 | Medium | Agentic surfaces, MCP servers, packages, or commands not approved by policy |
|
|
522
|
+
| AWG016 | High | Checkout credentials persisting in elevated agent workflows |
|
|
523
|
+
| AWG017 | Critical | Agent writeback without branch, PR, or artifact containment |
|
|
524
|
+
| AWG018 | High/Critical | Untrusted GitHub event text passed into MCP tool inputs or environment |
|
|
525
|
+
| AWG019 | Medium | MCP packages outside configured trusted package scopes |
|
|
526
|
+
|
|
527
|
+
JSON and SARIF outputs also include a stable `remediationCode` such as `permissions.tighten-token`, `mcp.pin-server`, or `writeback.use-pr-branch`. Use these codes for dashboards, routing, and automation that should not depend on free-text suggestions.
|
|
378
528
|
|
|
379
529
|
## How It Compares
|
|
380
530
|
|
|
381
531
|
See [docs/comparison.md](docs/comparison.md) for how AWGuard fits beside `zizmor`, `actionlint`, OpenSSF Scorecard, secret scanners, and MCP runtime scanners.
|
|
382
532
|
|
|
533
|
+
## Adoption Docs
|
|
534
|
+
|
|
535
|
+
- [Setup recipes](docs/setup-recipes.md): Claude Code, Codex, Cursor, GitHub Copilot, Cline, and safe PR comment bots.
|
|
536
|
+
- [Report gallery](docs/report-gallery.md): text, GitHub annotations, SARIF, inventory, attack graph, HTML, migration, score, badge, compare, and policy wizard outputs.
|
|
537
|
+
- [Rule authoring](docs/rule-authoring.md): how to add high-signal AWGuard rules and fixtures.
|
|
538
|
+
- [npm publishing](docs/npm-publishing.md): trusted publishing, OIDC, and provenance setup.
|
|
539
|
+
- [Release checklist](docs/release-checklist.md): Marketplace screenshots, package checks, and release steps.
|
|
540
|
+
- [VS Code extension POC](examples/vscode-extension/README.md): command palette scan, diagnostics, and `$awguard` problem matcher.
|
|
541
|
+
- [Dashboard POC](examples/dashboard/README.md): local trend dashboard for AWI score, findings, and agentic surface growth.
|
|
542
|
+
|
|
543
|
+
## Example Corpus
|
|
544
|
+
|
|
545
|
+
The [real-world pattern corpus](examples/corpus/README.md) contains intentionally unsafe fixtures for PR review agents, `pull_request_target`, persistent instructions, reusable prompts, Cursor rules, and MCP configs.
|
|
546
|
+
|
|
547
|
+
Run it locally:
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
node ./bin/awguard.js examples/corpus --format inventory
|
|
551
|
+
node ./bin/awguard.js examples/corpus --format migration
|
|
552
|
+
```
|
|
553
|
+
|
|
383
554
|
## Example Finding
|
|
384
555
|
|
|
385
556
|
```text
|
|
@@ -391,21 +562,14 @@ See [docs/comparison.md](docs/comparison.md) for how AWGuard fits beside `zizmor
|
|
|
391
562
|
|
|
392
563
|
## Roadmap
|
|
393
564
|
|
|
394
|
-
- Safe autofix for low-risk permission changes.
|
|
395
|
-
- Safe-output migration patch previews for common triage and review bots.
|
|
396
565
|
- Hosted AWI score API for dynamic cross-repository badges.
|
|
397
|
-
- Agent instruction file rule packs for Copilot, Claude Code, Codex, Gemini, Cursor, and Windsurf.
|
|
398
|
-
- MCP config rule packs for Claude Code, Copilot, VS Code, Cursor, Windsurf, Cline, and Roo.
|
|
399
|
-
- Policy mode for approved MCP packages, actions, token scopes, and agent context files.
|
|
400
566
|
- Agent capability SBOM for prompts, tools, MCP servers, permissions, and write paths.
|
|
401
567
|
- Trend reports that show newly added agent surfaces and newly introduced findings.
|
|
402
568
|
- GitHub App integration for always-on repository monitoring.
|
|
403
|
-
- Rule packs for Claude Code, Codex, Gemini, Copilot, Aider, and custom agents.
|
|
404
|
-
- Public vulnerable workflow lab with attack and fix walkthroughs.
|
|
405
569
|
|
|
406
570
|
## Contributing And Security
|
|
407
571
|
|
|
408
|
-
Contributions are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md), and report sensitive security issues using [SECURITY.md](SECURITY.md).
|
|
572
|
+
Contributions are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md) and [docs/rule-authoring.md](docs/rule-authoring.md), and report sensitive security issues using [SECURITY.md](SECURITY.md).
|
|
409
573
|
|
|
410
574
|
## Research Backing
|
|
411
575
|
|
package/action.yml
CHANGED
|
@@ -38,8 +38,12 @@ inputs:
|
|
|
38
38
|
description: Print remediation guidance instead of the normal report.
|
|
39
39
|
required: false
|
|
40
40
|
default: 'false'
|
|
41
|
+
fix:
|
|
42
|
+
description: Apply narrow safe workflow hardening edits instead of the normal report. Review git diff before committing generated changes.
|
|
43
|
+
required: false
|
|
44
|
+
default: 'false'
|
|
41
45
|
runs:
|
|
42
|
-
using:
|
|
46
|
+
using: node24
|
|
43
47
|
main: bin/awguard.js
|
|
44
48
|
branding:
|
|
45
49
|
icon: shield
|
package/docs/comparison.md
CHANGED
|
@@ -1,23 +1,168 @@
|
|
|
1
|
-
#
|
|
1
|
+
# How AWGuard Compares
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agentic Workflow Guard is not trying to replace general GitHub Actions linters, project health scorecards, secret scanners, or live MCP inspectors. Its lane is narrower: find places where repository automation gives AI agents attacker-influenced text, tools, secrets, or write authority.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
| --- | --- | --- |
|
|
7
|
-
| `zizmor` | General GitHub Actions security analysis | AWGuard focuses on AI-agent prompt, tool, MCP, and repository instruction paths. |
|
|
8
|
-
| `actionlint` | GitHub Actions syntax and workflow linting | AWGuard looks for agentic trust-boundary risk, not YAML correctness. |
|
|
9
|
-
| OpenSSF Scorecard | Open-source project security posture | AWGuard gives an Agentic Workflow Injection score and agent surface inventory. |
|
|
10
|
-
| MCP runtime scanners | Inspect live MCP servers and tool descriptions | AWGuard scans repository MCP configs without executing server commands. |
|
|
11
|
-
| Secret scanners | Find committed secrets | AWGuard connects MCP/agent secret exposure to agent capabilities and remediation. |
|
|
5
|
+
## Short Version
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
| Tool | Best at | AWGuard difference | Use together |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| `zizmor` | Static security analysis for GitHub Actions. | AWGuard adds AI-agent prompt flow, MCP config, persistent agent instruction, and writeback boundary checks. | Run `zizmor` for broad Actions hardening, then AWGuard for agentic workflow injection risk. |
|
|
10
|
+
| `actionlint` | Syntax, expression, input, and workflow semantics checks for GitHub Actions. | AWGuard is not a syntax checker. It assumes valid YAML and looks for trust-boundary patterns. | Run `actionlint` first so broken workflows are caught before security review. |
|
|
11
|
+
| OpenSSF Scorecard | Repository-level supply-chain health signals. | AWGuard produces a focused AWI score, inventory, SARIF, and attack graph for agentic surfaces. | Use Scorecard for public trust posture, AWGuard for AI-agent risk inside the repo. |
|
|
12
|
+
| Secret scanners | Hardcoded credential detection and push protection. | AWGuard looks for secrets exposed to untrusted agent workflows and MCP configs, even when the secret is referenced through `${{ secrets.NAME }}`. | Keep GitHub secret scanning enabled, then use AWGuard to check whether agents can reach secrets. |
|
|
13
|
+
| MCP runtime scanners | Live server and tool behavior inspection. | AWGuard is zero-execution. It reviews committed MCP config before a server starts. | Run AWGuard in CI, then run live MCP inspection in a sandbox for approved servers. |
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## What AWGuard Owns
|
|
16
|
+
|
|
17
|
+
AWGuard focuses on a threat shape that general CI tools rarely model:
|
|
16
18
|
|
|
17
19
|
```text
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
AWGuard -> agentic workflow, context, and MCP trust boundaries
|
|
20
|
+
untrusted GitHub event text
|
|
21
|
+
-> AI agent prompt, instruction, MCP input, or shell script
|
|
22
|
+
-> tools, secrets, token permissions, or repository writeback
|
|
23
|
+
-> repository change, data exposure, or unsafe automation
|
|
23
24
|
```
|
|
25
|
+
|
|
26
|
+
The scanner turns that shape into:
|
|
27
|
+
|
|
28
|
+
- Rule findings such as `AWG001`, `AWG004`, `AWG012`, `AWG013`, `AWG017`, and `AWG018`.
|
|
29
|
+
- SARIF for GitHub code scanning.
|
|
30
|
+
- Human-readable attack graphs and migration plans.
|
|
31
|
+
- Agentic surface inventories for workflows, instruction files, and MCP configs.
|
|
32
|
+
- Baselines and compare reports for gradual adoption.
|
|
33
|
+
- Policy allowlists for reviewed files, MCP servers, packages, and commands.
|
|
34
|
+
|
|
35
|
+
## Tool-by-tool Notes
|
|
36
|
+
|
|
37
|
+
### zizmor
|
|
38
|
+
|
|
39
|
+
[`zizmor`](https://docs.zizmor.sh/) is a static analysis tool for GitHub Actions and can find common CI/CD security issues. AWGuard should sit beside it, not in front of it.
|
|
40
|
+
|
|
41
|
+
Use `zizmor` for:
|
|
42
|
+
|
|
43
|
+
- GitHub Actions security audits.
|
|
44
|
+
- Broad CI/CD hardening checks.
|
|
45
|
+
- Existing GitHub Actions security recipes and integrations.
|
|
46
|
+
|
|
47
|
+
Use AWGuard for:
|
|
48
|
+
|
|
49
|
+
- Agent prompts built from issue, comment, PR, branch, or workflow input text.
|
|
50
|
+
- Agent jobs with broad write permissions or persisted checkout credentials.
|
|
51
|
+
- Unsafe agent writeback paths.
|
|
52
|
+
- MCP configs that use mutable packages, shell wrappers, unpinned containers, or hardcoded credentials.
|
|
53
|
+
- Persistent agent instruction files that weaken approval or secret boundaries.
|
|
54
|
+
|
|
55
|
+
### actionlint
|
|
56
|
+
|
|
57
|
+
[`actionlint`](https://github.com/rhysd/actionlint) is a static checker for GitHub Actions workflows. It checks syntax, expression semantics, action usage, reusable workflow contracts, and shell/python snippets.
|
|
58
|
+
|
|
59
|
+
Use `actionlint` for:
|
|
60
|
+
|
|
61
|
+
- Invalid workflow keys.
|
|
62
|
+
- Broken `${{ }}` expressions.
|
|
63
|
+
- Missing or mismatched reusable workflow inputs.
|
|
64
|
+
- Shellcheck-style script quality.
|
|
65
|
+
|
|
66
|
+
Use AWGuard after that for:
|
|
67
|
+
|
|
68
|
+
- Whether a valid workflow gives an AI agent too much authority.
|
|
69
|
+
- Whether untrusted GitHub context reaches an AI prompt, MCP input, or shell boundary.
|
|
70
|
+
- Whether an agent workflow is safe to run on PRs, comments, and issue events.
|
|
71
|
+
|
|
72
|
+
### OpenSSF Scorecard
|
|
73
|
+
|
|
74
|
+
[OpenSSF Scorecard](https://github.com/ossf/scorecard) evaluates repository security health. Its checks include areas such as dangerous workflows, pinned dependencies, packaging, token permissions, and vulnerabilities.
|
|
75
|
+
|
|
76
|
+
Use Scorecard for:
|
|
77
|
+
|
|
78
|
+
- Public repository trust signals.
|
|
79
|
+
- Broad open-source security hygiene.
|
|
80
|
+
- A badge that maintainers and users already recognize.
|
|
81
|
+
|
|
82
|
+
Use AWGuard for:
|
|
83
|
+
|
|
84
|
+
- A narrower score around Agentic Workflow Injection risk.
|
|
85
|
+
- Reviewable findings that explain which exact prompt, workflow, instruction, or MCP config creates the risk.
|
|
86
|
+
- Repository-specific adoption artifacts: baselines, migration plans, and policy allowlists.
|
|
87
|
+
|
|
88
|
+
### GitHub Secret Scanning And Other Secret Scanners
|
|
89
|
+
|
|
90
|
+
[GitHub secret scanning](https://docs.github.com/en/code-security/concepts/secret-security/about-secret-scanning) detects exposed credentials in code, issues, PRs, discussions, wikis, and other supported surfaces. GitHub also documents ways to enable additional leak detection and push protection.
|
|
91
|
+
|
|
92
|
+
Use secret scanners for:
|
|
93
|
+
|
|
94
|
+
- Detecting leaked token values.
|
|
95
|
+
- Blocking supported secrets before they land.
|
|
96
|
+
- Alerting and rotation workflows.
|
|
97
|
+
|
|
98
|
+
Use AWGuard for:
|
|
99
|
+
|
|
100
|
+
- Finding workflows where `${{ secrets.NAME }}` is available to an untrusted AI-agent job.
|
|
101
|
+
- Finding committed MCP auth material in project-scoped configs.
|
|
102
|
+
- Explaining how to split privileged secrets into reviewed workflows.
|
|
103
|
+
|
|
104
|
+
### MCP Runtime Scanners
|
|
105
|
+
|
|
106
|
+
Runtime MCP scanners and inspectors can execute or introspect live servers. AWGuard intentionally does not start MCP servers. That makes it safe to run in pull requests and on untrusted branches.
|
|
107
|
+
|
|
108
|
+
Use runtime inspection for:
|
|
109
|
+
|
|
110
|
+
- Tool schemas.
|
|
111
|
+
- Server behavior.
|
|
112
|
+
- Network access and live capabilities.
|
|
113
|
+
|
|
114
|
+
Use AWGuard for:
|
|
115
|
+
|
|
116
|
+
- Pre-execution review of committed `.mcp.json`, `.vscode/mcp.json`, Cursor, Windsurf, Cline, Roo, and similar config files.
|
|
117
|
+
- Mutable package and container launch detection.
|
|
118
|
+
- Policy drift when a new MCP server appears in the repository.
|
|
119
|
+
|
|
120
|
+
## Recommended Stack
|
|
121
|
+
|
|
122
|
+
For a public repository using AI coding agents:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
name: Security
|
|
126
|
+
|
|
127
|
+
on:
|
|
128
|
+
pull_request:
|
|
129
|
+
push:
|
|
130
|
+
branches: [main]
|
|
131
|
+
|
|
132
|
+
permissions:
|
|
133
|
+
contents: read
|
|
134
|
+
security-events: write
|
|
135
|
+
|
|
136
|
+
jobs:
|
|
137
|
+
actions-lint:
|
|
138
|
+
runs-on: ubuntu-latest
|
|
139
|
+
steps:
|
|
140
|
+
- uses: actions/checkout@v6
|
|
141
|
+
- run: actionlint
|
|
142
|
+
|
|
143
|
+
agentic-workflow-guard:
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
steps:
|
|
146
|
+
- uses: actions/checkout@v6
|
|
147
|
+
- uses: Mughal-Baig/agentic-workflow-guard@v0
|
|
148
|
+
with:
|
|
149
|
+
preset: strict
|
|
150
|
+
format: sarif
|
|
151
|
+
output: awguard.sarif
|
|
152
|
+
fail-on: high
|
|
153
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
154
|
+
if: always()
|
|
155
|
+
with:
|
|
156
|
+
sarif_file: awguard.sarif
|
|
157
|
+
category: agentic-workflow-guard
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Add `zizmor`, Scorecard, and secret scanning according to the repository's security program. AWGuard is the agentic layer in that stack.
|
|
161
|
+
|
|
162
|
+
## Official References
|
|
163
|
+
|
|
164
|
+
- zizmor documentation: <https://docs.zizmor.sh/>
|
|
165
|
+
- actionlint repository: <https://github.com/rhysd/actionlint>
|
|
166
|
+
- OpenSSF Scorecard repository: <https://github.com/ossf/scorecard>
|
|
167
|
+
- GitHub secret scanning docs: <https://docs.github.com/en/code-security/concepts/secret-security/about-secret-scanning>
|
|
168
|
+
- npm trusted publishing docs: <https://docs.npmjs.com/trusted-publishers/>
|
package/docs/launch-plan.md
CHANGED
|
@@ -68,12 +68,21 @@ Short pitch:
|
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
18. Explain the new hook: "This scanner checks repo-provided MCP tool wiring without executing the MCP server."
|
|
71
|
+
19. Show the real-world corpus:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
node ./bin/awguard.js examples/corpus --format inventory
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
20. Explain that visitors can clone the repo and see high-signal findings immediately, without needing a real vulnerable project.
|
|
71
78
|
|
|
72
79
|
## Release Checklist
|
|
73
80
|
|
|
74
|
-
-
|
|
81
|
+
- Use `docs/release-checklist.md` for the release gate.
|
|
82
|
+
- Use `docs/report-gallery.md` for screenshot commands.
|
|
83
|
+
- Publish GitHub release notes for the target version.
|
|
75
84
|
- Add the action to GitHub Marketplace from the release UI.
|
|
76
|
-
- Publish the npm package as `awguard
|
|
85
|
+
- Publish the npm package as `awguard` with trusted publishing when possible.
|
|
77
86
|
- Pin the README demo to the attack graph, not the rule table.
|
|
78
87
|
- Post with the headline: "I built a scanner that maps and migrates Agentic Workflow Injection in GitHub Actions."
|
|
79
88
|
- Include the AWI attack chain screenshot in social posts.
|
|
@@ -81,6 +90,7 @@ Short pitch:
|
|
|
81
90
|
- Include the AWI risk badge as the final screenshot because it is the easiest artifact for other maintainers to copy.
|
|
82
91
|
- Include a short "workflow looked safe, AGENTS.md made it unsafe" example because it is the most surprising hook.
|
|
83
92
|
- Include a short "MCP config looked like developer tooling, but it gave the agent a mutable tool server and a token" example because MCP is the hottest adjacent security topic.
|
|
93
|
+
- Include the setup recipes link so Claude Code, Codex, Cursor, Copilot, and Cline users have an immediate next step.
|
|
84
94
|
|
|
85
95
|
## Distribution Targets
|
|
86
96
|
|
|
@@ -38,3 +38,22 @@ Outputs include GitHub annotations, SARIF for code scanning, attack graphs, migr
|
|
|
38
38
|
## Suggested Release Note
|
|
39
39
|
|
|
40
40
|
Use this Action before adding AI agents, custom prompts, or MCP tools to a repository.
|
|
41
|
+
|
|
42
|
+
## Screenshot Plan
|
|
43
|
+
|
|
44
|
+
1. Terminal demo from `docs/assets/terminal-demo.svg`.
|
|
45
|
+
2. Inventory output from `node ./bin/awguard.js examples/corpus --format inventory`.
|
|
46
|
+
3. Attack graph from `node ./bin/awguard.js examples/lab/unsafe --format graph`.
|
|
47
|
+
4. Migration plan from `node ./bin/awguard.js examples/lab/unsafe --format migration`.
|
|
48
|
+
5. GitHub Code Scanning page after SARIF upload.
|
|
49
|
+
6. Policy wizard output from `node ./bin/awguard.js policy-wizard examples/corpus --dry-run`.
|
|
50
|
+
7. Dashboard POC from `examples/dashboard`.
|
|
51
|
+
8. VS Code Problems panel from `examples/vscode-extension`.
|
|
52
|
+
|
|
53
|
+
## Docs To Link
|
|
54
|
+
|
|
55
|
+
- Comparison: `docs/comparison.md`
|
|
56
|
+
- Setup recipes: `docs/setup-recipes.md`
|
|
57
|
+
- Report gallery: `docs/report-gallery.md`
|
|
58
|
+
- Rule authoring: `docs/rule-authoring.md`
|
|
59
|
+
- Release checklist: `docs/release-checklist.md`
|