AI agents and models Required
Keep secrets out of the system prompt
Write the system prompt as if it will be published. It holds no keys, passwords, internal addresses or private rules.
How to do it
Keep keys in the server code that runs the tools. Models can be talked into repeating their instructions, so a leak of the prompt must cause no harm. Put rules that matter in code, as in direct prompt injection.
How to check
Ask the model to repeat its instructions word for word, in a few ways. Search the reply and the prompt file for keys and internal addresses. None are found.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers security testing playbook: https://agentwranglers.se/playbook/adversarial-testing/ai-agents-and-models/no-secrets-in-prompt.