ai-saas-guard 0.24.0 → 0.26.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.
Files changed (45) hide show
  1. package/.bestpractices.json +138 -0
  2. package/CONTRIBUTING.md +74 -0
  3. package/README.md +36 -11
  4. package/README.zh-CN.md +41 -12
  5. package/action.yml +2 -2
  6. package/dist/cli.js +17 -5
  7. package/dist/commands/checkActions.d.ts +2 -0
  8. package/dist/commands/checkActions.js +4 -0
  9. package/dist/commands/checkMcp.d.ts +2 -2
  10. package/dist/commands/checkMcp.js +1 -1
  11. package/dist/commands/checkSupabase.d.ts +2 -2
  12. package/dist/commands/checkSupabase.js +1 -1
  13. package/dist/commands/scan.js +9 -3
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.js +1 -0
  16. package/dist/report/markdown.js +34 -0
  17. package/dist/report/terminal.js +40 -0
  18. package/dist/rules/catalog.js +182 -0
  19. package/dist/scanners/actions.d.ts +3 -0
  20. package/dist/scanners/actions.js +173 -0
  21. package/dist/scanners/deploy.js +146 -1
  22. package/dist/scanners/gitDiff.js +166 -1
  23. package/dist/scanners/mcp.d.ts +3 -1
  24. package/dist/scanners/mcp.js +122 -11
  25. package/dist/scanners/silentSuccess.d.ts +3 -0
  26. package/dist/scanners/silentSuccess.js +222 -0
  27. package/dist/scanners/supabase.d.ts +3 -1
  28. package/dist/scanners/supabase.js +171 -2
  29. package/dist/types.d.ts +31 -3
  30. package/docs/github-action.md +15 -1
  31. package/docs/github-app-deployment.md +10 -1
  32. package/docs/hosted-operations-evidence.md +43 -0
  33. package/docs/launch-readiness-checklist.md +23 -2
  34. package/docs/npm-publishing.md +4 -3
  35. package/docs/positioning.md +3 -2
  36. package/docs/project-handoff.md +22 -2
  37. package/docs/reddit-github-feasibility-report-2026-05-24.md +260 -0
  38. package/docs/reddit-market-knowledge-base-2026-05-24.md +40 -0
  39. package/docs/release-quality-knowledge-base.md +1 -1
  40. package/docs/repository-trust-hardening.md +53 -2
  41. package/docs/rules.md +42 -0
  42. package/hosted/cloudflare-worker/README.md +52 -0
  43. package/hosted/cloudflare-worker/src/index.js +908 -0
  44. package/hosted/cloudflare-worker/wrangler.jsonc +21 -0
  45. package/package.json +7 -2
