要求把工作区级服务令牌粘贴到对话中
原文依据:5 处如果环境中没有令牌,技能明确要求用户把令牌粘贴到聊天;该令牌不是仅限当前项目,而是可访问工作区中的全部项目、数据库和连接。对话记录、代理上下文或可见日志因此可能持有高权限凭据。
令牌一旦被非预期人员或系统取得,可用于查看或操作整个 Prisma 工作区内的资源,而不只是本次新建的数据库。
没有现有令牌时,活跃流程明确要求用户把令牌粘贴到对话中。参考文档说明该令牌可访问整个工作区的所有项目、数据库和连接,因此聊天记录或代理上下文暴露会影响不止当前项目。用户可要求改用受控环境变量或密钥管理器,并使用专用、短期且事后轮换的令牌。
**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.查看另外 4 个位置
Service tokens authenticate server-to-server requests. They are scoped to a workspace and grant access to all resources within it.### 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.**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.### 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)