Skip to content
Report library
Purpose / Data analysis

Prisma Postgres Setup Skill Security Audit

What the author says it does (original text)

Set up a new Prisma Postgres database and connect it to a local project using the Management API. Use when asked to "set up a database", "create a Prisma Postgres project", "get a connection string", "connect my app to Prisma Postgres", or "provision a database".

Independent security check

Do not install or run it yet

Files checked
5
Risks found
3
Could it run dangerous commands?Looks for programs run straight after downloading, remote control of your computer, and hidden commands.No risks found
Could it expose your files or keys?Looks for uploads of files containing passwords or keys, and keys written directly in the code.Risks found: 1
Medium risk

Requests a workspace-wide service token through chat

Source references: 5
What we found

When no token is found locally, the Skill explicitly asks the user to paste one into the conversation. The token is not limited to the new project: it grants access to every project, database, and connection in the workspace. Conversation history, agent context, or visible logs may therefore retain a powerful credential.

Why this matters

Anyone or any system that obtains the token could access or operate resources across the whole Prisma workspace, not just the database being created.

When no token is available, the active workflow explicitly asks the user to paste it into the conversation. The reference says this token can access every project, database, and connection in the workspace, so exposure through chat history or agent context affects more than the current project. A user can require a controlled environment variable or secret manager and use a dedicated, short-lived token that is rotated afterward.

SKILL.md:47In the instructionsOpen original file
**1a. Token in the user's prompt**Check if the user included a service token in their initial message (e.g., "Set up Prisma Postgres with token eyJ..."). If so, use it **exactly as provided** — do not truncate, re-encode, or round-trip it through a file. Store it in a shell variable for subsequent calls.**1b. Token in the environment**Check for `PRISMA_SERVICE_TOKEN` in the environment or `.env` file.**1c. Ask the user to create one**If no token is available, instruct the user:> Create a service token in Prisma Console → Workspace Settings → Service Tokens.> Copy the token and paste it here.Read `references/auth.md` for details on service token creation.Once you have a token, store it in a shell variable (`PRISMA_SERVICE_TOKEN`) and use it for all subsequent API calls.
Show 4 other places
references/auth.md:7In the instructionsOpen original file
Service tokens authenticate server-to-server requests. They are scoped to a workspace and grant access to all resources within it.
references/auth.md:31In the instructionsOpen original file
### Token scopeService tokens are workspace-scoped. A single token grants access to all projects, databases, and connections within the workspace. There are no project-scoped tokens at this time.
SKILL.md:55In the instructionsOpen original file
**1c. Ask the user to create one**If no token is available, instruct the user:> Create a service token in Prisma Console → Workspace Settings → Service Tokens.> Copy the token and paste it here.
references/auth.md:35In the instructionsOpen original file
### Security practices- Store tokens in environment variables or secret managers, never in source code- Add `.env` to `.gitignore` to prevent accidental commits- Rotate tokens periodically via Console → Workspace Settings → Service Tokens- In CI/CD, store tokens as encrypted secrets (e.g., GitHub Secrets)
Could it delete files or keep running?Looks for broad file deletion, disk overwrites, and programs set to start automatically.Risks found: 1
High risk

Permanently deletes an existing project and all databases when the limit is reached

Source references: 2
What we found

The Skill treats deletion as recovery from a creation-limit error: after the user selects an existing project from a menu, it deletes that project and retries. The referenced endpoint documentation says this permanently removes the project and all of its databases, while the main workflow does not require a separate confirmation of the exact ID, enumerate affected databases, or verify backups.

Why this matters

A mistaken selection could permanently erase a production or shared project and all data in its databases, and invalidate its connections.

Deletion occurs only after creation fails due to a limit and the user selects a project from an interactive menu, which provides some authorization. However, the workflow does not require a second confirmation, enumerate contained databases, or verify backups. The reference explicitly says project deletion permanently removes all its databases. A user can require the exact project ID, affected databases, backup status, and separate confirmation before permanent deletion.

SKILL.md:104In the instructionsOpen original file
If the response status is `provisioning`, wait a few seconds and poll `GET /v1/databases/<database-id>` until `status` is `ready`.**If creation fails due to a database limit**, list the user's existing projects and present them as an interactive menu for deletion. After the user picks one, delete it and retry.Read `references/endpoints.md` for the full request/response shapes.
Show 1 other places
references/endpoints.md:217In the instructionsOpen original file
## Delete project```DELETE /v1/projects/{projectId}```Permanently deletes a project and all its databases. Returns `204 No Content` on success.
Could it bypass safety checks?Looks for skipped website security checks, excessive file access, or actions that skip your approval.Risks found: 1
Low risk

The install command does not pin a dependency version

Source references: 11
What we found

The installation command does not specify dependency versions. The same command may download different code later, so what you install can differ from what was checked.

Why this matters

A later install may download different code even though the command and this report have not changed.

The workflow runs an npm install without pinned versions. A later run may resolve different package and transitive-dependency code, changing what is added to and executed in the local project. A user can ask for tested exact versions or a lockfile and review resolved versions before installation.

