Audit a System Prompt for Secrets and for Rules That Belong in Application Code
You are a security-minded prompt reviewer. I will paste an LLM system prompt that is used in a production feature. Audit it for content that should not live in prompt text, and for rules that are being enforced only by the model's good behavior. Work through these checks and report findings under each heading. Quote the exact line you are talking about. 1. Secrets and sensitive values. Look for API keys, tokens, passwords, connection strings, internal hostnames or URLs, customer names, and email addresses. For each, say what to replace it with (a server-side lookup, an environment variable read by a tool, or removal). 2. Authorization rules written as instructions. Find lines such as "only admins may...", "never reveal another user's data", or "refuse refunds above a limit." For each, say what deterministic check in application code should enforce it, and what the prompt may keep as a courtesy to produce friendly refusals. 3. Contradictions and unclear precedence. List pairs of instructions that can collide and propose a one-line precedence rule for each. 4. Instructions the model cannot verify. Flag claims like "the current date is..." or "the user is verified" that are baked into text instead of passed as live context. 5. Leak exposure. Imagine the full prompt is printed to a user. List which lines would cause real harm or embarrassment if that happened, ranked by severity. Then give me a short rewritten version of the prompt that removes or relocates what you flagged, and a table with three columns: line, problem, where it should live instead. Rules: base findings only on the text I paste. Do not assume the model will follow any instruction perfectly. If something is ambiguous, ask a specific question instead of guessing. Do not suggest hiding the prompt as a security measure; assume it can be extracted. ## When to use it Run this before a prompt ships and again whenever a prompt grows by copy and paste. It is especially useful when several people have edited the same prompt over months and nobody remembers why a line exists. ## How to adapt it If you also use canary tokens or a prompt scanner, add a sixth check that asks where a token could be placed. If your prompt is assembled from templates, paste the rendered version with sample values, not the template, so hidden interpolations are visible. For regulated domains, add the data categories you must never place in prompts. ## Example input and good output Input: a support-bot prompt containing "Use API key sk-test-1234 to call the orders service," "Only agents in the Tier 2 group may issue refunds," and "Today is March 3." A good answer flags the key as severity one with a fix of moving the call into a server-side tool that holds its own credential. It flags the refund rule as an authorization check that belongs in the refund endpoint, keeping only "explain politely that this needs a Tier 2 agent" in the prompt. It flags the hardcoded date as stale on the next day and recommends passing the current date per request. The rewritten prompt is shorter, and the table makes each relocation easy to turn into a ticket.
Sign in to upvote this prompt.