@@ -0,0 +1,138 @@
1
+ {
2
+ "name": "ai-saas-guard",
3
+ "description": "Local-first launch preflight for AI-built SaaS repositories, focused on review-worthy auth, billing, data access, secrets, MCP, deploy, and pull request risks.",
4
+ "homepage_url": "https://github.com/zr9959/ai-saas-guard#readme",
5
+ "repo_url": "https://github.com/zr9959/ai-saas-guard",
6
+ "license": "MIT",
7
+ "implementation_languages": "TypeScript, JavaScript",
8
+ "description_good_status": "Met",
9
+ "description_good_justification": "The README opens with the problem ai-saas-guard solves for AI-built SaaS launch review: https://github.com/zr9959/ai-saas-guard#the-problem-it-solves",
10
+ "interact_status": "Met",
11
+ "interact_justification": "The README explains how to obtain and use the CLI, and GitHub issue templates plus CONTRIBUTING.md explain feedback and contribution paths: https://github.com/zr9959/ai-saas-guard#quick-start and https://github.com/zr9959/ai-saas-guard/blob/main/CONTRIBUTING.md",
12
+ "contribution_status": "Met",
13
+ "contribution_justification": "CONTRIBUTING.md documents the pull request process, tests, docs, release gate, and safety requirements: https://github.com/zr9959/ai-saas-guard/blob/main/CONTRIBUTING.md",
14
+ "contribution_requirements_status": "Met",
15
+ "contribution_requirements_justification": "CONTRIBUTING.md documents acceptable contribution requirements, including focused PRs, tests, fixtures, docs, release gate evidence, and public-safety constraints: https://github.com/zr9959/ai-saas-guard/blob/main/CONTRIBUTING.md",
16
+ "floss_license_status": "Met",
17
+ "floss_license_justification": "The project is released under the MIT license: https://github.com/zr9959/ai-saas-guard/blob/main/LICENSE",
18
+ "floss_license_osi_status": "Met",
19
+ "floss_license_osi_justification": "MIT is an OSI-approved open source license, and the repository declares MIT in LICENSE and package.json: https://github.com/zr9959/ai-saas-guard/blob/main/LICENSE",
20
+ "license_location_status": "Met",
21
+ "license_location_justification": "The license is in the top-level LICENSE file: https://github.com/zr9959/ai-saas-guard/blob/main/LICENSE",
22
+ "documentation_basics_status": "Met",
23
+ "documentation_basics_justification": "README.md and docs/ explain installation, commands, release quality, rules, GitHub Action use, and hosted design boundaries: https://github.com/zr9959/ai-saas-guard#quick-start",
24
+ "documentation_interface_status": "Met",
25
+ "documentation_interface_justification": "README.md documents CLI commands and outputs, while docs/github-action.md documents the GitHub Action interface: https://github.com/zr9959/ai-saas-guard#commands and https://github.com/zr9959/ai-saas-guard/blob/main/docs/github-action.md",
26
+ "sites_https_status": "Met",
27
+ "sites_https_justification": "The public repository, release assets, issue tracker, and npm package are served over HTTPS: https://github.com/zr9959/ai-saas-guard and https://www.npmjs.com/package/ai-saas-guard",
28
+ "discussion_status": "Met",
29
+ "discussion_justification": "The project uses GitHub Issues and pull requests for public discussion: https://github.com/zr9959/ai-saas-guard/issues",
30
+ "english_status": "Met",
31
+ "english_justification": "The default README, docs, issue templates, pull request template, and contribution guide are in English, and the repository also provides a Chinese README for Chinese users: https://github.com/zr9959/ai-saas-guard",
32
+ "maintained_status": "Met",
33
+ "maintained_justification": "The project is actively maintained with recent commits, releases, issue closure, and CI on main: https://github.com/zr9959/ai-saas-guard/commits/main",
34
+ "repo_public_status": "Met",
35
+ "repo_public_justification": "The source repository is public on GitHub: https://github.com/zr9959/ai-saas-guard",
36
+ "repo_track_status": "Met",
37
+ "repo_track_justification": "The repository uses git on GitHub, preserving source history, authorship, and timestamps: https://github.com/zr9959/ai-saas-guard/commits/main",
38
+ "repo_interim_status": "Met",
39
+ "repo_interim_justification": "Interim source history is public through normal git commits on main, not only final release snapshots: https://github.com/zr9959/ai-saas-guard/commits/main",
40
+ "repo_distributed_status": "Met",
41
+ "repo_distributed_justification": "The project uses git, a distributed version control system: https://github.com/zr9959/ai-saas-guard",
42
+ "version_unique_status": "Met",
43
+ "version_unique_justification": "Releases use unique npm versions and GitHub tags such as v0.24.0: https://github.com/zr9959/ai-saas-guard/releases and https://www.npmjs.com/package/ai-saas-guard",
44
+ "version_semver_status": "Met",
45
+ "version_semver_justification": "The npm package and GitHub tags use semantic versioning with vMAJOR.MINOR.PATCH tags: https://github.com/zr9959/ai-saas-guard/tags",
46
+ "version_tags_status": "Met",
47
+ "version_tags_justification": "GitHub release tags are used for versioned releases and Action consumption: https://github.com/zr9959/ai-saas-guard/tags",
48
+ "release_notes_status": "Met",
49
+ "release_notes_justification": "GitHub Releases provide release notes for published versions: https://github.com/zr9959/ai-saas-guard/releases",
50
+ "release_notes_vulns_status": "Met",
51
+ "release_notes_vulns_justification": "No public vulnerability fix releases are currently known; the release gate requires release notes and security impact notes for releases: https://github.com/zr9959/ai-saas-guard/blob/main/docs/release-quality-knowledge-base.md",
52
+ "report_process_status": "Met",
53
+ "report_process_justification": "GitHub issue templates and SECURITY.md explain how to report bugs, false positives, false negatives, rule requests, and security-sensitive issues: https://github.com/zr9959/ai-saas-guard/issues/new/choose and https://github.com/zr9959/ai-saas-guard/blob/main/SECURITY.md",
54
+ "report_tracker_status": "Met",
55
+ "report_tracker_justification": "The project uses GitHub Issues as the public issue tracker: https://github.com/zr9959/ai-saas-guard/issues",
56
+ "report_responses_status": "Met",
57
+ "report_responses_justification": "The current public issue set is closed or handled, and issue templates define the response channels: https://github.com/zr9959/ai-saas-guard/issues",
58
+ "enhancement_responses_status": "Met",
59
+ "enhancement_responses_justification": "Enhancement and roadmap issues are tracked and closed through GitHub Issues: https://github.com/zr9959/ai-saas-guard/issues?q=is%3Aissue+label%3Aenhancement",
60
+ "report_archive_status": "Met",
61
+ "report_archive_justification": "GitHub Issues preserves the public issue archive: https://github.com/zr9959/ai-saas-guard/issues?q=is%3Aissue",
62
+ "vulnerability_report_process_status": "Met",
63
+ "vulnerability_report_process_justification": "SECURITY.md describes when to use private vulnerability reporting and what public issues must not contain: https://github.com/zr9959/ai-saas-guard/blob/main/SECURITY.md",
64
+ "vulnerability_report_private_status": "Met",
65
+ "vulnerability_report_private_justification": "SECURITY.md points security-sensitive reports to GitHub private vulnerability reporting: https://github.com/zr9959/ai-saas-guard/blob/main/SECURITY.md",
66
+ "vulnerability_report_response_status": "N/A",
67
+ "vulnerability_report_response_justification": "No public vulnerability reports are currently known for this project; future security-sensitive reports are routed through GitHub private vulnerability reporting: https://github.com/zr9959/ai-saas-guard/blob/main/SECURITY.md",
68
+ "build_status": "Met",
69
+ "build_justification": "The project has a one-step build through npm scripts: npm run build: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
70
+ "build_common_tools_status": "Met",
71
+ "build_common_tools_justification": "The project uses common Node.js, npm, and TypeScript tooling: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
72
+ "build_floss_tools_status": "Met",
73
+ "build_floss_tools_justification": "The build uses FLOSS Node.js, npm, and TypeScript tooling declared in package.json: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
74
+ "test_status": "Met",
75
+ "test_justification": "The automated test suite is run by npm test: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
76
+ "test_invocation_status": "Met",
77
+ "test_invocation_justification": "npm test builds the project and runs Node tests, and npm run test:fuzz runs the fast-check fuzz/property suite: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
78
+ "test_continuous_integration_status": "Met",
79
+ "test_continuous_integration_justification": "GitHub Actions runs CI on pull requests and pushes to main: https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/ci.yml",
80
+ "test_policy_status": "Met",
81
+ "test_policy_justification": "CONTRIBUTING.md requires tests for behavior changes and vulnerable plus safe fixtures for scanner rules: https://github.com/zr9959/ai-saas-guard/blob/main/CONTRIBUTING.md",
82
+ "tests_are_added_status": "Met",
83
+ "tests_are_added_justification": "The repository contains tests for scanner behavior, hosted contracts, GitHub Action behavior, docs guards, and fuzz/property checks: https://github.com/zr9959/ai-saas-guard/tree/main/tests",
84
+ "tests_documented_added_status": "Met",
85
+ "tests_documented_added_justification": "CONTRIBUTING.md documents when tests and fixtures must be added: https://github.com/zr9959/ai-saas-guard/blob/main/CONTRIBUTING.md",
86
+ "warnings_status": "Met",
87
+ "warnings_justification": "TypeScript strict mode is enabled and CI runs workflow static checks through actionlint and zizmor: https://github.com/zr9959/ai-saas-guard/blob/main/tsconfig.json and https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/ci.yml",
88
+ "warnings_fixed_status": "Met",
89
+ "warnings_fixed_justification": "The release gate requires a clean build, test suite, workflow checks, self-scan, dependency audit, and package inspection before public release: https://github.com/zr9959/ai-saas-guard/blob/main/docs/release-quality-knowledge-base.md",
90
+ "warnings_strict_status": "Met",
91
+ "warnings_strict_justification": "TypeScript strict mode is enabled in tsconfig.json, and CI includes actionlint plus zizmor for workflow quality and security checks: https://github.com/zr9959/ai-saas-guard/blob/main/tsconfig.json",
92
+ "know_secure_design_status": "Met",
93
+ "know_secure_design_justification": "The docs and rule catalog document secure design concerns for auth, billing, data access, secrets, MCP, hosted privacy, webhook verification, and release gating: https://github.com/zr9959/ai-saas-guard/blob/main/docs/rules.md and https://github.com/zr9959/ai-saas-guard/blob/main/docs/github-app-design.md",
94
+ "know_common_errors_status": "Met",
95
+ "know_common_errors_justification": "The project focuses on common SaaS launch errors such as missing ownership checks, unsafe Stripe webhooks, broad Supabase policies, secret exposure, unsafe MCP tools, and risky deploy settings: https://github.com/zr9959/ai-saas-guard/blob/main/docs/rules.md",
96
+ "crypto_published_status": "Met",
97
+ "crypto_published_justification": "Hosted helper code uses documented GitHub App RS256 JWT signing and HMAC SHA-256 webhook verification patterns rather than custom cryptography: https://github.com/zr9959/ai-saas-guard/blob/main/src/hosted/production-adapters.ts and https://github.com/zr9959/ai-saas-guard/blob/main/src/hosted/contracts.ts",
98
+ "crypto_call_status": "Met",
99
+ "crypto_call_justification": "Cryptographic operations use Node.js standard crypto APIs and GitHub-documented algorithms for GitHub App JWTs and webhook verification: https://github.com/zr9959/ai-saas-guard/blob/main/src/hosted/production-adapters.ts and https://github.com/zr9959/ai-saas-guard/blob/main/src/hosted/contracts.ts",
100
+ "crypto_floss_status": "Met",
101
+ "crypto_floss_justification": "The project uses FLOSS Node.js runtime cryptography through standard APIs: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
102
+ "crypto_keylength_status": "Met",
103
+ "crypto_keylength_justification": "The hosted design relies on GitHub App private-key material generated and managed for GitHub App authentication and does not define custom key sizes or algorithms: https://github.com/zr9959/ai-saas-guard/blob/main/docs/github-app-design.md",
104
+ "crypto_working_status": "Met",
105
+ "crypto_working_justification": "The project uses current GitHub App RS256 JWT signing and HMAC SHA-256 webhook verification mechanisms, not obsolete custom algorithms: https://github.com/zr9959/ai-saas-guard/blob/main/docs/github-app-design.md",
106
+ "crypto_weaknesses_status": "Met",
107
+ "crypto_weaknesses_justification": "The project does not use intentionally weak algorithms such as MD5 or SHA-1 for security decisions; hosted verification uses HMAC SHA-256 and JWT signing uses RS256: https://github.com/zr9959/ai-saas-guard/blob/main/src/hosted/contracts.ts",
108
+ "crypto_pfs_status": "N/A",
109
+ "crypto_pfs_justification": "The local CLI does not implement TLS transport; public distribution is through HTTPS GitHub and npm endpoints: https://github.com/zr9959/ai-saas-guard",
110
+ "crypto_password_storage_status": "N/A",
111
+ "crypto_password_storage_justification": "The local CLI and hosted helper contracts do not store user passwords: https://github.com/zr9959/ai-saas-guard#privacy-model",
112
+ "crypto_random_status": "N/A",
113
+ "crypto_random_justification": "The project does not generate cryptographic random values for security decisions in the local CLI: https://github.com/zr9959/ai-saas-guard",
114
+ "delivery_mitm_status": "Met",
115
+ "delivery_mitm_justification": "Source, releases, and npm package distribution use HTTPS endpoints: https://github.com/zr9959/ai-saas-guard/releases and https://www.npmjs.com/package/ai-saas-guard",
116
+ "delivery_unsigned_status": "Met",
117
+ "delivery_unsigned_justification": "GitHub releases attach npm provenance-backed tarballs plus sigstore and in-toto provenance assets, and npm trusted publishing provides provenance: https://github.com/zr9959/ai-saas-guard/releases and https://github.com/zr9959/ai-saas-guard/blob/main/docs/repository-trust-hardening.md",
118
+ "vulnerabilities_fixed_60_days_status": "Met",
119
+ "vulnerabilities_fixed_60_days_justification": "No unresolved high or critical production dependency vulnerabilities are currently known; the release gate requires npm audit at high severity or above: https://github.com/zr9959/ai-saas-guard/blob/main/docs/release-quality-knowledge-base.md",
120
+ "vulnerabilities_critical_fixed_status": "Met",
121
+ "vulnerabilities_critical_fixed_justification": "No unresolved critical vulnerabilities are currently known; SECURITY.md and the release gate define the response and release evidence path: https://github.com/zr9959/ai-saas-guard/blob/main/SECURITY.md",
122
+ "no_leaked_credentials_status": "Met",
123
+ "no_leaked_credentials_justification": "The repository has secret scanning and push protection enabled, uses inert fixtures, and the release gate forbids real credentials: https://github.com/zr9959/ai-saas-guard/blob/main/docs/repository-trust-hardening.md",
124
+ "static_analysis_status": "Met",
125
+ "static_analysis_justification": "The repository runs CodeQL SAST and workflow static checks with actionlint and zizmor: https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/codeql.yml and https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/ci.yml",
126
+ "static_analysis_common_vulnerabilities_status": "Met",
127
+ "static_analysis_common_vulnerabilities_justification": "CodeQL analyzes JavaScript and TypeScript for common vulnerability patterns, and ai-saas-guard self-scan checks SaaS launch-specific risks: https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/codeql.yml",
128
+ "static_analysis_fixed_status": "Met",
129
+ "static_analysis_fixed_justification": "The release gate requires CI, CodeQL, actionlint, zizmor, self-scan, dependency audit, and issue tracking for findings before release: https://github.com/zr9959/ai-saas-guard/blob/main/docs/release-quality-knowledge-base.md",
130
+ "static_analysis_often_status": "Met",
131
+ "static_analysis_often_justification": "CodeQL runs on pull requests, pushes to main, and a weekly schedule; CI workflow checks run on pull requests and pushes to main: https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/codeql.yml",
132
+ "dynamic_analysis_status": "Met",
133
+ "dynamic_analysis_justification": "The project uses fast-check fuzz/property tests for attacker-controlled markdown, SARIF, and redaction paths: https://github.com/zr9959/ai-saas-guard/blob/main/tests/fuzz.test.js",
134
+ "dynamic_analysis_unsafe_status": "N/A",
135
+ "dynamic_analysis_unsafe_justification": "The project is implemented in TypeScript and JavaScript rather than memory-unsafe C or C++: https://github.com/zr9959/ai-saas-guard/blob/main/package.json",
136
+ "dynamic_analysis_fixed_status": "Met",
137
+ "dynamic_analysis_fixed_justification": "The fuzz/property tests are part of CI and the release gate requires tests to pass before release: https://github.com/zr9959/ai-saas-guard/blob/main/.github/workflows/ci.yml"
138
+ }
@@ -0,0 +1,74 @@
1
+ # Contributing
2
+
3
+ `ai-saas-guard` is a local-first launch preflight CLI for AI-built SaaS repositories. Contributions should keep that promise narrow: find review-worthy launch risks, show evidence, and avoid broad security claims.
4
+
5
+ ## Pull Request Process
6
+
7
+ 1. Open an issue or comment on an existing issue before large feature work.
8
+ 2. Keep pull requests focused. Separate scanner behavior, docs, workflow changes, and release work when practical.
9
+ 3. Include tests for behavior changes. New scanner rules need a vulnerable fixture, a safe fixture, and assertions for both.
10
+ 4. Update documentation when behavior, commands, outputs, or release expectations change. If `README.md` changes, review and update `README.zh-CN.md` in the same pull request.
11
+ 5. Fill out the pull request template with release gate evidence and known limitations.
12
+
13
+ ## Local Development
14
+
15
+ ```bash
16
+ npm ci
17
+ npm test
18
+ npm run build
19
+ node dist/cli.js --help
20
+ node dist/cli.js scan --root . --json
21
+ ```
22
+
23
+ For release candidates or public repository changes, follow [docs/release-quality-knowledge-base.md](docs/release-quality-knowledge-base.md). The release gate is the source of truth for required checks, packaging inspection, dependency audit, self-scan evidence, and rollback notes.
24
+
25
+ ## Testing Expectations
26
+
27
+ - Run `npm test` before sending a pull request.
28
+ - Run `npm run test:fuzz` when changing markdown rendering, SARIF rendering, secret redaction, parser behavior, or other attacker-controlled text handling.
29
+ - Keep fixtures public-safe and minimal.
30
+ - Prefer deterministic tests over live external services.
31
+ - Do not remove or weaken tests without explaining the review and replacement coverage.
32
+
33
+ ## Rule Design
34
+
35
+ Scanner rules should be evidence-first:
36
+
37
+ - stable rule ID
38
+ - severity
39
+ - file/path evidence
40
+ - why the issue matters for a SaaS launch
41
+ - suggested manual verification
42
+ - practical fix direction
43
+ - vulnerable fixture
44
+ - safe fixture
45
+ - public rule documentation
46
+
47
+ Avoid turning the project into a generic SAST platform. The useful surface is AI-SaaS launch readiness: auth, billing, data access, secrets, MCP tools, deploy configuration, and risky pull request diffs.
48
+
49
+ ## Security And Public Safety
50
+
51
+ - No real API keys, tokens, cookies, webhook signing secrets, database URLs, customer data, private source code, or private URLs.
52
+ - Use inert fake values in fixtures and examples.
53
+ - Do not add network calls to local scan commands unless a future feature is explicitly designed, documented, and tested as opt-in.
54
+ - Do not add shell execution to scan commands unless it is explicit, narrow, and separately reviewed.
55
+ - Public issues must stay safe to read. Use GitHub private vulnerability reporting for sensitive vulnerability details.
56
+
57
+ ## Coding Standards
58
+
59
+ - Keep TypeScript strict and readable.
60
+ - Prefer small, focused helpers over broad abstractions.
61
+ - Keep CLI output useful for human reviewers and machine output parseable.
62
+ - Redact secret-like evidence.
63
+ - Bound resource use for repository scanning.
64
+ - Keep GitHub Actions permissions minimal and avoid untrusted input interpolation in shell scripts.
65
+
66
+ ## Feedback Channels
67
+
68
+ Use GitHub issues for bugs, false positives, false negatives, and rule requests:
69
+
70
+ https://github.com/zr9959/ai-saas-guard/issues
71
+
72
+ Use private vulnerability reporting for security-sensitive reports:
73
+
74
+ https://github.com/zr9959/ai-saas-guard/security/advisories/new
package/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
 
