AI for IT Certification
Aware · M91 · lesson 91 of 120 · queued
Preview — browse every lesson free. Enroll to mark lessons complete, open partner links and save your progress. Login & enroll →
Prompting Basics For It Professionals
📖
now learning

Prompting Basics For It Professionals

15 min

Hook

You've got a firewall rule that's blocking legitimate traffic, and the vendor's documentation is vague. You ask an AI for help and get back a config that references a flag that doesn't exist in your version. Or worse. It works, but you have no idea why, and six months later you're staring at it wondering if it's still doing what you need. The difference between getting useful technical output and wasting an hour chasing nonsense isn't luck. It's how you ask the question.

Purpose

This lesson teaches you how to write prompts that get AI to produce technical output you can actually use, configs, scripts, documentation, troubleshooting steps, without building in ambiguity that gets you an answer to the wrong question. You'll learn the anatomy of a strong technical prompt: what goes in, why it matters, and how to structure it so AI understands the constraints of your environment before it starts generating solutions.

Why This Matters for IT Professionals

Your job involves making decisions based on information. When you use AI to help, the quality of that information depends entirely on how clearly you've described the problem. A sloppy prompt gets you a sloppy answer. A structured prompt gets you something you can evaluate and use.

In IT Operations, you can't afford to run a config on production and find out later it doesn't work the way you thought. You can't write a script that breaks the build pipeline because it was written for a different OS than you're running. You can't publish a knowledge base article that gives end users wrong instructions and look trustworthy afterward.

The stakes are real. But so is the upside: when you learn to prompt well, you compress the time between "I have a problem" and "I have a working solution" from hours to minutes. You build institutional knowledge faster. You document things while the context is fresh. You make fewer mistakes.

Core Concepts

Key Insight: The Anatomy of a Strong Technical Prompt

A strong prompt has four layers:


  • Instruction: The specific action you want AI to take. Not "tell me about firewalls", "write a pfSense rule that blocks traffic from VLAN 5 to VLAN 8."

  • Context: The details AI needs to understand the constraints. Your infrastructure, versions, requirements, existing configuration. "We're running pfSense 2.7, Gigabit connection, 500 concurrent connections typical."

  • Constraints: The limits and boundaries. "No third-party plugins, only built-in pfSense features. Must work with hardware redirection disabled. Should preserve existing nat rules."

  • Output Format: How you want the answer structured. "Provide the rule in pfSense XML format with comments explaining each attribute. Include a test plan."

Vague prompts skip layers 2 and 3. They get vague answers. Specific prompts are harder to write, but they get answers you can use.

Key Insight: Context is Where Most Prompts Fail

The biggest difference between a prompt that works and one that doesn't is context. An AI doesn't know your environment. It doesn't know which vendors you use, which versions you're running, which tools you prefer, whether you're in a regulated industry, whether you have budget constraints. You have to tell it.

For an IT task, always include:

  • Software versions: Not "Kubernetes", "Kubernetes 1.28 on RHEL 8.9."
    - Architecture context: "Three-node cluster, 32GB RAM per node, storage provisioner is Longhorn."
    - Existing infrastructure: "We already use Helm for package management; prefer Helm charts over raw YAML."
    - Constraints: "No internet access for downloads. Can't use any images outside our private registry."
    - What you've already tried: "We attempted to use the default ingress controller but hit resource limits."

Without context, AI guesses. With context, it builds on what you've already done.

Key Insight: Constraints Prevent Wasted Answers

A constraint is something the answer must satisfy. "This solution must not require new hardware" or "must use only PowerShell, no C#" or "must complete in under 30 seconds."

Constraints save you time by eliminating answers that don't fit. They also force you to think about what you actually need, not just what's possible. A solution that's technically perfect but requires a budget approval you don't have is worthless.

Common IT constraints:

  • "Use only tools already installed."
  • "Must not interrupt running services."
  • "Must be automatable; no manual steps."
  • "Must work offline (no external API calls)."
  • "Must use the company's existing Active Directory integration."

Key Insight: Structured Output Formats Save You Interpretation Work

How you ask for the answer shapes how useful it is. "Explain how to set up a backup" gets you prose that you have to parse. "Provide the backup configuration in YAML format with inline comments" gets you something you can read into a tool.

For IT work, ask for:

  • Code or configs: "Provide the answer as a Terraform module with variables for environment-specific values."
  • Structured data: "Return as a markdown table with columns: Metric, Current Value, Target Value, Action."
  • Decision trees: "Show as a flowchart or numbered decision steps, not prose."
  • Lists and checklists: "Provide as a numbered checklist so I can track completion."

Key Insight: Explicit Failures Are Better Than Plausible Guesses

