ai-saas-guard 0.36.0 → 0.37.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/README.md CHANGED
@@ -37,6 +37,8 @@ Start with the 30-second copy-paste demo: `npx ai-saas-guard@latest demo --summa
37
37
  npx ai-saas-guard@latest scan --root /path/to/your-saas --summary
38
38
  ```
39
39
 
40
+ For AI-heavy PRs, run it in GitHub Actions to turn auth, billing, data, deploy, and test changes into a reviewer queue before merge.
41
+
40
42
  The output is meant to answer three practical questions before you invite users:
41
43
 
42
44
  - **Can a real user get access they should not have?** Check auth, tenant ownership, Supabase RLS, and Stripe entitlement paths first.
@@ -231,19 +233,19 @@ The CLI is published on npm as `ai-saas-guard`, and the GitHub Action is availab
231
233
  | Area | Status |
232
234
  | --- | --- |
233
235
  | Public GitHub repository | Available |
234
- | npm CLI | `ai-saas-guard@0.36.0` |
235
- | GitHub Action | `zr9959/ai-saas-guard@v0` or fixed tag `v0.36.0` |
236
+ | npm CLI | `ai-saas-guard@0.37.0` |
237
+ | GitHub Action | `zr9959/ai-saas-guard@v0` or fixed tag `v0.37.0` |
236
238
  | Outputs | Launch decision queue, short summary, terminal, JSON, SARIF, and PR-focused markdown |
237
239
  | Project config | `.ai-saas-guard.json` rule toggles, severity overrides, suppressions, and fail thresholds |
238
240
  | Privacy model | Local-first, read-only scan commands, no LLM calls, no code upload |
239
- | Versioned Action tags | `v0.36.0`, `v0` |
240
- | Current release | `0.36.0` turns Markdown and summary output into a clearer launch decision queue with ranking explanations, reviewer checklists, case-study flow, and local trust/resource statements |
241
+ | Versioned Action tags | `v0.37.0`, `v0` |
242
+ | Current release | `0.37.0` makes the GitHub Action path easier to copy into PR workflows, improves Check Run wording around the launch-risk middle layer, and keeps README first-screen guidance focused on AI-heavy PR review |
241
243
  | npm publishing | Trusted Publisher/OIDC, no long-lived publish token |
242
244
  | Repository trust hardening | Strict branch protection, Dependabot, CodeQL, fast-check fuzzing, signed release provenance assets, private vulnerability reporting, secret scanning, and push protection |
243
245
  | Cloudflare hosted ingress | Deployed at `https://ai-saas-guard-hosted.zr9959.workers.dev`; signed GitHub App webhook delivery and compact Check Run smoke now pass in staging |
244
246
  | Hosted GitHub App staging | Private App `ai-saas-guard-hosted` (`3834787`) installed on `zr9959/ai-saas-guard`; hosted operations evidence is in [docs/hosted-operations-evidence.md](docs/hosted-operations-evidence.md) |
245
247
  | OpenSSF Best Practices | Passing badge, project `12955`; `.bestpractices.json` remains the conservative evidence record |
246
- | Next roadmap | v0.36.0 plan is tracked in [docs/v0.36-roadmap.md](docs/v0.36-roadmap.md) |
248
+ | Previous roadmap | v0.36.0 plan is tracked in [docs/v0.36-roadmap.md](docs/v0.36-roadmap.md) |
247
249
 
248
250
  ## Example Finding
249
251
 
@@ -415,7 +417,7 @@ Use `suppressions` for narrower false-positive handling when one rule is noisy o
415
417
 
416
418
  ## GitHub Action
417
419
 
418
- The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.36.0` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
420
+ The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.37.0` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
419
421
 