19
19
  <p align="center">
20
20
  <a href="https://github.com/zr9959/ai-saas-guard/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/zr9959/ai-saas-guard/actions/workflows/ci.yml/badge.svg"></a>
21
+ <a href="https://www.bestpractices.dev/projects/12955"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/12955/badge"></a>
21
22
  <a href="https://www.npmjs.com/package/ai-saas-guard"><img alt="npm" src="https://img.shields.io/npm/v/ai-saas-guard.svg"></a>
22
23
  <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
23
24
  <a href="package.json"><img alt="Node.js >=20" src="https://img.shields.io/badge/node-%3E%3D20-339933.svg"></a>
@@ -36,6 +37,8 @@ The risky parts are often not the obvious UI bugs. They are the small changes th
36
37
  - Can a Stripe webhook grant access twice, miss a failed payment, or trust an unsigned request?
37
38
  - Did a public environment variable expose a secret?
38
39
  - Did an MCP tool get shell, database, or broad filesystem access?
40
+ - Did AI-generated error handling return fake success or demo data after a real provider failed?
41
+ - Will the Next/Vercel deploy have the headers, env docs, logging, and request behavior needed for launch?
39
42
  - Did a pull request hide auth, billing, or deploy changes inside a large AI-generated diff?
40
43
 
41
44
  `ai-saas-guard` is a local-first, review-first preflight for that moment. It does not try to prove your app is secure. It is not a pentest, certification, or full audit. It gives founders, solo builders, small teams, and reviewers a short, evidence-backed list of what to check before launch or merge.