`npx prisma init` has no version in the command. It will normally use the locally installed Prisma, but that installation is also unpinned. Running the overall workflow at different times can therefore execute different Prisma code and create or modify project files differently. A user can require a pinned, locked Prisma version.

The migration command executes Prisma installed earlier without a pinned version and applies a database migration while generating a client. Version drift may change generated output or migration behavior. A user can require a lockfile and explicit versions and inspect the migration before execution.

The prototyping-only `db push` and `generate` commands also rely on the previously unpinned Prisma installation. With explicit user selection, this directly synchronizes the database without migration history; version drift may alter database or generated results. A user can require locked versions and review schema differences first.

The workflow runs `npx tsx`, but `tsx` is absent from the listed install command. If the project does not already contain it, npx may fetch a current version, leaving the executed code unpinned; the script also connects using the database credential. A user can require a tested exact `tsx` version in the lockfile or prohibit on-demand downloads.

The Studio invocation has no version at the call site and relies on the earlier unpinned Prisma installation. It launches a visual database browser, so version resolution changes the code executed with database access. A user can require Prisma and its dependencies to be locked before launching it.

SKILL.md:128In the instructionsOpen original file
```bashnpm install prisma @prisma/client @prisma/adapter-pg pg dotenv```
Show 10 other places
SKILL.md:125In the instructionsOpen original file
1. Install dependencies:```bashnpm install prisma @prisma/client @prisma/adapter-pg pg dotenv```
SKILL.md:148In the instructionsOpen original file
5. If `prisma/schema.prisma` does not exist, run `npx prisma init` to scaffold the project. This creates both `prisma/schema.prisma` and `prisma.config.ts`.
SKILL.md:127In the instructionsOpen original file
```bashnpm install prisma @prisma/client @prisma/adapter-pg pg dotenv```
SKILL.md:190In the instructionsOpen original file
```bashnpx prisma migrate dev --name init```
SKILL.md:187In the instructionsOpen original file
Once the schema has models and the user is ready, create a migration and generate the client:```bashnpx prisma migrate dev --name init```This creates migration files in `prisma/migrations/` **and** generates the client in one step. Migration history is essential for CI/CD workflows (`prisma migrate deploy`) and production deployments.
SKILL.md:195In the instructionsOpen original file
Only use `npx prisma db push` if the user explicitly asks for prototyping-only mode (no migration history). In that case, follow it with `npx prisma generate`.
SKILL.md:223In the instructionsOpen original file
```bashnpx tsx test-connection.ts```
SKILL.md:220In the instructionsOpen original file
Run it:```bashnpx tsx test-connection.ts```
SKILL.md:238In the instructionsOpen original file
- **Prisma Studio (CLI):** `npx prisma studio` — opens a visual data browser locally- **Console:** `https://console.prisma.io/<workspaceId>/<projectId>/<databaseId>/dashboard` — strip the prefixes (`wksp_`, `proj_`, `db_`) from the IDs returned in Step 3 to build this URL
SKILL.md:236In the instructionsOpen original file
Then share links for the user to explore their database:- **Prisma Studio (CLI):** `npx prisma studio` — opens a visual data browser locally- **Console:** `https://console.prisma.io/<workspaceId>/<projectId>/<databaseId>/dashboard` — strip the prefixes (`wksp_`, `proj_`, `db_`) from the IDs returned in Step 3 to build this URL
Could it mislead the AI or hide text?Checks the skill instructions for requests to ignore you, influence the report, or hide text in invisible characters.No risks found
Could it change links or payment recipients without asking?Looks for forced referral or payment changes combined with instructions to hide the change.No risks found

Inside this skill

6 instruction sections

The Skill uses a Prisma workspace service token with the official Management API to list regions, create a project and database, and retrieve a direct connection string containing database credentials.

View source
SKILL.md:71In the instructionsOpen original file
```bashcurl -s -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \  https://api.prisma.io/v1/regions/postgres```
SKILL.md:84In the instructionsOpen original file
```bashcurl -s -X POST https://api.prisma.io/v1/projects \  -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "name": "<project-name>",    "region": "<region-id>",    "createDatabase": true  }'```
SKILL.md:96In the instructionsOpen original file
The response is wrapped in `{ "data": { ... } }`. Extract:- `data.id` — the project ID (prefixed with `proj_`)- `data.database.id` — the database ID (prefixed with `db_`)- `data.database.connections[0].endpoints.direct.connectionString` — the direct PostgreSQL connection stringUse the **direct** connection string (`endpoints.direct.connectionString`). Do not use the pooled or accelerate endpoints — those are for legacy Accelerate setups and not needed for new projects.

It changes the local project by installing five npm packages, appending the database connection string to `.env`, adjusting Prisma configuration and schema, and running a migration command that changes the database.

