跳转到正文
报告库
用途分类 / 数据分析

Prisma Postgres Skill 安全审计

作者说它能做什么(原文)

Prisma Postgres setup and operations guidance across Console, create-db CLI, Management API, and Management API SDK. Use when creating Prisma Postgres databases, working in Prisma Console, provisioning with create-db/create-pg/create-postgres, or integrating programmatic provisioning with service tokens or OAuth.

第三方安全检查结论

先别安装或运行

已检查文件
5
发现的风险
5
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
高风险

未固定版本的 npm/npx 命令会执行安装时获取的代码

原文依据:6 处
发现了什么

指南多次使用 `@latest`,并安装未固定版本的包。执行这些命令时,实际代码由当时 npm 上的最新发布内容决定,而不是本 Skill 中可审计的固定版本。

为什么需要注意

如果包、发布账户或依赖链被入侵,安装或 CLI 代码可在用户权限下读取文件、环境变量和凭据,或修改工作区。

指南确实多次提供带 `@latest` 的可执行 `npx` 命令,并另有未指定版本的 SDK 安装命令。这会让实际下载和执行的代码由运行时的 npm 发布状态决定。风险是供应链与行为不可复现,并不证明包已恶意。用户可要求固定并核验各包版本。

SKILL.md:56来自说明文档打开原文件
```bashnpx create-db@latest```
查看另外 5 个位置
SKILL.md:75来自说明文档打开原文件
```bashnpx -y @prisma/cli@latest database create --helpnpx -y @prisma/cli@latest database list --json
SKILL.md:125来自说明文档打开原文件
```bashnpm install @prisma/management-api-sdk```
references/create-db-cli.md:69来自说明文档打开原文件
```bashnpm install create-db# orbun add create-db```
SKILL.md:55来自说明文档打开原文件
```bashnpx create-db@latest```Aliases:```bashnpx create-pg@latestnpx create-postgres@latest```
SKILL.md:122来自说明文档打开原文件
Install and use:```bashnpm install @prisma/management-api-sdk```
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 2 项风险
中风险

数据库凭据和 claim URL 可被写入文件、复制到剪贴板或打印到输出

原文依据:3 处
发现了什么

该 Skill 提供把 `DATABASE_URL` 和 `CLAIM_URL` 写入 `.env`、把连接字符串复制到剪贴板、仅打印连接字符串,以及在示例代码中记录连接字符串和 claim URL 的方式。

为什么需要注意

终端日志、CI 输出、剪贴板历史、屏幕共享或可读取 `.env` 的其他进程可能获得数据库访问权;claim URL 还可能允许他人认领临时数据库。

这些是明确可用的输出选项和示例:凭据及 claim URL 可写入指定 `.env`、复制到系统剪贴板或输出到终端,示例代码还会记录二者。若日志、终端、剪贴板或目标文件可被他人读取,数据库访问凭据或认领链接会泄露。用户可避免这些选项、限定 `.env` 权限,并要求示例默认遮蔽敏感值。

references/create-db-cli.md:50来自说明文档打开原文件
| `--json [boolean]` | `-j` | Output machine-readable JSON || `--env [string]` | `-e` | Write `DATABASE_URL` and `CLAIM_URL` into a target `.env` || `--ttl [string]` | `-t` | Auto-delete after a TTL like `30m` or `1h-24h` || `--copy [boolean]` | `-c` | Copy the connection string to the clipboard || `--quiet [boolean]` | `-q` | Only print the connection string || `--open [boolean]` | `-o` | Open the claim URL in your browser |
查看另外 2 个位置
references/create-db-cli.md:84来自说明文档打开原文件
if (isDatabaseSuccess(result)) {  console.log(result.connectionString);  console.log(result.claimUrl);  console.log(result.deletionDate);}
references/create-db-cli.md:49来自说明文档打开原文件
| `--interactive [boolean]` | `-i` | Open region selector || `--json [boolean]` | `-j` | Output machine-readable JSON || `--env [string]` | `-e` | Write `DATABASE_URL` and `CLAIM_URL` into a target `.env` || `--ttl [string]` | `-t` | Auto-delete after a TTL like `30m` or `1h-24h` || `--copy [boolean]` | `-c` | Copy the connection string to the clipboard || `--quiet [boolean]` | `-q` | Only print the connection string || `--open [boolean]` | `-o` | Open the claim URL in your browser |
中风险

控制台编辑和模式迁移可能修改错误的数据库

原文依据:2 处
发现了什么

指南允许在 Studio 中编辑数据,并建议链接后运行 `prisma migrate dev`,但没有要求确认所选工作区、项目、分支或是否为生产环境。

为什么需要注意

如果选错项目或 `.env` 指向错误数据库,用户数据或数据库结构可能被意外改变,导致数据丢失、应用故障或停机。