@@ -73,15 +76,20 @@ The CLI is published on npm as `ai-saas-guard`, and the GitHub Action is availab
73
76
  | JSON and SARIF output | Available |
74
77
  | Composite GitHub Action | Available |
75
78
  | Project config | `.ai-saas-guard.json` rule toggles, severity overrides, and fail thresholds |
76
- | Versioned Action tags | `v0.24.0`, `v0` |
77
- | npm package | `ai-saas-guard@0.24.0` |
79
+ | Versioned Action tags | `v0.26.0`, `v0` |
80
+ | npm package | `ai-saas-guard@0.26.0` |
81
+ | Current release | `0.26.0` launch-risk expansion |
78
82
  | npm publishing | Trusted Publisher/OIDC, no long-lived publish token |
79
- | Repository trust hardening | Branch protection, Dependabot, CodeQL, private vulnerability reporting, secret scanning, and push protection |
80
- | Runtime hardening | Per-file and total text scan caps, escaped markdown evidence, stricter hosted deployment blockers |
83
+ | Repository trust hardening | Strict branch protection, Dependabot, CodeQL, fast-check fuzzing, signed release provenance assets, private vulnerability reporting, secret scanning, and push protection |
84
+ | Runtime hardening | Per-file and total text scan caps, escaped markdown evidence, 1 MiB hosted webhook payload cap, stricter hosted deployment blockers |
81
85
  | Hosted production adapters | GitHub App JWT signing, installation-token request planning, bounded worker execution, and terminal-state cleanup planning |
82
86
  | Hosted app skeleton | Node/container HTTP ingress, health route, worker tick, in-memory provider adapters, and deployment plan validation |
83
87
  | Hosted staging deployment planner | Provider binding, staging release-gate evidence, Node/container deployment composition, and GitHub App promotion gating |
84
88
  | Hosted staging harness | File-backed webhook replay, queue/report/Check Run artifacts, worker cleanup verification, and local release-gate evidence fixtures |
89
+ | Cloudflare hosted ingress | Deployed at `https://ai-saas-guard-hosted.zr9959.workers.dev`; Worker health and Check Run publisher configuration are live, but end-to-end GitHub App webhook delivery is still blocked pending private App settings verification |
90
+ | Hosted operations evidence | Recorded in [docs/hosted-operations-evidence.md](docs/hosted-operations-evidence.md) |
91
+ | Hosted GitHub App staging | Private App `ai-saas-guard-hosted` (`3834787`) installed on `zr9959/ai-saas-guard` with contents read, pull requests read, metadata read, and checks write |
92
+ | OpenSSF Best Practices | Passing badge, project `12955`; `.bestpractices.json` remains the conservative evidence record |
85
93
 
86
94
  ## Quick Start
87
95
 
@@ -96,8 +104,11 @@ Run focused checks:
96
104
  ```bash
97
105
  npx ai-saas-guard@latest pr-risk --root /path/to/your-saas --base origin/main
98
106
  npx ai-saas-guard@latest check-supabase --root /path/to/your-saas
107
+ npx ai-saas-guard@latest check-supabase --root /path/to/your-saas --doctor
99
108
  npx ai-saas-guard@latest check-stripe --root /path/to/your-saas
100
109
  npx ai-saas-guard@latest check-mcp --root /path/to/your-saas
110
+ npx ai-saas-guard@latest check-mcp --root /path/to/your-saas --policy-template
111
+ npx ai-saas-guard@latest check-actions --root /path/to/your-saas
101
112
  ```
102
113
 
103
114
  Machine-readable output:
@@ -127,6 +138,7 @@ node dist/cli.js pr-risk --root /path/to/your-saas --base origin/main
127
138
  node dist/cli.js check-supabase --root /path/to/your-saas
128
139
  node dist/cli.js check-stripe --root /path/to/your-saas
129
140
  node dist/cli.js check-mcp --root /path/to/your-saas