420
422
  ```yaml
421
423
  name: ai-saas-guard
@@ -485,7 +485,7 @@ export function createHostedCheckRunSummary(input) {
485
485
  conclusion,
486
486
  output: {
487
487
  title: formatCheckRunTitle(totalFindings, conclusion, input.failOnSeverity),
488
- summary: `Launch gate: ${launchGate}. Review first: What changed at the launch boundary? Manual proof required before release; it is not a full security audit, pentest, or certification.`,
488
+ summary: `Launch-risk gate: ${launchGate}. Launch gate: ${launchGate}. Review first: What changed at the launch boundary? Manual proof required before release. This is not an AI reviewer and not a full security audit, pentest, or certification.`,
489
489
  text: truncateMarkdown(formatCheckRunMarkdown(report, conclusion, localCliCommand, launchGate), input.maxMarkdownChars)
490
490
  },
491
491
  annotations: report.evidence.slice(0, MAX_CHECK_RUN_ANNOTATIONS).map((finding) => {
@@ -1146,21 +1146,31 @@ function formatCheckRunMarkdown(report, conclusion, localCliCommand, launchGate)
1146
1146
  ...report.evidence.map((finding) => `| ${escapeMarkdownTableCell(finding.severity)} | ${escapeMarkdownTableCell(finding.ruleId)} | ${escapeMarkdownTableCell(formatFindingLocation(finding))} |`)
1147
1147
  ];
1148
1148
  return [
1149
- "### AI SaaS Guard",
1149
+ "### AI SaaS Guard Launch-risk gate",
1150
1150
  "",
1151
- "Review first: verify findings locally before launch. This hosted check is not a full security audit, pentest, or certification.",
1151
+ "Review first: verify findings locally before launch or merge. Not an AI reviewer or full security audit.",
1152
1152
  "",
1153
1153
  `Launch gate: ${launchGate}`,
1154
1154
  `Conclusion: ${conclusion}`,
1155
1155
  `Local CLI: \`${localCliCommand}\``,
1156
- `Retention: compact report ${report.retentionDays} days; raw source, raw diffs, secrets, and customer payloads are not retained.`,
1157
- "",
1158
- "Summary:",
1159
- ...severityOrder.map((severity) => `- ${capitalize(severity)}: ${report.summaryCounts[severity] ?? 0}`),
1156
+ `Retention: compact report ${report.retentionDays} days; no raw source, diffs, secrets, or customer payloads.`,
1160
1157
  "",
1161
1158
  "Review categories:",
1162
1159
  ...(categories.length === 0 ? ["- None"] : categories.map((category) => `- ${category}`)),
1163
1160
  "",
1161
+ "Verification steps:",
1162
+ "- Review listed files before release or merge.",
1163
+ "- Reproduce locally with the CLI command above.",
1164
+ "- Confirm behavior with app-specific tests.",
1165
+ "",
1166
+ "Launch decision queue:",
1167
+ "- Can a real user get access they should not have?",
1168
+ "- Can the app claim success when something failed?",
1169
+ "- Can launch infrastructure do too much damage?",
1170
+ "",
1171
+ "Summary:",
1172
+ ...severityOrder.map((severity) => `- ${capitalize(severity)}: ${report.summaryCounts[severity] ?? 0}`),
1173
+ "",
1164
1174
  "Files to review first:",
1165
1175
  ...(filesToReview.length === 0 ? ["- None"] : filesToReview.map((file) => `- ${file}`)),
1166
1176
  "",
@@ -1169,11 +1179,6 @@ function formatCheckRunMarkdown(report, conclusion, localCliCommand, launchGate)
1169
1179
  "- Why this auth billing data or deploy decision is safe?",
1170
1180
  "- What manual test proves it fails closed?",
1171
1181
  "",
1172
- "Verification steps:",
1173
- "- Review each listed file before release or merge.",
1174
- "- Reproduce locally with the CLI command above.",
1175
- "- Treat findings as review prompts; confirm behavior with app-specific tests.",
1176
- "",
1177
1182
  "Findings:",
1178
1183
  ...findingLines
1179
1184
  ].join("\n");
@@ -211,24 +211,24 @@ node dist/cli.js scan --root /path/to/your-saas
211
211
 
212
212
  这个仓库是公开 GitHub 仓库。
213
213
 
214
- CLI 已发布到 npm:`ai-saas-guard@0.36.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.36.0`。
214
+ CLI 已发布到 npm:`ai-saas-guard@0.37.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.37.0`。
215
215
 
