prompt-governance

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prompt Governance

提示词治理

Category: Engineering Domain: AI Governance
分类: 工程 领域: AI治理

Overview

概述

The Prompt Governance skill provides tools for auditing prompts for security vulnerabilities, bias, and safety issues, plus managing a versioned catalog of approved prompts. Essential for organizations deploying LLM-based applications at scale.
提示词治理技能提供工具用于审核提示词的安全漏洞、偏见和安全问题,同时管理经过批准的提示词的版本化目录。对于大规模部署基于LLM的应用的组织来说至关重要。

Quick Start

快速开始

bash
undefined
bash
undefined

Audit a prompt for security and safety issues

Audit a prompt for security and safety issues

python scripts/prompt_auditor.py --file system_prompt.txt
python scripts/prompt_auditor.py --file system_prompt.txt

Audit with specific focus

Audit with specific focus

python scripts/prompt_auditor.py --text "You are a helpful assistant..." --checks injection,bias,safety
python scripts/prompt_auditor.py --text "You are a helpful assistant..." --checks injection,bias,safety

Initialize a prompt catalog

Initialize a prompt catalog

python scripts/prompt_catalog_manager.py --init --catalog-dir ./prompts
python scripts/prompt_catalog_manager.py --init --catalog-dir ./prompts

Add a prompt to the catalog

Add a prompt to the catalog

python scripts/prompt_catalog_manager.py --add --name "customer-support-v1" --file prompt.txt --catalog-dir ./prompts
python scripts/prompt_catalog_manager.py --add --name "customer-support-v1" --file prompt.txt --catalog-dir ./prompts

List all prompts in catalog

List all prompts in catalog

python scripts/prompt_catalog_manager.py --list --catalog-dir ./prompts
undefined
python scripts/prompt_catalog_manager.py --list --catalog-dir ./prompts
undefined

Tools Overview

工具概述

ToolPurposeKey Flags
prompt_auditor.py
Audit prompts for injection, bias, and safety
--file
,
--text
,
--checks
,
--format
prompt_catalog_manager.py
Manage versioned prompt catalog
--init
,
--add
,
--list
,
--diff
,
--catalog-dir
工具用途关键参数
prompt_auditor.py
审核提示词的注入漏洞、偏见和安全问题
--file
,
--text
,
--checks
,
--format
prompt_catalog_manager.py
管理版本化提示词目录
--init
,
--add
,
--list
,
--diff
,
--catalog-dir

Workflows

工作流程

Prompt Review Process

提示词审核流程

  1. Author writes or modifies a prompt
  2. Run
    prompt_auditor.py
    for automated checks
  3. Review findings and address critical issues
  4. Add approved prompt to catalog with
    prompt_catalog_manager.py
  5. Deploy from catalog (never from ad-hoc sources)
  1. 编写或修改提示词
  2. 运行
    prompt_auditor.py
    进行自动化检查
  3. 查看检查结果并解决关键问题
  4. 使用
    prompt_catalog_manager.py
    将通过审核的提示词添加到目录中
  5. 从目录部署提示词(绝不使用临时来源)

Prompt Versioning

提示词版本控制

  1. Store all prompts in catalog with semantic versioning
  2. Use
    --diff
    to compare versions before promotion
  3. Maintain audit trail of all prompt changes
  4. Roll back to previous versions when issues detected
  1. 将所有提示词以语义化版本存储在目录中
  2. 在升级版本前使用
    --diff
    比较版本差异
  3. 维护所有提示词变更的审核追踪记录
  4. 发现问题时回滚到之前的版本

Reference Documentation

参考文档

  • Prompt Governance Framework - Policies, review processes, and compliance requirements
  • 提示词治理框架 - 政策、审核流程和合规要求

Common Patterns

常见模式

Prompt Lifecycle

提示词生命周期

Draft -> Audit -> Review -> Approve -> Deploy -> Monitor -> Retire
草稿 -> 审核 -> 评审 -> 批准 -> 部署 -> 监控 -> 淘汰

Governance Checklist

治理检查清单

  • No injection vulnerabilities
  • No harmful content generation potential
  • Appropriate bias mitigation
  • Clear scope boundaries
  • Output format constraints
  • Error handling instructions
  • 无注入漏洞
  • 无生成有害内容的可能性
  • 适当的偏见缓解措施
  • 清晰的范围边界
  • 输出格式约束
  • 错误处理说明