141
+ node dist/cli.js check-actions --root /path/to/your-saas
130
142
  ```
131
143
 
132
144
  ## Example Finding
@@ -150,10 +162,12 @@ Evidence:
150
162
  | Secrets and env | Secret-like values, risky `NEXT_PUBLIC_*` exposure |
151
163
  | Stripe | Missing webhook route, unsigned webhook handling, parsed-body signature risk, missing idempotency, missing failure/cancel/update/refund paths |
152
164
  | Supabase | RLS disabled on sensitive tables, broad `USING`/`WITH CHECK`, tenant membership patterns, weak write checks, storage object policy scope |
165
+ | Silent success | Swallowed provider errors, hardcoded fallback success, production mock/demo data in sensitive paths, temporary trust-boundary bypasses, skipped or placeholder tests |
153
166
  | API routes | Auth checks without obvious ownership guards, missing rate-limit hints on sensitive mutation routes |
154
- | MCP | Plaintext secrets, non-localhost binds, broad filesystem/write access, shell tools, raw SQL tools |
155
- | Deploy config | Next static export/runtime mismatches, Edge runtime with Node-only APIs, missing important env documentation |
156
- | PR risk | Auth, billing, RLS, env, deploy, API, storage, test-removal, and large mixed-diff classification |
167
+ | MCP | Plaintext secrets, non-localhost binds, broad filesystem/write access, shell tools, raw SQL tools, side-effect classification, local policy and receipt template |
168
+ | Next/Vercel deploy | Static export/runtime mismatches, Edge runtime with Node-only APIs, missing security headers, undocumented server env, public env inventory, image/request amplification hints, missing request ID logging |
169
+ | GitHub Actions | Broad workflow permissions, stale PR runs, docs-only full CI, missing fail-fast secret checks, shallow `pr-risk` checkout, unpinned Action refs |
170
+ | PR risk | Auth, billing, RLS, env, deploy, API, storage, silent-success, test-removal, missing spec context, and large mixed-diff classification |
157
171
 
158
172
  See [docs/rules.md](docs/rules.md) for the full rule map.
159
173
 
@@ -194,9 +208,10 @@ If `--base` cannot be resolved, `pr-risk` emits `pr-risk.diff-unavailable` inste
194
208
  | --- | --- |
195
209
  | `scan` | Broad local launch preflight across secrets, Stripe, Supabase, MCP, API routes, and deploy config |
196
210
  | `pr-risk` | Classify the current git diff or a base branch diff for review priority; supports JSON, SARIF, and PR-focused markdown |
197
- | `check-supabase` | Inspect migrations and policy files for RLS and ownership risks |
211
+ | `check-supabase` | Inspect migrations and policy files for RLS and ownership risks; use `--doctor` for static RLS debugging steps and SQL cookbook output |
198
212
  | `check-stripe` | Inspect webhook handlers and billing lifecycle coverage |
199
- | `check-mcp` | Inventory MCP configs and classify side effects |
213
+ | `check-mcp` | Inventory MCP configs and classify side effects; use `--policy-template` for a local allow/deny policy and tool-call receipt format |
214
+ | `check-actions` | Inspect GitHub Actions hygiene that affects AI-built SaaS launch readiness |
200
215
 
201
216
  ## Launch Readiness Checklist
202
217
 
@@ -204,7 +219,13 @@ Use [docs/launch-readiness-checklist.md](docs/launch-readiness-checklist.md) whe
204
219
 
205
220
  ## Repository Trust Hardening
206
221
 
207
- See [docs/repository-trust-hardening.md](docs/repository-trust-hardening.md) for the public repository controls behind this release line: branch protection, required CI checks, Dependabot for npm and GitHub Actions, CodeQL SAST, private vulnerability reporting, secret scanning, and push protection.
222
+ See [docs/repository-trust-hardening.md](docs/repository-trust-hardening.md) for the public repository controls behind this release line: strict branch protection, required CI checks, Dependabot for npm and GitHub Actions, CodeQL SAST, fast-check fuzz/property tests, signed GitHub release assets backed by npm trusted publishing provenance, private vulnerability reporting, secret scanning, and push protection.
223
+
224
+ The latest GitHub releases mirror the npm package tarball and attach `*.tgz.sigstore.json` plus `*.tgz.intoto.jsonl` provenance assets. These assets are generated from npm provenance, with the tarball digest checked against the npm registry metadata before upload.
225
+
226
+ The current Scorecard improvement track focuses on real controls, not cosmetic score gaming: stricter review gates, detectable fuzzing, and the OpenSSF Best Practices Badge process. Some Scorecard items, such as repository age, contributor diversity, and reviewed PR history, improve only through time and normal public maintenance.
227
+
228
+ The repository now has an [OpenSSF Best Practices passing badge](https://www.bestpractices.dev/projects/12955). [.bestpractices.json](.bestpractices.json) remains the conservative evidence record for the public project entry. `dynamic_analysis_enable_assertions` is still intentionally marked unmet until runtime assertion coverage is broader than the current test, property, and fuzz assertions.
208
229
 
209
230
  ## Stripe Webhook Replay
210
231
 
@@ -230,6 +251,8 @@ The hosted staging deployment planner is documented in [docs/hosted-staging-depl
230
251
 
231
252
  The hosted staging harness is documented in [docs/hosted-staging-harness.md](docs/hosted-staging-harness.md). It exports `createFileBackedHostedStagingHarness` and `createHostedStagingHarnessEvidence` from `ai-saas-guard/hosted/staging-harness`. It runs signed webhook replay through the provider-independent hosted runtime with local file-backed queue, compact report, and Check Run adapters, then verifies worker sandbox cleanup. It is a staging rehearsal tool only; it does not call cloud providers, create a GitHub App, publish live Check Runs, or expose a public hosted service.
232
253
 
254
+ The first live hosted ingress is deployed on Cloudflare Workers at `https://ai-saas-guard-hosted.zr9959.workers.dev` and documented in [hosted/cloudflare-worker/README.md](hosted/cloudflare-worker/README.md). It exposes `/healthz`, `/github/app/manifest-callback`, and signed `/github/webhook` intake backed by Cloudflare KV. A private staging GitHub App, `ai-saas-guard-hosted`, is installed on `zr9959/ai-saas-guard` with selected-repository access and the first-slice permission contract. The Worker can verify signatures, store compact pull request identity records, exchange a scoped installation token, fetch PR file metadata from GitHub, classify PR-risk hotspots, and publish a bounded Check Run summary. Current deployed evidence is tracked in [docs/hosted-operations-evidence.md](docs/hosted-operations-evidence.md): health and Check Run publisher configuration pass, but end-to-end GitHub App webhook delivery is still blocked until the private App webhook settings are verified. It still does not run a full source checkout scan worker or store raw webhook payloads, PR title/body text, raw diffs, source, secrets, checkout paths, or installation tokens.
255
+
233
256
  The hosted operational release gate is documented in [docs/hosted-operational-release-gate.md](docs/hosted-operational-release-gate.md). It defines the hosted-specific CI, replay, queue, worker cleanup, privacy, monitoring, rollback, and incident-response evidence required before any hosted environment is exposed to users. The pure gate evaluator exported from `ai-saas-guard/hosted/contracts` blocks hosted exposure unless every P0 evidence item is fresh, a container digest is recorded, and release notes avoid pentest, certification, and full-audit claims.
234
257
 
235
258
  Hosted uninstall and data deletion behavior is documented in [docs/hosted-uninstall-data-deletion.md](docs/hosted-uninstall-data-deletion.md). It defines repository removal, full app uninstall, compact report deletion, queue cancellation, audit record retention, repeated cleanup, and user-facing deletion wording.
@@ -276,7 +299,7 @@ Use `suppressions` for narrower false-positive handling when one rule is noisy o
276
299
 
277
300
  ## GitHub Action
278
301
 
279
- The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.24.0` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
302
+ The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.26.0` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
280
303
 