216
216
  | 模块 | 状态 |
217
217
  | --- | --- |
218
218
  | 公开 GitHub 仓库 | 已可用 |
219
- | npm CLI | `ai-saas-guard@0.36.0` |
220
- | GitHub Action | `zr9959/ai-saas-guard@v0` 或固定标签 `v0.36.0` |
219
+ | npm CLI | `ai-saas-guard@0.37.0` |
220
+ | GitHub Action | `zr9959/ai-saas-guard@v0` 或固定标签 `v0.37.0` |
221
221
  | 输出格式 | 上线决策队列、短 summary、Terminal、JSON、SARIF 和 PR markdown |
222
222
  | 项目配置 | `.ai-saas-guard.json` 支持规则开关、severity 覆盖、suppressions 和 fail threshold |
223
223
  | 隐私模型 | 本地优先、只读扫描、不调用 LLM、不上传代码 |
224
- | 当前版本 | `0.36.0` Markdown summary 输出升级成更清楚的上线决策队列,加入排序解释、reviewer checklist、case-study flow 和本地 trust/resource statement |
225
- | Action 标签 | `v0.36.0`、`v0` |
224
+ | 当前版本 | `0.37.0` GitHub Action PR workflow 更容易复制使用,优化 hosted Check Run 的 launch-risk middle layer 文案,并让 README 首屏更直接指向 AI 大 PR review 场景 |
225
+ | Action 标签 | `v0.37.0`、`v0` |
226
226
  | npm 发布 | GitHub Actions Trusted Publisher/OIDC,无需长期 npm token |
227
227
  | 仓库可信度加固 | 严格 branch protection、Dependabot、CodeQL、fast-check fuzzing、signed release provenance assets、private vulnerability reporting、secret scanning 和 push protection |
228
228
  | Cloudflare hosted ingress | 已部署到 `https://ai-saas-guard-hosted.zr9959.workers.dev`;签名 GitHub App webhook delivery 和 compact Check Run staging smoke 已通过 |
229
229
  | Hosted GitHub App staging | 私有 App `ai-saas-guard-hosted`(`3834787`)已安装到 `zr9959/ai-saas-guard`;hosted operations evidence 见 [docs/hosted-operations-evidence.md](hosted-operations-evidence.md) |
230
230
  | OpenSSF Best Practices | 已获得 passing badge,项目 `12955`;`.bestpractices.json` 继续作为保守证据记录 |
231
- | 下一版路线 | v0.36.0 计划见 [v0.36-roadmap.md](v0.36-roadmap.md) |
231
+ | 上一版路线 | v0.36.0 计划见 [v0.36-roadmap.md](v0.36-roadmap.md) |
232
232
 
233
233
  ## 主要命令
234
234
 
@@ -6,6 +6,48 @@ Use `zr9959/ai-saas-guard@v0` for the latest compatible pre-1.0 Action. Use a sp
6
6
 
7
7
  The Action runs the same local scanner inside the GitHub-hosted runner. It reads the checked-out repository, does not call an LLM, and does not upload source code. For `pr-risk`, always use `actions/checkout` with `fetch-depth: 0` so the base branch comparison is available.
8
8
 
9
+ ## Copy-paste PR launch gate workflow
10
+
11
+ Use this when you want one PR job to act as the launch-risk middle layer: Markdown goes to `$GITHUB_STEP_SUMMARY` for reviewers, while SARIF goes to GitHub code scanning for alert tracking. This is not an AI reviewer and it does not approve a PR; it translates trust-boundary changes into a reviewer queue.
12
+
13
+ ```yaml
14
+ name: ai-saas-guard-pr-launch-gate
15
+
16
+ on:
17
+ pull_request:
18
+
19
+ permissions:
20
+ contents: read
21
+ security-events: write
22
+
23
+ jobs:
24
+ launch-gate:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v6.0.2
28
+ with:
29
+ fetch-depth: 0
30
+ - uses: zr9959/ai-saas-guard@v0
31
+ with:
32
+ command: pr-risk
33
+ root: ${{ github.workspace }}
34
+ base: origin/main
35
+ config: .ai-saas-guard.json
36
+ format: markdown
37
+ output: ai-saas-guard-pr.md
38
+ - run: cat ai-saas-guard-pr.md >> "$GITHUB_STEP_SUMMARY"
39
+ - uses: zr9959/ai-saas-guard@v0
40
+ with:
41
+ command: scan
42
+ root: ${{ github.workspace }}
43
+ config: .ai-saas-guard.json
44
+ format: sarif
45
+ output: ai-saas-guard.sarif
46
+ - uses: github/codeql-action/upload-sarif@v3
47
+ with:
48
+ sarif_file: ai-saas-guard.sarif
49
+ ```
50
+
9
51
  ## PR Summary