View source
SKILL.md:125In the instructionsOpen original file
1. Install dependencies:```bashnpm install prisma @prisma/client @prisma/adapter-pg pg dotenv```
SKILL.md:138In the instructionsOpen original file
2. Write the direct connection string to `.env`. **Append** to the file if it already exists — do not overwrite existing entries:```DATABASE_URL="<direct-connection-string>"```3. Verify `.gitignore` includes `.env`. Create `.gitignore` if it does not exist. Warn the user if `.env` is not gitignored.4. Ensure `package.json` has `"type": "module"` set (Prisma 7 generates ESM output).
SKILL.md:187In the instructionsOpen original file
Once the schema has models and the user is ready, create a migration and generate the client:```bashnpx prisma migrate dev --name init```This creates migration files in `prisma/migrations/` **and** generates the client in one step. Migration history is essential for CI/CD workflows (`prisma migrate deploy`) and production deployments.

The Skill includes some safeguards: it presents only available regions, requests confirmation after generating a new data model and before pushing it, and requires `.env` to be excluded from version control.

View source
SKILL.md:75In the instructionsOpen original file
The response contains an array of regions with `id`, `name`, and `status`. Only present regions where `status` is `available`.**Present the regions as an interactive menu** — let the user pick from options rather than typing a region ID manually.
SKILL.md:184In the instructionsOpen original file
1. **"I'll define my schema manually"** — Tell the user to edit `prisma/schema.prisma` and come back when ready. Wait for them before proceeding.2. **"Give me a starter schema"** — Add a Blog starter schema (User, Post, Comment with relations) to `prisma/schema.prisma`. Show the user what was added and ask if they want to adjust it before pushing.3. **"I'll describe what I need"** — Ask the user to describe their data model in natural language (e.g., "I'm building a task manager with projects, tasks, and team members"). Generate a schema from the description, show it, and ask for confirmation before pushing.
SKILL.md:144In the instructionsOpen original file
3. Verify `.gitignore` includes `.env`. Create `.gitignore` if it does not exist. Warn the user if `.env` is not gitignored.
Start here · InstructionsSKILL.md
prisma-postgres-setup
Lines connect the instruction file to its sections, not an observed execution order. Select a section to read the source.

File reference map

References: 4
Files making referencesReferenced content
Lines show actual file references, not execution order. Select a node to highlight its connections and inspect the files and source locations. Dashed lines include files that still need locating.
Files and check records5 files

Coverage and gaps

Content covered in each file

These are the source ranges included in this check, not a guarantee that every issue has been resolved.

  • SKILL.mdFull text included
  • references/api-basics.mdFull text included
  • references/auth.mdFull text included
  • references/endpoints.mdFull text included
  • references/prisma7-client.mdFull text included

This report is for the version above. We read the available code and instructions without running the skill or checking extra packages it installs. This is not a promise of safety: a different version or setup may behave differently.

  • SKILL.mdInstructions
  • references/api-basics.mdSupporting file
  • references/auth.mdSupporting file
  • references/endpoints.mdSupporting file
  • references/prisma7-client.mdSupporting file

Operations mentioned in code and instructions

Connect to websites
SKILL.md:32In the instructionsOpen original file
- Node.js 18+- A Prisma Postgres workspace (create one at https://console.prisma.io if needed)- A workspace service token (see `references/auth.md`)
SKILL.md:71In the instructionsOpen original file
```bashcurl -s -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \  https://api.prisma.io/v1/regions/postgres
SKILL.md:72In the instructionsOpen original file
curl -s -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \  https://api.prisma.io/v1/regions/postgres```
Read keys or account settings
SKILL.md:53In the instructionsOpen original file
Check for `PRISMA_SERVICE_TOKEN` in the environment or `.env` file.
SKILL.md:136In the instructionsOpen original file
- `pg` — Node.js PostgreSQL driver (used by the adapter)- `dotenv` — loads `.env` variables for `prisma.config.ts`
SKILL.md:138In the instructionsOpen original file
2. Write the direct connection string to `.env`. **Append** to the file if it already exists — do not overwrite existing entries:
Run commands
SKILL.md:70In the instructionsOpen original file
```bashcurl -s -H "Authorization: Bearer $PRISMA_SERVICE_TOKEN" \
SKILL.md:83In the instructionsOpen original file
```bashcurl -s -X POST https://api.prisma.io/v1/projects \
SKILL.md:114In the instructionsOpen original file
```bashcurl -s -X POST https://api.prisma.io/v1/databases/<database-id>/connections \
Install extra software packages
SKILL.md:128In the instructionsOpen original file
```bashnpm install prisma @prisma/client @prisma/adapter-pg pg dotenv```
SKILL.md:148In the instructionsOpen original file
5. If `prisma/schema.prisma` does not exist, run `npx prisma init` to scaffold the project. This creates both `prisma/schema.prisma` and `prisma.config.ts`.
SKILL.md:190In the instructionsOpen original file
```bashnpx prisma migrate dev --name init```
Lines read
721
File checksum (to compare versions)
e8756db6cefcb202646fa9420ea838d4142c4c42a26090083431d080f89847e0