281
304
  ```yaml
282
305
  name: ai-saas-guard
@@ -393,6 +416,8 @@ node dist/cli.js scan --root .
393
416
 
394
417
  Before publishing a CLI update, GitHub Action update, npm package, plugin, or public repository change, follow [docs/release-quality-knowledge-base.md](docs/release-quality-knowledge-base.md).
395
418
 
419
+ Contribution expectations are documented in [CONTRIBUTING.md](CONTRIBUTING.md), including pull request process, tests, rule-design requirements, release gate evidence, and public-safety constraints.
420
+
396
421
  ## Roadmap
397
422
 
398
423
  Open-source core:
package/README.zh-CN.md CHANGED
@@ -16,6 +16,14 @@
16
16
  <a href="README.md">English README</a> | 中文
17
17
  </p>
18
18
 
19
+ <p align="center">
20
+ <a href="https://github.com/zr9959/ai-saas-guard/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/zr9959/ai-saas-guard/actions/workflows/ci.yml/badge.svg"></a>
21
+ <a href="https://www.bestpractices.dev/projects/12955"><img alt="OpenSSF Best Practices" src="https://www.bestpractices.dev/projects/12955/badge"></a>
22
+ <a href="https://www.npmjs.com/package/ai-saas-guard"><img alt="npm" src="https://img.shields.io/npm/v/ai-saas-guard.svg"></a>
23
+ <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
24
+ <a href="package.json"><img alt="Node.js >=20" src="https://img.shields.io/badge/node-%3E%3D20-339933.svg"></a>
25
+ </p>
26
+
19
27
  ---
20
28
 
21
29
  ## 它解决什么问题
@@ -28,6 +36,8 @@ AI 能很快把一个 SaaS 从想法做成可运行的产品。真正难的是
28
36
  - Stripe webhook 会不会重复开通权限、漏处理付款失败,或者信任未签名请求?
29
37
  - `NEXT_PUBLIC_*` 里是不是不小心暴露了 secret?
30
38
  - MCP 工具是不是拿到了 shell、数据库或过宽的文件系统权限?
39
+ - AI 生成的错误处理会不会在真实服务失败后仍然返回“成功”或 demo 数据?
40
+ - Next/Vercel 上线前是不是缺 security headers、env 文档、请求日志或高请求量风险提示?
31
41
  - AI 生成的大 PR 里,是不是把 auth、billing 或 deploy 改动藏在 UI 调整中?
32
42
 
33
43
  `ai-saas-guard` 是面向这个时刻的本地优先、review-first 上线预检工具。它不会证明你的应用绝对安全,也不是渗透测试、认证或完整安全审计。它的目标是给 founder、独立开发者、小团队和 reviewer 一份短而有证据的清单,告诉你上线或合并 PR 前最该先看哪里。
@@ -55,7 +65,7 @@ AI 能很快把一个 SaaS 从想法做成可运行的产品。真正难的是
55
65
 
56
66
  这个仓库是公开 GitHub 仓库。
57
67
 
58
- CLI 已发布到 npm:`ai-saas-guard@0.24.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.24.0`。
68
+ CLI 已发布到 npm:`ai-saas-guard@0.26.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.26.0`。
59
69
 
60
70
  | 模块 | 状态 |
61
71
  | --- | --- |
@@ -66,15 +76,19 @@ CLI 已发布到 npm:`ai-saas-guard@0.24.0`。GitHub Action 支持 `v0` 浮动
66
76
  | Markdown PR summary | 已可用 |
67
77
  | GitHub Action | 已可用 |
68
78
  | 项目配置 | `.ai-saas-guard.json` 支持规则开关、severity 覆盖和 fail threshold |
69
- | 当前版本 | `0.24.0` |
70
- | Action 标签 | `v0.24.0`、`v0` |
79
+ | 当前版本 | `0.26.0` launch-risk expansion |
80
+ | Action 标签 | `v0.26.0`、`v0` |
71
81
  | npm 发布 | GitHub Actions Trusted Publisher/OIDC,无需长期 npm token |
72
- | 仓库可信度加固 | branch protection、Dependabot、CodeQL、private vulnerability reporting、secret scanning 和 push protection |
73
- | 运行时加固 | 单文件和总扫描文本预算、markdown evidence 转义、更严格的 hosted deployment 阻断 |
82
+ | 仓库可信度加固 | 严格 branch protection、Dependabot、CodeQL、fast-check fuzzing、signed release provenance assets、private vulnerability reporting、secret scanning 和 push protection |
83
+ | 运行时加固 | 单文件和总扫描文本预算、markdown evidence 转义、1 MiB hosted webhook payload 上限、更严格的 hosted deployment 阻断 |
74
84
  | Hosted production adapters | GitHub App JWT 签名、installation-token 请求规划、有边界的 worker 执行和终态 cleanup 规划 |
75
85
  | Hosted app skeleton | Node/container HTTP ingress、health route、worker tick、in-memory provider adapters 和 deployment plan 校验 |
76
86
  | Hosted staging deployment planner | provider binding、staging release-gate evidence、Node/container deployment 组合和 GitHub App promotion gating |
77
87
  | Hosted staging harness | 本地 file-backed webhook replay、queue/report/Check Run artifact、worker cleanup 校验和 release-gate evidence fixture |
88
+ | Cloudflare hosted ingress | 已部署到 `https://ai-saas-guard-hosted.zr9959.workers.dev`;Worker health 和 Check Run publisher 配置已在线,但端到端 GitHub App webhook delivery 仍需要验证私有 App 设置 |
89
+ | Hosted operations evidence | 已记录在 [docs/hosted-operations-evidence.md](docs/hosted-operations-evidence.md) |
90
+ | Hosted GitHub App staging | 私有 App `ai-saas-guard-hosted`(`3834787`)已安装到 `zr9959/ai-saas-guard`,权限为 contents read、pull requests read、metadata read、checks write |
91
+ | OpenSSF Best Practices | 已获得 passing badge,项目 `12955`;`.bestpractices.json` 继续作为保守证据记录 |
78
92
 
79
93
  ## 快速开始
80
94
 
@@ -89,8 +103,11 @@ npx ai-saas-guard@latest scan --root /path/to/your-saas
89
103
  ```bash
90
104
  npx ai-saas-guard@latest pr-risk --root /path/to/your-saas --base origin/main
91
105
  npx ai-saas-guard@latest check-supabase --root /path/to/your-saas
106
+ npx ai-saas-guard@latest check-supabase --root /path/to/your-saas --doctor
92
107
  npx ai-saas-guard@latest check-stripe --root /path/to/your-saas
93
108
  npx ai-saas-guard@latest check-mcp --root /path/to/your-saas
109
+ npx ai-saas-guard@latest check-mcp --root /path/to/your-saas --policy-template
110
+ npx ai-saas-guard@latest check-actions --root /path/to/your-saas
94
111
  ```
95
112
 
96
113
  机器可读输出:
@@ -117,9 +134,10 @@ node dist/cli.js scan --root /path/to/your-saas
117
134
  | --- | --- |
118
135
  | `scan` | 对 secrets、Stripe、Supabase、MCP、API routes、deploy config 做整体上线预检 |
119
136
  | `pr-risk` | 分析当前 git diff 或指定 base branch diff,判断哪些文件和风险面应该先 review |