10
52
 
11
53
  Use markdown when reviewers need a short, evidence-first launch decision queue: risky files, required verification, reviewer checklist, ranking explanation, and suggested PR split.
@@ -5,11 +5,11 @@
5
5
  ## Current State
6
6
 
7
7
  - Package name: `ai-saas-guard`
8
- - Current published version: `0.36.0`
8
+ - Current published version: `0.37.0`
9
9
  - Next source candidate: none
10
10
  - npm registry state: published at <https://www.npmjs.com/package/ai-saas-guard>
11
11
  - First npm-published version: `0.1.1`
12
- - GitHub Release: `v0.36.0`
12
+ - GitHub Release: `v0.37.0`
13
13
  - Publish workflow: `.github/workflows/npm-publish.yml`
14
14
  - Trusted Publisher: GitHub Actions, `zr9959/ai-saas-guard`, workflow `npm-publish.yml`, allowed action `npm publish`
15
15
  - Long-lived npm publish token: not required
@@ -18,7 +18,7 @@
18
18
 
19
19
  Use GitHub Actions with npm Trusted Publisher/OIDC:
20
20
 
21
- 1. Create and review a release tag such as `v0.36.0`.
21
+ 1. Create and review a release tag such as `v0.37.0`.
22
22
  2. Publish from the GitHub Release or run the `Publish npm` workflow manually with `ref` set to that tag.
23
23
  3. Keep `permissions.id-token: write` in the workflow so npm can exchange the GitHub Actions OIDC identity for a short-lived publish credential.
24
24
  4. Run `npm publish --access public` from the workflow. Trusted publishing automatically generates provenance for this public package from this public repository.
@@ -669,10 +669,15 @@ function summarizeFindings(findings) {
669
669
 
670
670
  function renderCheckRunSummary({ identity, report, scannerVersion }) {
671
671
  const lines = [
672
- `Review first: ai-saas-guard found ${report.summary.total} PR risk signal(s) for ${identity.repositoryFullName}#${identity.pullRequestNumber}.`,
672
+ `Launch-risk gate: ai-saas-guard found ${report.summary.total} PR risk signal(s) for ${identity.repositoryFullName}#${identity.pullRequestNumber}. Review first: inspect the listed trust-boundary files before merge.`,
673
673
  `Scanner version: ${scannerVersion}.`,
674
674
  "",
675
- "This is not a pentest, certification, or full security audit. Review the listed files before merge.",
675
+ "This is not an AI reviewer, pentest, certification, or full security audit. Review the listed files before merge.",
676
+ "",
677
+ "Launch decision queue:",
678
+ "- Can a real user get access they should not have?",
679
+ "- Can the app claim success when something failed?",
680
+ "- Can launch infrastructure do too much damage?",
676
681
  "",
677
682
  "Privacy: this Check Run stores compact file/category signals only. It does not store webhook payload bodies, PR title/body text, diff contents, source, secrets, checkout paths, or installation tokens."
678
683
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-saas-guard",
3
- "version": "0.36.0",
3
+ "version": "0.37.0",
4
4
  "description": "Local-first CLI that catches launch blockers in AI-built Next.js/Supabase/Stripe SaaS apps.",
5
5
  "readmeFilename": "README.md",
6
6
  "type": "module",