ai-saas-guard 0.35.0 → 0.36.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 +34 -9
- package/dist/report/launchGate.d.ts +4 -0
- package/dist/report/launchGate.js +41 -0
- package/dist/report/markdown.js +22 -1
- package/dist/report/summary.js +5 -1
- package/docs/README.zh-CN.md +32 -7
- package/docs/case-study-ai-saas.md +38 -0
- package/docs/github-action.md +3 -3
- package/docs/npm-publishing.md +3 -3
- package/docs/positioning.md +26 -0
- package/docs/project-handoff.md +2 -0
- package/docs/sample-launch-report.md +9 -1
- package/docs/v0.36-roadmap.md +38 -0
- package/examples/case-study-ai-saas/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,19 @@
|
|
|
31
31
|
|
|
32
32
|
AI-built SaaS can look ready before it is ready: login works, checkout opens, the dashboard loads, and tests are green. The launch risk is usually hidden in trust-boundary code that decides who gets access, who pays, what data they can see, and whether failures are visible.
|
|
33
33
|
|
|
34
|
-
Start with the 30-second copy-paste demo: `npx ai-saas-guard@latest demo --summary`. No signup, no code upload, no LLM call. See the
|
|
34
|
+
Start with the 30-second copy-paste demo: `npx ai-saas-guard@latest demo --summary`. No signup, no code upload, no LLM call. See the saved output and [compare with alternatives](docs/launch-gate-positioning.md). Then run the same launch gate against your repo in about three minutes:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx ai-saas-guard@latest scan --root /path/to/your-saas --summary
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The output is meant to answer three practical questions before you invite users:
|
|
41
|
+
|
|
42
|
+
- **Can a real user get access they should not have?** Check auth, tenant ownership, Supabase RLS, and Stripe entitlement paths first.
|
|
43
|
+
- **Can the app claim success when something failed?** Check swallowed errors, fake success responses, hardcoded fallback data, and skipped tests.
|
|
44
|
+
- **Can launch infrastructure do too much damage?** Check exposed env vars, overpowered workflows, MCP tools, deploy gaps, and missing request evidence.
|
|
45
|
+
|
|
46
|
+
See the [terminal screenshot](docs/demo-terminal-screenshot.svg), [saved output](docs/demo-terminal-output.txt), and the [30-second cold-start review](docs/cold-start-review.md).
|
|
35
47
|
|
|
36
48
|
These are the failures that hurt after real users arrive:
|
|
37
49
|
|
|
@@ -46,6 +58,18 @@ These are the failures that hurt after real users arrive:
|
|
|
46
58
|
|
|
47
59
|
`ai-saas-guard` gives you a short local review queue for those risks. It does not prove the app is secure, certify a release, or replace human review. It tells founders, solo builders, small teams, and reviewers what deserves attention first.
|
|
48
60
|
|
|
61
|
+
## What To Do With The Result
|
|
62
|
+
|
|
63
|
+
Treat the report as a launch review queue, not a scorecard. Fix or manually prove the highest trust-boundary findings before spending time on low-severity hygiene.
|
|
64
|
+
|
|
65
|
+
| If you see | Do this first |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| Critical/high auth, billing, RLS, tenant, webhook, or silent-success findings | Reproduce the manual proof step in staging and confirm the path fails closed |
|
|
68
|
+
| Medium deploy, env, request ID, MCP, or Actions hygiene findings | Decide whether the launch path needs the control now or can be tracked after critical paths are closed |
|
|
69
|
+
| Low/info hints | Clean them up after the user-access, payment, and data-access paths are understood |
|
|
70
|
+
|
|
71
|
+
For a realistic risky app, scan [examples/case-study-ai-saas](examples/case-study-ai-saas) or read [docs/case-study-ai-saas.md](docs/case-study-ai-saas.md).
|
|
72
|
+
|
|
49
73
|
## 30-Second Copy-Paste Demo
|
|
50
74
|
|
|
51
75
|
No signup, no code upload, no LLM call:
|
|
@@ -122,7 +146,7 @@ One command returns a launch-readiness report with:
|
|
|
122
146
|
- why the finding matters for an AI-built SaaS launch
|
|
123
147
|
- manual verification steps you can actually run
|
|
124
148
|
- practical fix direction, not generic advice
|
|
125
|
-
- short `--summary`, terminal, JSON, SARIF, and PR markdown output for local review or CI
|
|
149
|
+
- launch decision queue, ranking explanation, trust statement, short `--summary`, terminal, JSON, SARIF, and PR markdown output for local review or CI
|
|
126
150
|
|
|
127
151
|
## Problems It Helps You Catch
|
|
128
152
|
|
|
@@ -207,18 +231,19 @@ The CLI is published on npm as `ai-saas-guard`, and the GitHub Action is availab
|
|
|
207
231
|
| Area | Status |
|
|
208
232
|
| --- | --- |
|
|
209
233
|
| Public GitHub repository | Available |
|
|
210
|
-
| npm CLI | `ai-saas-guard@0.
|
|
211
|
-
| GitHub Action | `zr9959/ai-saas-guard@v0` or fixed tag `v0.
|
|
212
|
-
| Outputs |
|
|
234
|
+
| npm CLI | `ai-saas-guard@0.36.0` |
|
|
235
|
+
| GitHub Action | `zr9959/ai-saas-guard@v0` or fixed tag `v0.36.0` |
|
|
236
|
+
| Outputs | Launch decision queue, short summary, terminal, JSON, SARIF, and PR-focused markdown |
|
|
213
237
|
| Project config | `.ai-saas-guard.json` rule toggles, severity overrides, suppressions, and fail thresholds |
|
|
214
238
|
| Privacy model | Local-first, read-only scan commands, no LLM calls, no code upload |
|
|
215
|
-
| Versioned Action tags | `v0.
|
|
216
|
-
| Current release | `0.
|
|
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 |
|
|
217
241
|
| npm publishing | Trusted Publisher/OIDC, no long-lived publish token |
|
|
218
242
|
| Repository trust hardening | Strict branch protection, Dependabot, CodeQL, fast-check fuzzing, signed release provenance assets, private vulnerability reporting, secret scanning, and push protection |
|
|
219
243
|
| 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 |
|
|
220
244
|
| 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) |
|
|
221
245
|
| 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) |
|
|
222
247
|
|
|
223
248
|
## Example Finding
|
|
224
249
|
|
|
@@ -272,7 +297,7 @@ AI-generated PRs often combine unrelated work:
|
|
|
272
297
|
- suggested PR split
|
|
273
298
|
- required tests or manual verification
|
|
274
299
|
- explicit git-diff diagnostics when a base ref or shallow checkout prevents PR classification
|
|
275
|
-
- PR-focused markdown for GitHub step summaries or PR comments
|
|
300
|
+
- PR-focused markdown with launch decision queue, reviewer checklist, ranking explanation, and suggested split for GitHub step summaries or PR comments
|
|
276
301
|
|
|
277
302
|
```bash
|
|
278
303
|
node dist/cli.js pr-risk --root /path/to/your-saas --base origin/main --json
|
|
@@ -390,7 +415,7 @@ Use `suppressions` for narrower false-positive handling when one rule is noisy o
|
|
|
390
415
|
|
|
391
416
|
## GitHub Action
|
|
392
417
|
|
|
393
|
-
The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.
|
|
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:
|
|
394
419
|
|
|
395
420
|
```yaml
|
|
396
421
|
name: ai-saas-guard
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { BaseReport, Finding } from "../types.js";
|
|
2
2
|
export declare function launchGateVerdict(report: BaseReport): string;
|
|
3
3
|
export declare function reviewFirst(findings: Finding[], limit?: number): string[];
|
|
4
|
+
export declare function launchDecisionQuestions(findings: Finding[]): string[];
|
|
5
|
+
export declare function rankingExplanation(findings: Finding[]): string[];
|
|
6
|
+
export declare function prReviewerChecklist(): string[];
|
|
7
|
+
export declare function trustStatement(): string[];
|
|
4
8
|
export declare function manualProofSteps(findings: Finding[], limit?: number): string[];
|
|
5
9
|
export declare function nextSteps(findings: Finding[]): string[];
|
|
@@ -20,6 +20,47 @@ export function reviewFirst(findings, limit = 3) {
|
|
|
20
20
|
return `${finding.severity.toUpperCase()} ${finding.ruleId}${location ? ` at ${location}` : ""} - ${finding.title}`;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
export function launchDecisionQuestions(findings) {
|
|
24
|
+
if (findings.length === 0) {
|
|
25
|
+
return [
|
|
26
|
+
"Can a real user get access they should not have? No current finding, but still run a two-account auth/data-access smoke.",
|
|
27
|
+
"Can the app claim success when something failed? No current finding, but still force one provider failure before launch.",
|
|
28
|
+
"Can launch infrastructure do too much damage? No current finding, but still confirm env, CI, MCP, and deploy permissions."
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
return [
|
|
32
|
+
"Can a real user get access they should not have? Review auth, tenant ownership, Supabase RLS, webhook entitlement, and data mutation findings first.",
|
|
33
|
+
"Can the app claim success when something failed? Review silent-success, hardcoded fallback, skipped test, and provider failure findings before launch.",
|
|
34
|
+
"Can launch infrastructure do too much damage? Review env exposure, GitHub Actions permissions, MCP tool power, deploy config, logging, and resource hints."
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
export function rankingExplanation(findings) {
|
|
38
|
+
if (findings.length === 0) {
|
|
39
|
+
return [
|
|
40
|
+
"No findings were ranked by this command; this is still a heuristic result, not a certification."
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
return [
|
|
44
|
+
"ai-saas-guard ranks auth, billing, tenant data, RLS, webhooks, and silent-success findings before deploy/cost hygiene because those paths can grant access, expose customer data, or hide production failures.",
|
|
45
|
+
"Medium and low deploy, CI, MCP, and observability findings stay in the queue because they can amplify launch damage, but they should not distract from critical user-access, payment, and data-access proof."
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
export function prReviewerChecklist() {
|
|
49
|
+
return [
|
|
50
|
+
"What changed at the trust boundary?",
|
|
51
|
+
"Why this auth/session/payment/data access decision?",
|
|
52
|
+
"What manual proof should block merge until it passes?",
|
|
53
|
+
"Which files should be reviewed together before this PR is approved?",
|
|
54
|
+
"Should auth, billing, data access, deploy, or UI changes be split into separate PRs?"
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
export function trustStatement() {
|
|
58
|
+
return [
|
|
59
|
+
"Runs as a local-first, deterministic, read-only launch gate over repository files.",
|
|
60
|
+
"Does not upload code or call an LLM.",
|
|
61
|
+
"Uses bounded file collection and ignores heavy generated directories such as node_modules, .next, dist, build, coverage, and .git."
|
|
62
|
+
];
|
|
63
|
+
}
|
|
23
64
|
export function manualProofSteps(findings, limit = 3) {
|
|
24
65
|
const steps = [];
|
|
25
66
|
const seen = new Set();
|
package/dist/report/markdown.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { launchGateVerdict, manualProofSteps, nextSteps, reviewFirst } from "./launchGate.js";
|
|
1
|
+
import { launchDecisionQuestions, launchGateVerdict, manualProofSteps, nextSteps, prReviewerChecklist, rankingExplanation, reviewFirst, trustStatement } from "./launchGate.js";
|
|
2
2
|
export function formatMarkdownReport(report) {
|
|
3
3
|
if (report.command === "demo")
|
|
4
4
|
return `${formatDemoMarkdown(report)}\n`;
|
|
@@ -48,6 +48,9 @@ function formatPrRiskMarkdown(report) {
|
|
|
48
48
|
lines.push(`**Risk categories:** ${report.categories.map((category) => `\`${category}\``).join(", ")}`);
|
|
49
49
|
}
|
|
50
50
|
lines.push("");
|
|
51
|
+
lines.push("### Launch Decision Queue");
|
|
52
|
+
appendList(lines, launchDecisionQuestions(report.findings).map(escapeMarkdownInline));
|
|
53
|
+
lines.push("");
|
|
51
54
|
lines.push("### Review first");
|
|
52
55
|
if (report.topRiskyFiles.length === 0) {
|
|
53
56
|
lines.push("");
|
|
@@ -65,6 +68,15 @@ function formatPrRiskMarkdown(report) {
|
|
|
65
68
|
lines.push("### Required verification");
|
|
66
69
|
appendList(lines, report.requiredTests.length > 0 ? report.requiredTests : report.reviewChecklist);
|
|
67
70
|
lines.push("");
|
|
71
|
+
lines.push("### Reviewer checklist");
|
|
72
|
+
appendList(lines, prReviewerChecklist().map(escapeMarkdownInline));
|
|
73
|
+
lines.push("");
|
|
74
|
+
lines.push("### Why this review order");
|
|
75
|
+
appendList(lines, [
|
|
76
|
+
"Rank trust-boundary files before cosmetic files because auth, billing, tenant data, RLS, webhook, and silent-success changes can affect real users before UI issues do.",
|
|
77
|
+
...rankingExplanation(report.findings)
|
|
78
|
+
].map(escapeMarkdownInline));
|
|
79
|
+
lines.push("");
|
|
68
80
|
lines.push("### Suggested PR split");
|
|
69
81
|
appendList(lines, report.suggestedSplit.length > 0 ? report.suggestedSplit : ["No split suggestion from the current diff."]);
|
|
70
82
|
lines.push("");
|
|
@@ -94,6 +106,15 @@ function appendList(lines, items) {
|
|
|
94
106
|
}
|
|
95
107
|
}
|
|
96
108
|
function appendLaunchQueue(lines, findings) {
|
|
109
|
+
lines.push("");
|
|
110
|
+
lines.push("### Launch Decision Queue");
|
|
111
|
+
appendList(lines, launchDecisionQuestions(findings).map(escapeMarkdownInline));
|
|
112
|
+
lines.push("");
|
|
113
|
+
lines.push("### Why This Is Ranked First");
|
|
114
|
+
appendList(lines, rankingExplanation(findings).map(escapeMarkdownInline));
|
|
115
|
+
lines.push("");
|
|
116
|
+
lines.push("### Trust Statement");
|
|
117
|
+
appendList(lines, trustStatement().map(escapeMarkdownInline));
|
|
97
118
|
if (findings.length === 0)
|
|
98
119
|
return;
|
|
99
120
|
lines.push("");
|
package/dist/report/summary.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { launchGateVerdict, manualProofSteps, nextSteps, reviewFirst } from "./launchGate.js";
|
|
1
|
+
import { launchDecisionQuestions, launchGateVerdict, manualProofSteps, nextSteps, reviewFirst } from "./launchGate.js";
|
|
2
2
|
export function formatSummaryReport(report) {
|
|
3
3
|
if (report.command === "demo")
|
|
4
4
|
return formatShowcaseSummary(report);
|
|
@@ -7,6 +7,10 @@ export function formatSummaryReport(report) {
|
|
|
7
7
|
lines.push(`Root: ${report.rootDir}`);
|
|
8
8
|
lines.push(`Findings: ${summaryText(report)}`);
|
|
9
9
|
lines.push(`Launch gate: ${launchGateVerdict(report)}`);
|
|
10
|
+
lines.push(`Decision queue: ${launchDecisionQuestions(report.findings)[0]}`);
|
|
11
|
+
if (report.findings.length > 0) {
|
|
12
|
+
lines.push("Review trust-boundary findings before deploy/cost hygiene.");
|
|
13
|
+
}
|
|
10
14
|
if (report.findings.length === 0) {
|
|
11
15
|
lines.push("");
|
|
12
16
|
lines.push("No heuristic launch-readiness risks found by this command.");
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -41,8 +41,32 @@ AI 构建的 SaaS 很容易“看起来已经能上线”:能登录、能打
|
|
|
41
41
|
- Next/Vercel 生产环境缺 env 文档、security headers、request ID 或成本风险提示
|
|
42
42
|
- AI 生成的大 PR 把 auth、billing、data、deploy 或测试改动藏在“普通改动”里
|
|
43
43
|
|
|
44
|
+
先用 30 秒 demo 看输出:`npx ai-saas-guard@latest demo --summary`。不用注册、不上传代码、不调用 LLM。然后用大约 3 分钟扫自己的仓库:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx ai-saas-guard@latest scan --root /path/to/your-saas --summary
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
输出会先回答三个上线前最实际的问题:
|
|
51
|
+
|
|
52
|
+
- **真实用户会不会拿到不该有的权限?** 先看 auth、tenant ownership、Supabase RLS 和 Stripe entitlement。
|
|
53
|
+
- **服务失败时会不会假装成功?** 先看 swallowed error、fake success、hardcoded fallback data 和跳过的测试。
|
|
54
|
+
- **上线基础设施是不是权限太大?** 再看 env 暴露、过宽 workflow、MCP tool、deploy gap 和 request evidence。
|
|
55
|
+
|
|
44
56
|
`ai-saas-guard` 是面向这个时刻的本地优先、review-first 上线预检工具。它不会证明你的应用绝对安全,也不是渗透测试、认证或完整安全审计。它的目标是给 founder、独立开发者、小团队和 reviewer 一份短而有证据的清单,告诉你上线或合并 PR 前最该先看哪里。
|
|
45
57
|
|
|
58
|
+
## 看到结果后该怎么处理
|
|
59
|
+
|
|
60
|
+
把报告当成上线 review 队列,而不是分数。先处理或人工验证最高风险的信任边界 finding,再处理低级别 hygiene。
|
|
61
|
+
|
|
62
|
+
| 如果看到 | 先做什么 |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| Critical/high 的 auth、billing、RLS、tenant、webhook 或 silent-success finding | 在 staging 复现 manual proof,确认风险路径会 fail closed |
|
|
65
|
+
| Medium 的 deploy、env、request ID、MCP 或 Actions hygiene finding | 判断这个上线路径现在是否必须补控制,还是可以在 critical 路径关闭后跟进 |
|
|
66
|
+
| Low/info 提示 | 等 user access、payment、data access 路径都清楚后再清理 |
|
|
67
|
+
|
|
68
|
+
想看一个更像真实项目的风险样例,可以扫描 [examples/case-study-ai-saas](../examples/case-study-ai-saas) 或阅读 [case-study-ai-saas.md](case-study-ai-saas.md)。
|
|
69
|
+
|
|
46
70
|
## 30 秒复制粘贴 demo
|
|
47
71
|
|
|
48
72
|
不需要注册、不上传代码、不调用 LLM:
|
|
@@ -119,7 +143,7 @@ Next steps
|
|
|
119
143
|
- 说明它为什么会影响 AI 构建的 SaaS 上线
|
|
120
144
|
- 给出可以人工复现的验证步骤
|
|
121
145
|
- 给出实际修复方向,不只是一句泛泛建议
|
|
122
|
-
-
|
|
146
|
+
- 支持上线决策队列、排序解释、trust statement、短 `--summary`、terminal、JSON、SARIF 和 PR markdown,方便本地或 CI 使用
|
|
123
147
|
|
|
124
148
|
## 它能帮你抓住哪些问题
|
|
125
149
|
|
|
@@ -187,23 +211,24 @@ node dist/cli.js scan --root /path/to/your-saas
|
|
|
187
211
|
|
|
188
212
|
这个仓库是公开 GitHub 仓库。
|
|
189
213
|
|
|
190
|
-
CLI 已发布到 npm:`ai-saas-guard@0.
|
|
214
|
+
CLI 已发布到 npm:`ai-saas-guard@0.36.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.36.0`。
|
|
191
215
|
|
|
192
216
|
| 模块 | 状态 |
|
|
193
217
|
| --- | --- |
|
|
194
218
|
| 公开 GitHub 仓库 | 已可用 |
|
|
195
|
-
| npm CLI | `ai-saas-guard@0.
|
|
196
|
-
| GitHub Action | `zr9959/ai-saas-guard@v0` 或固定标签 `v0.
|
|
197
|
-
| 输出格式 |
|
|
219
|
+
| npm CLI | `ai-saas-guard@0.36.0` |
|
|
220
|
+
| GitHub Action | `zr9959/ai-saas-guard@v0` 或固定标签 `v0.36.0` |
|
|
221
|
+
| 输出格式 | 上线决策队列、短 summary、Terminal、JSON、SARIF 和 PR markdown |
|
|
198
222
|
| 项目配置 | `.ai-saas-guard.json` 支持规则开关、severity 覆盖、suppressions 和 fail threshold |
|
|
199
223
|
| 隐私模型 | 本地优先、只读扫描、不调用 LLM、不上传代码 |
|
|
200
|
-
| 当前版本 | `0.
|
|
201
|
-
| Action 标签 | `v0.
|
|
224
|
+
| 当前版本 | `0.36.0` 将 Markdown 和 summary 输出升级成更清楚的上线决策队列,加入排序解释、reviewer checklist、case-study flow 和本地 trust/resource statement |
|
|
225
|
+
| Action 标签 | `v0.36.0`、`v0` |
|
|
202
226
|
| npm 发布 | GitHub Actions Trusted Publisher/OIDC,无需长期 npm token |
|
|
203
227
|
| 仓库可信度加固 | 严格 branch protection、Dependabot、CodeQL、fast-check fuzzing、signed release provenance assets、private vulnerability reporting、secret scanning 和 push protection |
|
|
204
228
|
| Cloudflare hosted ingress | 已部署到 `https://ai-saas-guard-hosted.zr9959.workers.dev`;签名 GitHub App webhook delivery 和 compact Check Run staging smoke 已通过 |
|
|
205
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) |
|
|
206
230
|
| OpenSSF Best Practices | 已获得 passing badge,项目 `12955`;`.bestpractices.json` 继续作为保守证据记录 |
|
|
231
|
+
| 下一版路线 | v0.36.0 计划见 [v0.36-roadmap.md](v0.36-roadmap.md) |
|
|
207
232
|
|
|
208
233
|
## 主要命令
|
|
209
234
|
|
|
@@ -14,8 +14,46 @@ Expected findings include:
|
|
|
14
14
|
|
|
15
15
|
Use it locally:
|
|
16
16
|
|
|
17
|
+
## Local Scan
|
|
18
|
+
|
|
17
19
|
```bash
|
|
18
20
|
npx ai-saas-guard@latest scan --root examples/case-study-ai-saas --summary
|
|
19
21
|
```
|
|
20
22
|
|
|
23
|
+
## Markdown Report
|
|
24
|
+
|
|
25
|
+
Use Markdown when you want a launch decision queue that can be pasted into an issue or PR:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx ai-saas-guard@latest scan --root examples/case-study-ai-saas --markdown
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The report should start with the launch gate, decision queue, top risks, manual proof steps, ranking explanation, and trust statement before listing every finding.
|
|
32
|
+
|
|
33
|
+
## PR Risk
|
|
34
|
+
|
|
35
|
+
To see how the same middle-layer logic works for an AI-heavy PR, run:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx ai-saas-guard@latest pr-risk --root examples/case-study-ai-saas --base origin/main --markdown
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The PR report is designed for reviewers: review order, required verification, reviewer checklist, suggested PR split, and file evidence.
|
|
42
|
+
|
|
43
|
+
## Fix-before/fix-after
|
|
44
|
+
|
|
45
|
+
Use this fixture as the "before" state. The expected fix path is not to make the fixture a starter template; it is to demonstrate how a reviewer would close the launch gate:
|
|
46
|
+
|
|
47
|
+
- verify Stripe signatures before entitlement updates
|
|
48
|
+
- replace fake success fallbacks with explicit error or degraded-mode handling
|
|
49
|
+
- scope Supabase RLS by tenant/user ownership
|
|
50
|
+
- add Next/Vercel security headers and request IDs
|
|
51
|
+
- reduce GitHub Actions permissions and add PR concurrency cancellation
|
|
52
|
+
|
|
53
|
+
After each fix, rerun the local scan and keep the manual proof result with the launch checklist.
|
|
54
|
+
|
|
55
|
+
## Trust and Resource Boundary
|
|
56
|
+
|
|
57
|
+
The fixture is scanned locally. `ai-saas-guard` does not upload source code or call an LLM, and normal CLI scans use bounded file collection with generated and dependency directories ignored.
|
|
58
|
+
|
|
21
59
|
This fixture is public-safe and synthetic. It is not a SaaS starter template, pentest target, certification artifact, or full audit.
|
package/docs/github-action.md
CHANGED
|
@@ -8,7 +8,7 @@ The Action runs the same local scanner inside the GitHub-hosted runner. It reads
|
|
|
8
8
|
|
|
9
9
|
## PR Summary
|
|
10
10
|
|
|
11
|
-
Use markdown when reviewers need a short, evidence-first
|
|
11
|
+
Use markdown when reviewers need a short, evidence-first launch decision queue: risky files, required verification, reviewer checklist, ranking explanation, and suggested PR split.
|
|
12
12
|
|
|
13
13
|
```yaml
|
|
14
14
|
name: ai-saas-guard-pr-summary
|
|
@@ -37,7 +37,7 @@ jobs:
|
|
|
37
37
|
- run: cat ai-saas-guard-pr.md >> "$GITHUB_STEP_SUMMARY"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Use markdown for PR review triage. It is intentionally short enough for a GitHub step summary or a PR comment created by your own workflow. It does not require a hosted service.
|
|
40
|
+
Use markdown for PR review triage. It is intentionally short enough for a GitHub step summary or a PR comment created by your own workflow. It does not require a hosted service. The report keeps the middle-layer contract explicit: it translates trust-boundary changes into human review questions, not an automatic approval.
|
|
41
41
|
|
|
42
42
|
## Project Config
|
|
43
43
|
|
|
@@ -98,4 +98,4 @@ jobs:
|
|
|
98
98
|
sarif_file: ai-saas-guard.sarif
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
Use SARIF for tracking alerts over time. Use markdown for reviewer guidance on a specific PR. Many teams should run both: markdown for
|
|
101
|
+
Use SARIF for tracking alerts over time. Use markdown for reviewer guidance on a specific PR. Many teams should run both: markdown for launch decision queues, SARIF for code scanning visibility.
|
package/docs/npm-publishing.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
## Current State
|
|
6
6
|
|
|
7
7
|
- Package name: `ai-saas-guard`
|
|
8
|
-
- Current published version: `0.
|
|
8
|
+
- Current published version: `0.36.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.
|
|
12
|
+
- GitHub Release: `v0.36.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.
|
|
21
|
+
1. Create and review a release tag such as `v0.36.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.
|
package/docs/positioning.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
This project should compete by being narrow, trustworthy, and review-oriented.
|
|
4
4
|
|
|
5
|
+
## North Star
|
|
6
|
+
|
|
7
|
+
`ai-saas-guard` should become the launch-risk middle layer between AI-generated SaaS code and real users.
|
|
8
|
+
|
|
9
|
+
The product is not trying to be the lowest-level static-analysis engine, and it is not trying to be a top-level full security audit service. Its job is to translate messy AI-built SaaS code and AI-heavy PRs into a founder-readable, reviewer-ready launch gate:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
AI-built SaaS code
|
|
13
|
+
↓
|
|
14
|
+
ai-saas-guard: launch-risk middle layer
|
|
15
|
+
↓
|
|
16
|
+
founder, reviewer, CI, or GitHub App makes the final launch decision
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The long-term product sentence:
|
|
20
|
+
|
|
21
|
+
> The launch gate between AI-generated code and real users.
|
|
22
|
+
|
|
23
|
+
Every major feature should support this middle-layer role:
|
|
24
|
+
|
|
25
|
+
- translate code changes into launch-risk language
|
|
26
|
+
- prioritize trust-boundary paths: auth, billing, tenant data, RLS, webhooks, env, CI, MCP, and deploy
|
|
27
|
+
- turn findings into manual proof steps a human can actually run
|
|
28
|
+
- keep the default trust model local-first, deterministic, read-only, no code upload, and no LLM calls
|
|
29
|
+
- avoid claiming pentest, certification, full audit, or complete vulnerability discovery
|
|
30
|
+
|
|
5
31
|
## Public Position
|
|
6
32
|
|
|
7
33
|
`ai-saas-guard` is a local-first launch preflight for AI-built SaaS apps. It finds common production-readiness risks and produces concrete verification steps.
|
package/docs/project-handoff.md
CHANGED
|
@@ -23,6 +23,8 @@ Recent setup commits at the time this handoff was created:
|
|
|
23
23
|
|
|
24
24
|
`ai-saas-guard` is a local-first launch preflight CLI for AI-built SaaS apps.
|
|
25
25
|
|
|
26
|
+
North star: `ai-saas-guard` is the launch-risk middle layer between AI-generated SaaS code and real users. It translates AI-built SaaS code and AI-heavy PRs into a founder-readable, reviewer-ready launch gate. It is not a low-level static-analysis engine, a pentest, a certification, or a full security audit service.
|
|
27
|
+
|
|
26
28
|
The core user is a founder, solo builder, or reviewer shipping an AI-assisted SaaS MVP who needs to know what deserves human review before launch or merge.
|
|
27
29
|
|
|
28
30
|
The narrow product promise:
|
|
@@ -6,6 +6,8 @@ This is a synthetic, public-safe example of the kind of review queue `ai-saas-gu
|
|
|
6
6
|
ai-saas-guard scan summary
|
|
7
7
|
Findings: 6 findings: 0 critical, 3 high, 3 medium, 0 low, 0 info
|
|
8
8
|
Launch gate: review required: high-risk launch paths need manual verification before launch
|
|
9
|
+
Decision queue: Can a real user get access they should not have? Review auth, tenant ownership, Supabase RLS, webhook entitlement, and data mutation findings first.
|
|
10
|
+
Review trust-boundary findings before deploy/cost hygiene.
|
|
9
11
|
|
|
10
12
|
Top risks:
|
|
11
13
|
- HIGH stripe.webhook.missing-signature at app/api/stripe/webhook/route.ts:12 - Stripe webhook does not verify the Stripe signature
|
|
@@ -25,6 +27,12 @@ Full report:
|
|
|
25
27
|
Rerun without --summary, or use --json, --sarif, or --markdown where supported.
|
|
26
28
|
```
|
|
27
29
|
|
|
30
|
+
Markdown reports include the same decision queue plus:
|
|
31
|
+
|
|
32
|
+
- why auth, billing, tenant data, RLS, webhooks, and silent-success findings rank first
|
|
33
|
+
- a trust statement: local-first, deterministic, read-only, no code upload, no LLM calls
|
|
34
|
+
- a reviewer checklist for PR risk output
|
|
35
|
+
|
|
28
36
|
The full terminal report expands each finding:
|
|
29
37
|
|
|
30
38
|
```text
|
|
@@ -86,4 +94,4 @@ Start with the highest severity findings that touch trust-boundary code: auth, b
|
|
|
86
94
|
- Why could this fail for real users?
|
|
87
95
|
- What manual proof shows the path fails closed?
|
|
88
96
|
|
|
89
|
-
The report is a focused
|
|
97
|
+
The report is a focused launch decision queue. It does not replace your two-account authorization tests, Stripe webhook replay, deploy-preview checks, or human review.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# v0.36.0 Roadmap
|
|
2
|
+
|
|
3
|
+
This is the next practical release plan after v0.35.0. It keeps the product focused on a local-first launch gate for AI-built SaaS apps.
|
|
4
|
+
|
|
5
|
+
## Goals
|
|
6
|
+
|
|
7
|
+
- Make the first real scan easier to understand for a founder or reviewer.
|
|
8
|
+
- Improve report usefulness without turning the tool into a general pentest, certification, or CI analytics platform.
|
|
9
|
+
- Keep the CLI deterministic, local-first, read-only, and free of LLM calls.
|
|
10
|
+
|
|
11
|
+
## Planned Work
|
|
12
|
+
|
|
13
|
+
1. **Markdown report polish**
|
|
14
|
+
- Tighten the top summary, manual proof steps, and fix-direction wording.
|
|
15
|
+
- Make CI artifacts easier to read without opening JSON or SARIF.
|
|
16
|
+
|
|
17
|
+
2. **PR comment readiness**
|
|
18
|
+
- Prepare a compact PR summary format suitable for GitHub Action artifacts and future Check Runs.
|
|
19
|
+
- Keep it deterministic and file-evidence based.
|
|
20
|
+
|
|
21
|
+
3. **Risk sorting clarity**
|
|
22
|
+
- Explain why auth, billing, tenant data, webhook, RLS, and silent-success findings are ranked above cosmetic changes.
|
|
23
|
+
- Keep the ranking simple and inspectable.
|
|
24
|
+
|
|
25
|
+
4. **Fixture coverage**
|
|
26
|
+
- Expand the case-study fixture only where it demonstrates real launch-risk patterns.
|
|
27
|
+
- Keep positive and negative examples small enough to review quickly.
|
|
28
|
+
|
|
29
|
+
5. **Resource guardrails**
|
|
30
|
+
- Continue measuring large-repo scan limits, ignored directories, output size, and cleanup behavior.
|
|
31
|
+
- Avoid background services or persistent local processes for normal CLI use.
|
|
32
|
+
|
|
33
|
+
## Non-Goals
|
|
34
|
+
|
|
35
|
+
- No code upload.
|
|
36
|
+
- No LLM review.
|
|
37
|
+
- No hosted scanner claims until the hosted GitHub App path is fully gated and documented.
|
|
38
|
+
- No pentest, full audit, or certification positioning.
|
package/package.json
CHANGED