120
- | `check-supabase` | 检查 migration 和 policy 文件里的 RLS、ownership、storage policy 风险 |
137
+ | `check-supabase` | 检查 migration 和 policy 文件里的 RLS、ownership、storage policy 风险;`--doctor` 输出静态 RLS 调试步骤和 SQL cookbook |
121
138
  | `check-stripe` | 检查 webhook 签名、raw body、幂等、订阅生命周期和 entitlement 更新路径 |
122
- | `check-mcp` | 检查 MCP 配置里的 secret、非 localhost 绑定、shell/db/filesystem 等副作用 |
139
+ | `check-mcp` | 检查 MCP 配置里的 secret、非 localhost 绑定、shell/db/filesystem 等副作用;`--policy-template` 输出本地 allow/deny policy 和 tool-call receipt 格式 |
140
+ | `check-actions` | 检查和 AI-built SaaS 上线有关的 GitHub Actions hygiene |
123
141
 
124
142
  ## 它会检查什么
125
143
 
@@ -128,16 +146,24 @@ node dist/cli.js scan --root /path/to/your-saas
128
146
  | Secrets 和 env | 类似密钥的字符串、危险的 `NEXT_PUBLIC_*` 暴露 |
129
147
  | Stripe | webhook 缺失、未验证签名、raw body 签名风险、缺幂等、缺失败/取消/退款/更新处理 |
130
148
  | Supabase | 敏感表没启用 RLS、policy 过宽、缺少 ownership filter、`WITH CHECK` 过弱、storage object policy 过宽 |
149
+ | Silent success | 捕获错误后返回假成功、敏感路径里的 hardcoded fallback、production 路径引入 mock/demo data、临时绕过 auth/webhook/ownership、跳过或占位测试 |
131
150
  | API routes | 有 auth 但缺少明显 ownership guard,敏感 mutation route 缺少 rate-limit 提示 |
132
- | MCP | 明文 secret、非 localhost 绑定、过宽文件系统权限、shell 工具、raw SQL 工具 |
133
- | Deploy config | Next static export 和 API route 冲突、Edge runtime 使用 Node-only API、关键 env 文档缺失 |
134
- | PR risk | authbillingRLS、env、deploy、API、storage、测试删除、大型混合 diff |
151
+ | MCP | 明文 secret、非 localhost 绑定、过宽文件系统权限、shell 工具、raw SQL 工具、side-effect 分类、本地 policy/receipt 模板 |
152
+ | Next/Vercel deploy | Next static export 和 API route 冲突、Edge runtime 使用 Node-only API、security headers 缺失、server env 文档缺失、public env 盘点、image/request 放大风险、request ID logging 缺失 |
153
+ | GitHub Actions | workflow 权限过宽、PR workflow 缺 concurrency canceldocs-only 改动跑全量 CIsecret/tool version 缺 fail-fast、`pr-risk` checkout 太浅、Action 未 pin SHA |
154
+ | PR risk | auth、billing、RLS、env、deploy、API、storage、silent-success、测试删除、缺 spec/context、大型混合 diff |
135
155
 
136
156
  完整规则请看 [docs/rules.md](docs/rules.md)。
137
157
 
138
158
  ## 仓库可信度加固
139
159
 
140
- 公开仓库的维护和发布控制见 [docs/repository-trust-hardening.md](docs/repository-trust-hardening.md)。当前已经配置 branch protection、required CI checks、Dependabot npm/GitHub Actions 更新、CodeQL SAST、private vulnerability reporting、secret scanning 和 push protection。
160
+ 公开仓库的维护和发布控制见 [docs/repository-trust-hardening.md](docs/repository-trust-hardening.md)。当前已经配置严格 branch protection、required CI checks、Dependabot npm/GitHub Actions 更新、CodeQL SAST、fast-check fuzz/property tests、基于 npm trusted publishing provenance 的 signed GitHub release assets、private vulnerability reporting、secret scanning 和 push protection。
161
+
162
+ 最新 GitHub releases 会镜像 npm package tarball,并附带 `*.tgz.sigstore.json` 和 `*.tgz.intoto.jsonl` provenance assets。上传前会用 npm registry metadata 校验 tarball digest,并使用 npm provenance 作为来源。
163
+
164
+ 当前 Scorecard 提升路线优先做真实控制,不做表面刷分:更严格的 review gate、可被检测到的 fuzzing、以及 OpenSSF Best Practices Badge 流程。仓库年龄、贡献者多样性、已 review 的 PR 历史这些分数只能随着真实维护逐步提升。
165
+
166
+ 仓库现在已经获得 [OpenSSF Best Practices passing badge](https://www.bestpractices.dev/projects/12955)。[.bestpractices.json](.bestpractices.json) 继续作为公开项目条目的保守证据记录。`dynamic_analysis_enable_assertions` 仍然谨慎标为 unmet,直到运行时断言覆盖面超过当前测试、property 和 fuzz assertions。
141
167
 
142
168
  ## PR 风险分流
143
169
 
@@ -249,7 +275,7 @@ jobs:
249
275
 
250
276
  ## Hosted GitHub App 设计
251
277
 
252
- 当前仓库已经包含未来 Hosted GitHub App 的设计文档和纯契约测试,但还没有部署真实 hosted 服务。
278
+ 当前仓库已经包含未来 Hosted GitHub App 的设计文档、纯契约测试,以及第一个真实 Cloudflare hosted ingress。私有 staging GitHub App `ai-saas-guard-hosted` 已安装到 `zr9959/ai-saas-guard`,Cloudflare 已配置所需的云端凭据绑定。Worker 代码已经能接收签名 webhook、写入 KV 队列、换取 scoped installation token、读取 GitHub PR file metadata、做 compact PR-risk classification,并发布有长度上限的 Check Run summary;但当前端到端 GitHub App webhook delivery smoke 还被私有 App webhook 设置阻断,证据记录在 [docs/hosted-operations-evidence.md](docs/hosted-operations-evidence.md)。它还不是完整 source checkout scan worker。
253
279
 
254
280
  相关文档:
255
281
 
@@ -278,6 +304,7 @@ jobs:
278
304
  - Hosted Node/container app skeleton:`ai-saas-guard/hosted/app` 导出 `createHostedHttpApp`、`createInMemoryHostedAppPlatform` 和 `planHostedNodeContainerDeployment`,提供安全 `/healthz`、签名 `/github/webhook` ingress、单 job worker tick、测试用 in-memory provider adapters,以及 secret manager、queue、compact report store、worker sandbox、GitHub Checks publisher 的部署引用校验;它本身仍然不部署或暴露公开 hosted 服务
279
305
  - Hosted staging deployment planner:`ai-saas-guard/hosted/staging` 导出 `planHostedProviderBinding`、`planHostedStagingDeployment` 和 `planHostedGitHubAppPromotion`,把真实 provider 引用、Node/container deployment plan、hosted operational release-gate evidence 和 GitHub App deployment planning 组合起来;缺少 queue、store、worker sandbox、Check Run publisher、logs、metrics、rollback 或 incident-response 引用时,会阻止 staging exposure 和 production promotion;它本身仍然不会调用云平台、创建 GitHub App 或暴露公开 hosted 服务
280
306
  - Hosted staging harness:`ai-saas-guard/hosted/staging-harness` 导出 `createFileBackedHostedStagingHarness` 和 `createHostedStagingHarnessEvidence`,可以在本地用 file-backed queue、compact report、Check Run request 和 worker sandbox 跑通签名 webhook replay、worker tick 和 cleanup 校验;它只是 staging 演练工具,不会调用云平台、创建 GitHub App、写真实 Check Run 或暴露公开 hosted 服务
307
+ - Cloudflare hosted ingress:`hosted/cloudflare-worker` 已部署到 `https://ai-saas-guard-hosted.zr9959.workers.dev`,提供 `/healthz`、`/github/app/manifest-callback` 和签名 `/github/webhook` intake;Worker 已具备 compact pull request identity、file/category risk signal 和 Check Run metadata 路径;staging GitHub App ID 为 `3834787`,installation ID 为 `135085075`;真实 GitHub App webhook delivery、完整 source checkout scan worker、monitoring、rollback 和 incident-response evidence 仍需要通过 hosted operational release gate
281
308
  - webhook event parser
282
309
  - check-run summary renderer
283
310
  - Check Run publication planner:要求 repository `checks: write`,只从 compact report 生成有长度上限的 Check Run payload,包含 review categories、优先 review 文件、verification steps 和本地 CLI 复现命令;MVP 不发 PR comment
@@ -316,6 +343,8 @@ node dist/cli.js scan --root .
316
343
 
317
344
  以后更新英文 `README.md` 时,也要同步检查并更新本中文 `README.zh-CN.md`。
318
345
 
346
+ 贡献要求见 [CONTRIBUTING.md](CONTRIBUTING.md),里面说明了 PR 流程、测试要求、规则设计、release gate evidence 和公开安全边界。
347
+
319
348
  ## 安全报告
320
349
 
321
350
  报告漏洞前请阅读 [SECURITY.md](SECURITY.md)。不要在公开 issue 中发布真实 API key、客户数据、私有源码或生产 URL。
package/action.yml CHANGED
@@ -4,7 +4,7 @@ author: ai-saas-guard
4
4
 
5
5
  inputs:
6
6
  command:
7
- description: "Command to run: scan, check-supabase, check-stripe, check-mcp, or pr-risk."
7
+ description: "Command to run: scan, check-supabase, check-stripe, check-mcp, check-actions, or pr-risk."
8
8
  required: false
9
9
  default: scan
10
10
  root:
@@ -59,7 +59,7 @@ runs:
59
59
  set -o pipefail
60
60
 
61
61
  case "${INPUT_COMMAND}" in
62
- scan|check-supabase|check-stripe|check-mcp|pr-risk) ;;
62
+ scan|check-supabase|check-stripe|check-mcp|check-actions|pr-risk) ;;
63
63
  *)