The worst answer AI can give is one that looks right but isn't. An IT professional reads a config and thinks "this looks reasonable" without testing it, deploys it to production, and discovers later it doesn't work the way they expected.

To reduce this risk, ask AI to:

  • Explain assumptions: "List any assumptions you've made about our environment."
  • Flag uncertainties: "Mark any commands or syntax you're not 100% confident about."
  • Provide test steps: "Include a section on how to test this before deploying to production."
  • Call out version-specific details: "Note which Kubernetes versions this works with and what changes are needed for other versions."

This shifts AI from "confident guesser" to "informed assistant that knows the limits of its knowledge."

Key Insight: Iteration Beats Perfection on the First Ask

You rarely nail a prompt perfectly the first time. Treat prompting like you treat any other technical work: ask for version 1, evaluate it, ask a follow-up question, refine. AI is fast enough that this iteration doesn't cost you time.

First prompt: "Write a Bash script to check disk usage."

Evaluation: You notice it only works on Linux with specific tools, not BSD or older systems.

Follow-up: "Revise this script to work on both Linux and BSD systems, and handle systems that don't have the df command."

This is faster than trying to write the perfect prompt on the first ask.

Practical Use Cases

Use Case 1: Troubleshooting a Configuration Problem

Before AI: You have a DNS resolution issue. You search the vendor docs, check forums, try a fix, it doesn't work. An hour later you're still troubleshooting with partial information.

With AI:

I have a DNS resolution issue on our Windows Server 2022 domain controller running BIND 9.18.
Clients can resolve internal records (AD-integrated zones) but not external records (forwarded zones).
Forwarders are configured: 8.8.8.8 and 1.1.1.1.
Query logs show the forwarders are being contacted, but responses aren't being cached.
Event Viewer shows no errors.
Server has 16GB RAM, typical query load is 500/sec.

Task: Provide a diagnostic checklist in order of likelihood. For each step, give the exact command to run and what a correct output should look like. Flag any known issues in BIND 9.18 that might cause this behavior.

Constraints:
- No code changes or recompilation.
- Must not interrupt existing services.
- We're running in a domain environment with Group Policy, so registry changes should be documented.

