Skip to content
Report library
Purpose / Data analysis

Prisma Driver Adapter Implementation Skill Security Audit

What the author says it does (original text)

Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.

Independent security check

Security risks found

Files checked
1
Risks found
1
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

Preserved database error details may disclose sensitive data

Source references: 3
What we found

The guide requires preservation of the original database code and message, and its example also copies detail, column, and hint. Depending on the database, detail can contain schema information, constraint names, or actual conflicting field values.

Why this matters

If an application exposes P2039 or adapter exceptions to untrusted clients, or exports full production logs to a third party, user data and database internals could be disclosed through error text.

The guide explicitly requires preserving the database's original error message and copies detail, column, and hint for unmapped PostgreSQL errors. If an application returns these errors to untrusted clients, records them in logs accessible to lower-privileged users, or exposes the fields through P2039, schema details, constraint names, and values potentially present in detail could leak. This serves a legitimate diagnostic purpose and does not prove leakage occurred. Users can ask which fields cross API or logging boundaries and require redaction and access controls there while retaining protected diagnostic data internally.

SKILL.md:202In the instructionsOpen original file
For database errors, preserve `originalCode` and `originalMessage` even when falling back to the provider-specific raw variant:
Show 2 other places
SKILL.md:223In the instructionsOpen original file
  }  return {    kind: 'postgres',    code: String(error.code ?? 'N/A'),    severity: error.severity ?? 'N/A',    message: error.message,    detail: error.detail,    column: error.column,    hint: error.hint,  }
SKILL.md:240In the instructionsOpen original file
Prisma uses preserved original details when an unmapped driver error becomes `P2039`. Do not replace every unknown exception with a fabricated `GenericJs` id; rethrow genuinely unexpected non-driver errors so programming bugs remain visible.
Could it delete files or keep running?Looks for broad file deletion, disk overwrites, and programs set to start automatically.No risks found
Could it bypass safety checks?Looks for skipped website security checks, excessive file access, or actions that skip your approval.No risks found
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

8 instruction sections

This Skill is an implementation guide for Prisma 7 SQL driver adapters. It describes queries, transactions, result mapping, and error conversion, but contains no installation command, automatically executed script, or credential-collection step.

View source
SKILL.md:12In the instructionsOpen original file
Use this guide with the exact `@prisma/driver-adapter-utils` version installed by the target Prisma release. Driver adapters are a protocol boundary: type-compatible code can still corrupt values, leak connections, or break transactions.
SKILL.md:16In the instructionsOpen original file
- Implementing `SqlDriverAdapterFactory`, `SqlMigrationAwareDriverAdapterFactory`, `SqlDriverAdapter`, or `Transaction`- Adding nested-transaction/savepoint support- Mapping driver values, column metadata, bind arguments, or database errors- Debugging `P2039`, transaction leaks, shadow-database failures, or adapter-specific query behavior

The transaction example requires a dedicated connection for each transaction and releases it after completion or failed setup. Commit and rollback methods are defined as cleanup hooks rather than issuing SQL a second time.

View source
SKILL.md:131In the instructionsOpen original file
`startTransaction` must acquire one dedicated connection, start the database transaction, apply the requested isolation level, and return a `Transaction` bound to that same connection. If setup fails, release it immediately.
SKILL.md:156In the instructionsOpen original file
Prisma coordinates the SQL `COMMIT`/`ROLLBACK` through `executeRaw`. The transaction object's `commit()` and `rollback()` methods are lifecycle hooks: detach listeners and release the dedicated connection exactly once. They must not issue a second SQL commit/rollback.

Shadow-database support is limited to creating an isolated database and dropping it during failure cleanup or disposal. The guide explicitly prohibits pointing the shadow adapter at the primary database and says only adapter-owned pools should be closed.

View source
SKILL.md:245In the instructionsOpen original file
- `connect()` returns a fresh usable adapter connection/pool wrapper.- Track whether the factory created the pool. `dispose()` closes owned pools and only detaches listeners from caller-owned pools unless an explicit option transfers ownership.- Implement `SqlMigrationAwareDriverAdapterFactory` only when `connectToShadowDb()` can create an isolated shadow database, connect to it, and drop it during disposal/failure cleanup.- Never point the shadow adapter at the primary database. Quote generated identifiers and use cryptographically unique names.- `getConnectionInfo()` should accurately report `schemaName`, `maxBindValues` when applicable, and `supportsRelationJoins`.
Start here · InstructionsSKILL.md
prisma-driver-adapter-implementation
Lines connect the instruction file to its sections, not an observed execution order. Select a section to read the source. 1 more sections are available in the original file.
Files and check records1 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

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

Operations mentioned in code and instructions

Connect to websites
SKILL.md:268In the instructionsOpen original file
- [Driver adapter interfaces](https://github.com/prisma/prisma/blob/v7/packages/driver-adapter-utils/src/types.ts)- [PostgreSQL adapter transaction implementation](https://github.com/prisma/prisma/blob/v7/packages/adapter-pg/src/pg.ts)
SKILL.md:269In the instructionsOpen original file
- [Driver adapter interfaces](https://github.com/prisma/prisma/blob/v7/packages/driver-adapter-utils/src/types.ts)- [PostgreSQL adapter transaction implementation](https://github.com/prisma/prisma/blob/v7/packages/adapter-pg/src/pg.ts)- [PostgreSQL adapter error mapping](https://github.com/prisma/prisma/blob/v7/packages/adapter-pg/src/errors.ts)
SKILL.md:270In the instructionsOpen original file
- [PostgreSQL adapter transaction implementation](https://github.com/prisma/prisma/blob/v7/packages/adapter-pg/src/pg.ts)- [PostgreSQL adapter error mapping](https://github.com/prisma/prisma/blob/v7/packages/adapter-pg/src/errors.ts)
Lines read
271
File checksum (to compare versions)
3bd71b19524639a829e49528e10f3cdc3e3bff055ddbe98fd0d9862361c8981c