A system prompt can describe task boundaries, response format, and tool-use intent. It is not a confidential storage location or an access-control layer. Users may probe for its contents, and the model may quote or paraphrase parts of its instructions. Keep credentials, hidden customer data, and permission decisions outside the prompt. A tool call should be checked against the authenticated principal, action, object, and current state by the application. If prompt wording leaks, the primary security question is whether the disclosed text grants any capability or exposes a secret that should never have been there.
System prompts: treat instructions as guidance, not a secret vault
Decision in practice
A team embeds a service token and a list of administrator accounts in a long system message for a support bot, then asks it not to reveal them. A curious user requests the bot's setup. Even if most replies refuse, one paraphrased answer could expose the token. The fix is to remove the token, rotate it, and bind tool credentials in the server runtime. The prompt can still say that account exports require verification. The export endpoint enforces that rule against the user's session, so disclosure of the wording cannot authorize an export.
Prompt: task, response schema, permitted tool intent.
Server: credentials, account ownership, export authorization.
Tool call: verify principal + action + object + current state.
Test: prompt disclosure attempt cannot reveal a credential.
Test: copied prompt text cannot grant export access.Performance and operating cost
Moving permissions to a server check adds a lookup or policy evaluation per effect, generally O(1) with indexed account data, though remote authorization calls add latency. This cost is small compared with a private-data breach or wrong-account action. Shorter prompts also avoid paying tokens for secret material that should not be there. Evaluate prompt-disclosure attempts, but do not confuse a model's refusal rate with proof of server security. A check must fail closed when the session or object scope cannot be verified.
Common Mistakes
- Do not put credentials or customer lists in the system prompt.
- Do not treat hidden prompt wording as an access-control mechanism.
- Do not let a tool trust the model's claim that a user is authorized.
Connected lessons
- Production prompt engineering
- Prompt Engineering
- Instruction conflicts: resolve authority before wording
- Tool calls: validate intent and arguments before an external effect
- Secrets and configuration across the delivery path
- Request risk routing: classify the action before choosing a response
- Refusal contracts: decline the unsafe effect and preserve useful help
- Sensitive output gates: check the rendered answer before release
- High-impact advice: route uncertain decisions to qualified review
- Project: build a support safety boundary
- Prompt safety decisions