Outcome: AI understands your exact situation (Windows Server, BIND version, zone type, what you've already checked) and gives you a checklist in the right order rather than generic "try rebooting the DNS server" advice.

Time saving: 45 minutes to 10 minutes.

Use Case 2: Writing a Network Configuration Script

Before AI: You write the script yourself from scratch. Or you find a sample online, modify it, test it, debug it.

With AI:

Write a Bash script for our RHEL 9 servers that:
1. Checks if bonding is available (ethtool, ip link commands)
2. Configures eth0 and eth1 as a bonded interface (bond0) using mode=active-backup
3. Assigns a static IP (192.168.10.0/24) via NetworkManager (not ifcfg files)
4. Verifies the bond is up and both slaves are active
5. Logs all steps to /var/log/bond-config.log with timestamps

Constraints:
- Must be idempotent (safe to run twice)
- No external tools beyond what comes with RHEL 9 base install
- Must handle the case where the interfaces are already bonded
- Include error handling for missing devices

Output format: Provide the script with numbered comments at each section. Below the script, provide a test plan showing exactly how to verify each step works, and a rollback procedure.

Before AI: You write and debug this over 1-2 hours, then test it and find edge cases.

With AI + 30 minutes of your review and testing: You have a working script that handles common edge cases because you asked for idempotency and error handling explicitly.

Time saving: 2 hours to 1 hour (including your review).

Use Case 3: Generating Documentation from Tribal Knowledge

Before AI: You spend 3 hours writing up "how we handle a full disk" from memory, trying to remember all the steps, cross-referencing with your notes, sending it around for feedback.

With AI:

Here's a transcript of a recent incident where we resolved a full /var disk on a production Linux server:

[Paste the Slack conversation or your incident notes here]

Task: Convert this into a knowledge base article with sections:
1. Symptoms (what users see, what logs show)
2. Root cause (what filled the disk)
3. Diagnostic steps (in order, with exact commands and output to expect)
4. Resolution (step-by-step, including what NOT to do)
5. Prevention (configuration changes to prevent recurrence)
6. Escalation criteria (when to call senior ops)

Output format: Markdown with code blocks. Assume readers are Linux-competent but may not be experts on our specific setup.

Constraints:
- Keep it under 1500 words
- Don't include sensitive data (IP addresses, customer names)
- Every command must work on RHEL 8 or later

Before AI: 3 hours of you writing, 2 rounds of feedback from the team.

With AI + 30 minutes of your edit: A solid first draft that saves the team 2 hours of Q&A about this problem in the future.

Time saving: 3 hours now, 5+ hours saved across the team over the next year when people can self-serve instead of asking.

Examples

Example 1: Ticket Summarization

Scenario: You inherit a ticket from a colleague. It has a wall of text: customer complaint, troubleshooting steps, false starts, configuration snippets, chat logs. You need to figure out what the actual problem is and what's already been tried.

Weak prompt:

Summarize this ticket
[paste 2000 words of back-and-forth]

What you get: A summary that's still 800 words and doesn't clarify the core issue. AI tried to capture everything because you didn't tell it what matters.

Strong prompt:

Below is an IT support ticket with customer messages, troubleshooting steps, and config attempts.

Task: Extract and clearly state:
1. What the customer's actual problem is (symptom, not speculation)
2. What has already been tried and the result of each attempt
3. What was NOT tried (i.e., the next logical steps)
4. Any red flags or important details (permissions, architecture constraints, etc.)

Output format: Provide this as a markdown list with bold headers. Keep it to 300 words max.

[paste ticket]

What you get: A clear, actionable breakdown. You know the problem, what's been tried, and what to do next.

Issue avoided: You almost deployed a "fix" that the customer had already tried and didn't work. The strong prompt surfaced this.

What you must do: Read this output and verify it matches your understanding of the ticket. If AI missed something, ask a follow-up: "The ticket also mentions they restarted the service twice. Why would that matter here?"

Lesson: Context and output format matter more than prompt length. A 50-word prompt with structure beats a 200-word rambling prompt.

Example 2: Firewall Rule Generation

Scenario: You need to write a pfSense rule to allow your monitoring system (IP: 10.50.1.10) to reach your web servers (10.10.0.0/24) on port 443, but only from your monitoring VLAN (VLAN 50). You've never written a pfSense rule before.

Weak prompt:

How do I write a pfSense rule for monitoring?

What you get: Generic advice about port forwarding or NAT rules. Not what you need. AI guessed at what kind of rule you wanted.

Strong prompt:

I'm using pfSense 2.7.2 running on a Netgate 3100 appliance. We have:
- Monitoring server: 10.50.1.10 (VLAN 50 - "Monitoring")
- Web server subnet: 10.10.0.0/24 (VLAN 10 - "Production")
- Both VLANs are isolated; we need an explicit rule to allow this traffic

Task: Write a firewall rule that allows HTTPS (port 443) from the monitoring system to any web server.

Constraints:
- Use only built-in pfSense features; no packages or aliases needed yet
- Keep it to a single rule (no complex logic)
- Comment it clearly so others understand why it exists
- Note: We currently have a default-deny policy between VLANs

Output format: Provide the rule in pfSense XML format (copy-paste ready), plus a plain-English explanation of what each attribute does. Also: how do I test this worked, and how do I add logging to see the traffic?

What you get: A working rule in a format you can import, an explanation so you understand it, and test steps so you can verify it works without guessing.

Issue avoided: You almost applied a rule that would have blocked return traffic because you didn't specify stateful inspection, which you need for HTTPS.

What you must do: Test the rule in non-production first. Ping and curl from the monitoring system to one web server. Check the firewall logs to confirm traffic is being allowed.

Lesson: Version specificity and constraint clarity prevent "it should work" solutions. Ask for output format and testing steps upfront.

Example 3: PowerShell Script for Mass User Provisioning

Scenario: You need to create 50 new user accounts in Active Directory with consistent settings: same group memberships, same home directory location, same profile path. You want to automate it but be cautious about errors.

Weak prompt:

Write a PowerShell script to create AD users

What you get: A script that creates a user with bare minimum properties. Doesn't handle your specific requirements, error cases, or logging.

Strong prompt:

I need a PowerShell script to bulk-create 50 Active Directory user accounts. Our environment:
- Windows Server 2022 with AD 2022
- User source data: CSV file with columns [FirstName, LastName, Department, Email, EmployeeID]
- All users should be added to these groups: "Domain Users", "[Department]-Users", "Office-Staff"
- Home directory location: \\fs01\homes\[username] (create folder if doesn't exist)
- Profile path: \\fs01\profiles\[username]
- UPN suffix: @company.corp
- Account disabled until HR confirms (Enabled = $false initially)
- Users should not change password on first logon (PasswordNotRequired = $false, but set temp password)

Constraints:
- Must be safe to test with 5 users first, then run with full 50-user list
- If a user already exists, skip them (don't error out)
- Log all actions (success and failures) to a timestamped file
- No external dependencies; only built-in AD cmdlets
- On failure, roll back cleanly (don't leave half-created users)

Output format: Provide the script with inline comments explaining each section. Include separate sections for:
1. Parameter validation (CSV file exists, columns are correct)
2. The create-user loop with error handling
3. Logging and summary (how many succeeded, how many failed, why)

Also provide a test CSV sample and step-by-step testing instructions.

What you get: A production-ready script that handles your exact requirements, includes error handling, is idempotent (safe to rerun), and logs everything so you can audit what happened.

Before AI: You'd write this over 4-6 hours, debug it, test with a small group first, then fix issues that come up.

With AI + 1 hour of your review and testing: You have a solid script that's already thought through error cases because you asked for them explicitly.

What you must do:

  1. Test with 5 users from your CSV before running the full batch.
  2. Verify that folder creation works and has correct permissions.
  3. Check that group memberships are correct post-creation.
  4. Audit the log file to confirm all steps were recorded.

Issue avoided: You almost added all users to a group that you shouldn't have, because you didn't specify which groups in your strong prompt. With the detailed requirements, AI got it right.

Lesson: The more specific your constraints and requirements, the fewer post-delivery corrections you need. Spend 10 minutes on a detailed prompt; save 2 hours on fixes.

Anti-Patterns

Anti-Pattern 1: Asking for Generic Advice When You Need Specific Output

Don't ask: "How do I set up monitoring?"

Ask: "Write a Prometheus scrape config for a Linux server running Prometheus 2.47, with 5-second scrape intervals, targeting three Apache servers at 10.1.1.1, 10.1.1.2, and 10.1.1.3 on port 9100."

The specific ask gets you a scrape config you can use. The generic ask gets you a blog post about monitoring philosophies.

Anti-Pattern 2: Skipping Version and Architecture Context

Don't ask: "Write a Bash script to check disk usage."

Ask: "Write a Bash script for RHEL 9 servers (we don't have older systems) that checks each mount point and alerts if any are over 85% full."

Without version context, AI might include flags that don't exist in your version, or recommend tools you don't have.

Anti-Pattern 3: Asking for a Solution Without Saying What You've Already Tried

Don't ask: "Our Kubernetes cluster is running slow. Help."

Ask: "Our 10-node Kubernetes 1.28 cluster on AWS is running slow. Metrics show CPU at 30%, memory at 45%, network at 20%. We already upgraded the worker node type from t3.xlarge to t3.2xlarge, which didn't help. We have no HPA rules configured. What should we check next?"

Knowing what you've tried prevents AI from suggesting the same thing twice.

Anti-Pattern 4: Not Specifying Output Format

Don't ask: "Explain how to troubleshoot a DNS issue."

Ask: "Provide a DNS troubleshooting checklist as a numbered list of steps. For each step, show the exact command to run and what a successful output looks like. Format as a markdown table with columns: Step, Command, Expected Output."

The first gets you prose. The second gets you a checklist you can actually use while troubleshooting.

Anti-Pattern 5: Ignoring Constraints Until After You Get the Answer

Don't ask: "Write a backup script" and then realize "Oh, we can't use external tools, only built-in stuff."

Ask upfront: "Write a backup script using only tar and rsync (no Bacula or Veeam). Must complete in under 1 hour. Must not interfere with running services. Must be resumable if it gets interrupted."

Good constraints upfront prevent wasted work.

Human Judgment Checkpoints

Before you deploy or implement an AI-generated answer, ask yourself:


  • Does this match my environment? Version numbers, OS, tools, do they align with what I actually run? If not, the answer is probably not safe to use as-is.

  • Are there commands or flags I don't recognize? If AI used a flag or tool you've never seen, verify it exists in your version before you run it. This is where AI can be confidently wrong.

  • Does this match what I already know about our constraints? If AI suggested a solution that contradicts a budget, compliance, or architecture constraint you know about, that's a red flag.

  • Can I test this before production? If the answer is "no, it has to work first try," be more cautious. That's when you should validate every detail.

  • Do I understand why this works? If you can't explain the answer to a colleague, you don't understand it well enough to defend it if something goes wrong.

  • What's the rollback plan if this breaks something? If you can't articulate how to undo this change, don't deploy it yet. Ask AI for a rollback procedure.

Key Takeaways

  • Structure your prompt like you structure your technical decisions: instruction, context, constraints, output format. Vague prompts get vague answers.
    - Context is the biggest differentiator. Tell AI about your versions, tools, existing infrastructure, and what you've already tried.
    - Constraints aren't limitations; they're efficiency. They focus the answer on solutions you can actually use.
    - Specify output format (scripts, configs, tables, checklists) to get answers you can directly use instead of having to interpret prose.
    - Iteration beats perfection on the first ask. Treat prompting like you treat any technical work: version 1, evaluate, iterate.