流程先要求选择工作区和项目,但随后允许在 Studio 编辑数据,没有单独确认分支或生产环境;链接后也建议在需要时运行会应用模式的 `prisma migrate dev`。因此,若用户选错项目、连接目标或环境,确有修改错误数据库的可能。这不是隐藏行为,但用户可要求在编辑或迁移前显示数据库标识、分支、主机和环境,并对生产库禁用写入。

references/console-and-connections.md:15来自说明文档打开原文件
1. Open `https://console.prisma.io`.2. Select workspace and project.3. Use dashboard metrics for usage and billing visibility.4. Open the **Studio** tab in the sidebar to inspect and edit data.
查看另外 1 个位置
references/console-and-connections.md:42来自说明文档打开原文件
This command updates or creates `.env` with `DATABASE_URL`. If the project is already linked, use `--force` to re-link. After linking, run `prisma generate`, then `prisma migrate dev` if you need to apply the schema.
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。发现 1 项风险
中风险

项目链接会持久修改本地 `.env`

原文依据:3 处
发现了什么

指南说明链接命令会创建或更新 `.env`,并支持用 `--force` 重新链接,但没有要求先展示目标文件、保留原值或确认当前项目。

为什么需要注意

现有 `DATABASE_URL` 可能被替换,使应用、测试或后续迁移连接到不同数据库;该文件也可能被意外提交或包含在构建产物中。

指南明确说明链接命令会创建或更新本地 `.env`,且已链接时可用 `--force` 重连。这是预期功能,但若在错误目录、错误数据库或已有配置的项目中运行,可能替换 `DATABASE_URL` 并改变后续程序和迁移的目标。所示指导没有先预览或备份原值的步骤;用户可要求执行前显示目标路径与差异,并限制自动使用 `--force`。

references/console-and-connections.md:30来自说明文档打开原文件
If the Prisma Postgres database already exists, link the local project instead of provisioning a new one:```bashprisma postgres link```For CI or non-interactive usage:```bashprisma postgres link --api-key "<your-api-key>" --database "db_..."```This command updates or creates `.env` with `DATABASE_URL`. If the project is already linked, use `--force` to re-link. After linking, run `prisma generate`, then `prisma migrate dev` if you need to apply the schema.
查看另外 2 个位置
references/console-and-connections.md:28来自说明文档打开原文件
## Linking an existing projectIf the Prisma Postgres database already exists, link the local project instead of provisioning a new one:```bashprisma postgres link```
references/console-and-connections.md:42来自说明文档打开原文件
This command updates or creates `.env` with `DATABASE_URL`. If the project is already linked, use `--force` to re-link. After linking, run `prisma generate`, then `prisma migrate dev` if you need to apply the schema.
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
低风险

安装命令没有固定依赖版本

原文依据:7 处
发现了什么

安装命令没有指定依赖版本。同样的命令以后可能下载不同代码,你实际安装的内容可能与这次检查时不同。

为什么需要注意

即使命令和报告没变,以后安装时也可能下载到另一份代码。

这是实际建议执行的 `npx` 命令,`@latest` 会在运行时选择当时的最新版本,而不是固定、可复核的版本。若上游新版本被破坏或行为改变,命令可能执行不同代码。用户可要求作者给出经过验证的精确版本,并在运行前核对包名、版本和来源。

该别名命令同样使用 `@latest`,运行时会下载并执行届时发布的代码。虽然用途与数据库创建一致,但版本不可复现,且别名包还需单独确认确由 Prisma 控制。用户可要求固定版本并核验 npm 发布者。

该别名命令使用 `@latest`,实际执行内容取决于运行时的 npm 最新发布。它是主动命令而非说明性警告;若上游包发生变化,用户可能执行未经本 Skill 审查的代码。可要求固定版本并验证别名包的所有者。

安装指令未指定 SDK 版本,因此不同时间执行可能得到不同实现。该包的后续用途涉及服务令牌、OAuth 和令牌刷新,版本漂移可能影响凭据处理。用户可要求经过验证的精确版本和锁文件,并限制令牌权限。

SKILL.md:56来自说明文档打开原文件
```bashnpx create-db@latest```
查看另外 6 个位置
SKILL.md:53来自说明文档打开原文件
Use `create-db` when you need a database immediately:```bashnpx create-db@latest```
SKILL.md:62来自说明文档打开原文件
```bashnpx create-pg@latestnpx create-postgres@latest
SKILL.md:59来自说明文档打开原文件
Aliases:```bashnpx create-pg@latestnpx create-postgres@latest```
SKILL.md:63来自说明文档打开原文件
npx create-pg@latestnpx create-postgres@latest```
SKILL.md:125来自说明文档打开原文件
```bashnpm install @prisma/management-api-sdk```
SKILL.md:120来自说明文档打开原文件
### 5. Type-safe integration with Management API SDKInstall and use:```bashnpm install @prisma/management-api-sdk```Use `createManagementApiClient` for existing tokens, or `createManagementApiSdk` for OAuth + token refresh.
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

