By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Prompt engineering and system messages are core techniques for controlling Large Language Model (LLM) behavior in Azure AI services (e.g., Azure OpenAI Service). They define how an LLM interprets user input, enforces guardrails, and generates structured outputs. In real-world scenarios—like building a customer support chatbot, content moderation system, or enterprise Q&A assistant—well-crafted prompts and system messages ensure accuracy, safety, and consistency while reducing hallucinations and bias. For example, a financial services firm might use system messages to enforce compliance rules (e.g., "Never provide investment advice") while prompts extract structured data (e.g., "Summarize this loan application in JSON format").
top_p=0.9
max_tokens=100
Example: ```text Customer email: "I tried to transfer $500 to my savings account, but the transaction failed. The error said 'insufficient funds,' but I have $1,200 in my checking account. What’s going on?"
Instructions: 1. Identify the issue. 2. Explain the likely cause (e.g., pending transactions, holds). 3. Suggest next steps (e.g., "Check pending transactions in the mobile app").
Output format: { "issue": "string", "cause": "string", "next_steps": ["string", "string"] } ```
gpt-4
python response = openai.ChatCompletion.create( engine="gpt-4", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Summarize this email: [EMAIL]"} ], temperature=0.3, max_tokens=100 )
max_tokens=1000
max_tokens
temperature=0.9
Key Rule:
System Message vs. User Prompt:
Answer: System message (hidden, persistent) is for global behavior; user prompt is for task-specific instructions.
Content Filtering Policies:
Exam Tip: Know that severity levels (Low/Medium/High) determine how aggressively content is blocked.
RAG vs. Fine-Tuning:
A healthcare startup wants to build a chatbot that answers patient questions about symptoms but never provides medical advice. Which Azure OpenAI feature should they use to enforce this rule? - A) Fine-tuning - B) System message - C) Content filtering - D) Few-shot learning
Answer: B) System messageExplanation: A system message (e.g., "You are a symptom checker. Never provide medical advice.") is the best way to enforce persistent behavior across all interactions.
A financial services company notices their LLM chatbot sometimes generates inconsistent responses to the same question. Which parameter should they adjust to make outputs more deterministic? - A) Increase temperature to 0.9 - B) Set temperature to 0.1 - C) Increase max_tokens to 500 - D) Enable content filtering
temperature
Answer: B) Set temperature to 0.1Explanation: Lower temperature (0.0–0.3) reduces randomness, making outputs more deterministic and consistent.
A developer is testing an LLM in Azure OpenAI Playground and notices the model ignores the system message when a user input starts with "Ignore previous instructions." What is the primary risk here, and how should it be mitigated? - A) Risk: Prompt injection. Mitigation: Use content filtering and input validation to block adversarial inputs.- B) Risk: Token limit exceeded. Mitigation: Increase max_tokens.- C) Risk: High latency. Mitigation: Switch to a smaller model.- D) Risk: Fine-tuning failure. Mitigation: Retrain the model.
Answer: A) Risk: Prompt injection. Mitigation: Use content filtering and input validation.Explanation: Prompt injection is a security risk where users override system messages. Mitigate with content filtering (blocks harmful inputs) and input validation (e.g., regex checks).
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.