Five parts
Role and task: one sentence on what to do, for example "answer the customer question about filing materials using the policy text below".
Source material: wrap retrieved passages in clear delimiters so the model distinguishes evidence from instructions.
Hard constraints: no fabrication, state when the material is silent, length limits, no absolute marketing claims.
Output format: give field names and an example. That is far more effective than asking for JSON in prose.
Examples beat adjectives
Saying "answer professionally" means nothing. One compliant example aligns style immediately.
Include a positive example, and where useful a negative one showing what is not acceptable.
Iterating
Change one variable at a time and measure with the evaluation set. Changing three at once makes results unattributable.
Version prompts and bind them to production releases so you can roll back to the previous version.
FAQ
Are longer prompts better?
No. Length dilutes emphasis and raises cost. Keep necessary constraints, delete filler.
Results vary between runs. What now?
Lower randomness, tighten output format, add examples. If it still varies, the task itself is under-specified.
Should all business rules live in the prompt?
Critical ones yes, but anything rule-based should be code. Prompts are not a business logic container.
Related questions
Further reading
- System Redevelopment Service details
- Legacy system redevelopment handover checklist: five steps from inventory to launch
- What compliance checks are needed before AI-generated content goes live? A checklist to go through item by item
- Which scenarios are not suitable for enterprise AI transformation? Hold off on these types
- Should a Timed-Out API Call Be Retried
Sources & References
The following are public sources. Always check the latest requirements on the official authority or platform page.