6 个说明模块

该 Skill 是 Prisma Postgres 的操作指南,覆盖控制台、临时和持久数据库创建、本地项目链接,以及 Management API/SDK;它本身未包含自动执行脚本。

查看原文
SKILL.md:12来自说明文档打开原文件
Guidance for creating, managing, and integrating Prisma Postgres across interactive and programmatic workflows.
SKILL.md:16来自说明文档打开原文件
Reference this skill when:- Setting up Prisma Postgres from Prisma Console- Provisioning instant temporary databases with `create-db`- Linking an existing local project with `prisma postgres link`- Managing Prisma Postgres resources via Management API- Using `@prisma/management-api-sdk` in TypeScript/JavaScript- Handling claim URLs, connection strings, regions, and auth flows

`create-db` 创建的数据库默认是临时资源,约 24 小时后删除;通过命令输出的 claim URL 可将其永久保留。

查看原文
references/create-db-cli.md:58来自说明文档打开原文件
- Databases are temporary by default.- Unclaimed databases are auto-deleted after ~24 hours.- Claim the database using the URL shown in command output to keep it permanently.

链接命令会在本地创建或更新 `.env` 中的 `DATABASE_URL`;之后的迁移命令可把本地模式应用到所连接的数据库。

查看原文
references/console-and-connections.md:42来自说明文档打开原文件
This command updates or creates `.env` with `DATABASE_URL`. If the project is already linked, use `--force` to re-link. After linking, run `prisma generate`, then `prisma migrate dev` if you need to apply the schema.

Management API 能创建、列出和撤销工作区服务令牌。文档明确说明新令牌及连接凭据只显示一次,并要求不要记录完整响应。

查看原文
references/management-api-sdk.md:34来自说明文档打开原文件
The typed client exposes routes to list, create, and revoke workspace service tokens:- `GET /v1/workspaces/{workspaceId}/service-tokens`- `POST /v1/workspaces/{workspaceId}/service-tokens`- `DELETE /v1/workspaces/{workspaceId}/service-tokens/{serviceTokenId}`Creation accepts a display `name`. The response's `data.value` is the complete token and is returned exactly once; transfer it directly to the intended secret store without logging the response. Later list calls return metadata and `valueHint`, not the token value. Treat revocation as destructive and resolve both ids explicitly.
references/management-api.md:64来自说明文档打开原文件
Connection create/rotate responses reveal credentials once. Later reads redact or omit the secret, so store the URL immediately. Use the structured direct/pooled endpoint returned by the concrete operation; do not assume a historical flat response shape.Workspace service-token creation also returns the complete token value exactly once. List calls expose only metadata and a `valueHint`; delete revokes the token. Keep workspace and token ids opaque, and never log a create response.
从这里开始 · 工作说明SKILL.md
prisma-postgres
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。

文件引用关系图

4 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录5 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/console-and-connections.md已纳入全文
  • references/create-db-cli.md已纳入全文
  • references/management-api-sdk.md已纳入全文
  • references/management-api.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • references/console-and-connections.md配套文件
  • references/create-db-cli.md配套文件
  • references/management-api-sdk.md配套文件
  • references/management-api.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:46来自说明文档打开原文件
- Open `https://console.prisma.io`- Create/select workspace and project
SKILL.md:107来自说明文档打开原文件
```texthttps://api.prisma.io/v1```
SKILL.md:112来自说明文档打开原文件
- OpenAPI docs: `https://api.prisma.io/v1/doc`- Swagger Editor: `https://api.prisma.io/v1/swagger-editor`
运行命令
SKILL.md:55来自说明文档打开原文件
```bashnpx create-db@latest
SKILL.md:61来自说明文档打开原文件
```bashnpx create-pg@latest
SKILL.md:74来自说明文档打开原文件
```bashnpx -y @prisma/cli@latest database create --help
安装其他软件包
SKILL.md:56来自说明文档打开原文件
```bashnpx create-db@latest```
SKILL.md:62来自说明文档打开原文件
```bashnpx create-pg@latestnpx create-postgres@latest
SKILL.md:63来自说明文档打开原文件
npx create-pg@latestnpx create-postgres@latest```
读取密钥或账号配置
SKILL.md:97来自说明文档打开原文件
```bashprisma postgres link --api-key "<your-api-key>" --database "db_..."```
SKILL.md:100来自说明文档打开原文件
This flow updates your local `.env` with `DATABASE_URL`, then you can run `prisma generate` and `prisma migrate dev`.
references/console-and-connections.md:39来自说明文档打开原文件
```bashprisma postgres link --api-key "<your-api-key>" --database "db_..."```
读取了多少行
504
文件校验值(用于核对版本)
cef646596505289420a619faa71c7f23bdf54b66f8f185f08244793af1d8cd0d