64
64
  echo "Invalid command input: ${INPUT_COMMAND}" >&2
65
65
  exit 2
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { resolve } from "node:path";
3
3
  import { applyGuardConfig, loadGuardConfig } from "./config.js";
4
- import { checkMcp, checkStripe, checkSupabase, classifyPrRisk, scanRepository } from "./index.js";
4
+ import { checkActions, checkMcp, checkStripe, checkSupabase, classifyPrRisk, scanRepository } from "./index.js";
5
5
  import { formatJsonReport } from "./report/json.js";
6
6
  import { formatMarkdownReport } from "./report/markdown.js";
7
7
  import { formatSarifReport } from "./report/sarif.js";
@@ -19,13 +19,16 @@ async function main(argv) {
19
19
  report = await scanRepository({ rootDir: args.rootDir });
20
20
  break;
21
21
  case "check-supabase":
22
- report = await checkSupabase({ rootDir: args.rootDir });
22
+ report = await checkSupabase({ rootDir: args.rootDir, doctor: args.doctor });
23
23
  break;
24
24
  case "check-stripe":
25
25
  report = await checkStripe({ rootDir: args.rootDir });
26
26
  break;
27
27
  case "check-mcp":
28
- report = await checkMcp({ rootDir: args.rootDir });
28
+ report = await checkMcp({ rootDir: args.rootDir, policyTemplate: args.policyTemplate });
29
+ break;
30
+ case "check-actions":
31
+ report = await checkActions({ rootDir: args.rootDir });
29
32
  break;
30
33
  case "pr-risk":
31
34
  report = await classifyPrRisk({ rootDir: args.rootDir, base: args.base });
@@ -107,6 +110,14 @@ function parseArgs(argv) {
107
110
  index += 1;
108
111
  continue;
109
112
  }
113
+ if (arg === "--doctor") {
114
+ result.doctor = true;
115
+ continue;
116
+ }
117
+ if (arg === "--policy-template") {
118
+ result.policyTemplate = true;
119
+ continue;
120
+ }
110
121
  if (arg === "-h" || arg === "--help") {
111
122
  result.command = "help";
112
123
  continue;
@@ -154,9 +165,10 @@ Repo-local launch-readiness scanner for AI-built SaaS apps.
154
165
 
155
166
  Usage:
156
167
  ai-saas-guard scan [--root <repo>] [--config <file>] [--json|--sarif] [--fail-on <severity>]
157
- ai-saas-guard check-supabase [--root <repo>] [--config <file>] [--json|--sarif] [--fail-on <severity>]
168
+ ai-saas-guard check-supabase [--root <repo>] [--config <file>] [--doctor] [--json|--sarif] [--fail-on <severity>]
158
169
  ai-saas-guard check-stripe [--root <repo>] [--config <file>] [--json|--sarif] [--fail-on <severity>]
159
- ai-saas-guard check-mcp [--root <repo>] [--config <file>] [--json|--sarif] [--fail-on <severity>]
170
+ ai-saas-guard check-mcp [--root <repo>] [--config <file>] [--policy-template] [--json|--sarif] [--fail-on <severity>]
171
+ ai-saas-guard check-actions [--root <repo>] [--config <file>] [--json|--sarif] [--fail-on <severity>]
160
172
  ai-saas-guard pr-risk [--root <repo>] [--config <file>] [--base <branch>] [--json|--sarif|--markdown] [--fail-on <severity>]
161
173
 
162
174
  Defaults:
@@ -0,0 +1,2 @@
1
+ import type { ActionsReport, ScanOptions } from "../types.js";
2
+ export declare function checkActions(options: ScanOptions): Promise<ActionsReport>;
@@ -0,0 +1,4 @@
1
+ import { checkActions as runActionsScanner } from "../scanners/actions.js";
2
+ export function checkActions(options) {
3
+ return runActionsScanner(options.rootDir);
4
+ }
@@ -1,2 +1,2 @@
1
- import type { McpReport, ScanOptions } from "../types.js";
2
- export declare function checkMcp(options: ScanOptions): Promise<McpReport>;
1
+ import type { McpOptions, McpReport } from "../types.js";
2
+ export declare function checkMcp(options: McpOptions): Promise<McpReport>;
@@ -1,4 +1,4 @@
1
1
  import { checkMcp as runMcpScanner } from "../scanners/mcp.js";
2
2
  export function checkMcp(options) {
3
- return runMcpScanner(options.rootDir);
3
+ return runMcpScanner(options.rootDir, { policyTemplate: options.policyTemplate });
4
4
  }
@@ -1,2 +1,2 @@
1
- import type { ScanOptions, SupabaseReport } from "../types.js";
2
- export declare function checkSupabase(options: ScanOptions): Promise<SupabaseReport>;
1
+ import type { SupabaseOptions, SupabaseReport } from "../types.js";
2
+ export declare function checkSupabase(options: SupabaseOptions): Promise<SupabaseReport>;