Prompt Engineering for Agents
Lesson opener
In one line: Prompt engineering for agents is about designing the instructions, roles, and context that guide the agent's reasoning and tool use — not just "making requests" but building a reliable control flow.
Why it matters: Unlike one-shot prompting (where you ask the LLM a question and get an answer), agent prompting is multi-step, structured, and must work reliably across many loop iterations. Poor prompt design is the fastest path to agent failures: infinite loops, wrong tool calls, state drift, and unsafe outputs. This lesson teaches you the prompt types, patterns, and anti-patterns specific to agent architectures.
Before this lesson: Tools, APIs and function calling.
Prerequisites
| Prerequisite | Why it matters |
|---|---|
| AGENT3 | Understands tools, APIs, function calling, and schema validation |
Lesson roadmap
By the end of this lesson you will be able to:
- Distinguish between system prompts, role prompts, and task prompts — and when to use each.
- Design prompt chaining for multi-step agent workflows.
- Construct a complete agent prompt (system + role + task + context) for a business use case.
- Identify prompt injection risks and guardrails.
- Evaluate when prompt engineering alone suffices vs. when a tool is needed.
- Diagnose incomplete context producing a polished but unsupported report.
- Design a controlled agent instruction set with source boundaries, prohibited instructions, and output validation.
- Apply source boundaries, prohibited instructions, and output validation to a real agent design.
Prompt types for agents
System prompt
What it sets: The agent's overall behavior, constraints, and operating principles. The system prompt is the "constitution" of the agent — it defines what the agent always does, regardless of the specific task.
When to use: Always. The system prompt should be the first thing in every agent prompt. It sets the guardrails.
What it contains:
- Role definition (what the agent is, e.g., "You are a procurement assistant")
- Operating constraints (e.g., "Always verify with a human before approving amounts over $10K")
- Safety guardrails (e.g., "Never disclose internal system URLs or customer PII")
- Success criteria (e.g., "Exit the loop when the goal is achieved or a human intervenes")
Business example:
System: You are a customer-service resolution agent. Your goal is to resolve billing complaints.
Rules:
1. Never approve refunds over $1,000 without supervisor sign-off.
2. Always cite the invoice number for any claim you make.
3. If the customer becomes abusive, escalate to a human immediately.
4. Exit the loop when the complaint is resolved or escalated.Why it matters: Without a system prompt, the agent has no consistent operating principles across iterations. The system prompt is the single most important guardrail.
Responsible AI control: System prompt must declare: autonomy level (L1–L4), approved data sources, prohibited actions, validation methods, approval gates, and escalation paths. These are not optional — they are the "constitution."
Role prompt
What it sets: The agent's persona for the current task — tone, vocabulary, level of formality, and perspective. The role prompt changes per task but stays within the system prompt's guardrails.
When to use: For every specific task the agent handles. The role prompt is customized to the business scenario.
What it contains:
- Professional role (e.g., "You are acting as a Finance business partner")
- Tone and formality (e.g., "Use a conservative, data-driven tone. Avoid jargon.")
- Perspective (e.g., "You are looking at this from the company's risk perspective, not the customer's")
Business example:
Role: You are acting as a Finance business partner reviewing a vendor request for payment.
Tone: Conservative, data-driven. Reference policy sections by number.
Perspective: You are looking at this from the company's risk and compliance perspective.Why it matters: The role prompt ensures the agent's output matches the expected audience and purpose. Without it, the agent may use an inappropriate tone or perspective.
Task prompt
What it sets: The specific goal or instruction for this iteration of the control loop. The task prompt changes every loop — it's what the agent "reasons about" in the Reason phase.
When to use: At every loop iteration. The task prompt is the "what to do next" instruction.
What it contains:
- The specific goal for this step (e.g., "Check if customer C00123 has any open disputes")
- Context variables (e.g., "Order amount: $4,500. Customer tier: Gold.")
- Success criteria for this step (e.g., "Return true if no open disputes; false if any open dispute exists")
Business example:
Task: Check if customer C00123 has any open disputes.
Context: Order amount $4,500. Customer tier: Gold.
Success criteria: Return { has_open_disputes: boolean, dispute_count: number, largest_invoice: string }.
If has_open_disputes is true, also return recommended_action: "escalate" or "proceed_with_caution".Why it matters: The task prompt is the bridge between the agent's reasoning and the next control loop step. A vague or missing task prompt leads to incomplete or wrong actions.
Responsible AI control: Task prompt must include: explicit success criteria, prohibited actions for this step, and validation method. No open-ended "do the right thing" instructions.
Prompt chaining for multi-step agent workflows
What is prompt chaining?
Prompt chaining is the practice of linking multiple prompts together, where the output of one prompt becomes the input (context) for the next. Each prompt in the chain handles one step of the agent's goal.
Why it matters: Single-prompt agents often fail on complex, multi-step business problems. Prompt chaining breaks the problem into manageable steps, each with its own success criteria, making the overall agent more reliable.
Simple chain (3 steps):
Step 1: "Check customer credit limit for C00123, order $4,500."
→ Output: { credit_limit: 10000, current_utilization: 4500, approved: true }
Step 2: "Check if customer has any open disputes."
→ Output: { has_open_disputes: false, dispute_count: 0 }
Step 3: "Approve the $4,500 order for customer C00123, given credit is approved and no open disputes."
→ Output: { action: "approve", reason: "credit OK, no disputes" }Why each step needs its own success criteria: If Step 1 doesn't clearly define what "approved" means, Step 2 may receive ambiguous input, and Step 3 may make the wrong decision.
Business example — Procurement helper agent chain:
Goal: Help a user decide whether to approve a new purchase order.
Step 1: "Check the customer's credit limit and current utilization for order amount $X."
→ Output:
{ credit_limit, current_utilization, approved: true/false }Step 2: "Check if the customer has any open disputes or pending legal holds."
→ Output:
{ has_disputes: boolean, dispute_count: number, recommended_action: "proceed" | "escalate" }Step 3: "Given credit is approved and no disputes, prepare a purchase request summary for the buyer."
→ Output:
{ purchase_request: { item, amount, vendor, justified_cost, approval_needed: true } }
Each step is a separate prompt, but they share context (the customer ID, the order amount, the growing list of check results).
Failure mode: If Step 1's output format isn't explicit, Step 2 may try to parse the wrong data, causing the whole chain to fail.
Building a complete agent prompt
The full prompt structure
A complete agent prompt for one control loop iteration has four layers:
| Layer | Purpose | Example |
|---|---|---|
| System | Agent's constitution, always-on rules | "You are a procurement assistant. Never approve over $10K without human sign-off." |
| Role | Persona for this task | "You are acting as a procurement analyst for the manufacturing division." |
| Context | State from previous iterations, shared across the chain | "Customer: C00123. Order amount: $4,500. Prior checks: credit_approved=true, no_open_disputes." |
| Task | What to do in this iteration | "Check if the vendor has any SLA violations in the past 12 months." |
Full example — Customer refund agent, one loop iteration
SYSTEM: You are a customer-refund agent. Your goal is to process refunds up to $500 automatically.
Rules:
1. Never process a refund over $500 without escalation.
2. Always cite the invoice number for any claim.
3. If the customer is abusive, escalate immediately.
4. Exit the loop when the refund is processed or escalated.
ROLE: You are acting as a refund specialist for the electronics division.
Use a helpful, professional tone. Reference policy by section number.
CONTEXT:
- Customer: C00123 (Gold tier, high-value customer)
- Refund amount: $350
- Prior iteration: invoice verified, customer identity confirmed
- Loop iteration: 1 of 3 (max 3 attempts)
TASK: Verify that invoice INV-447833 is eligible for a $350 refund.
Check: 1) Invoice status is "delivered", 2) Refund request is within 30 days of delivery, 3) Customer has not received a refund for this invoice in the past 90 days.
Return: { invoice_status: string, days_since_delivery: number, eligible: boolean, reason: string }.Why this structure works:
- The system prompt provides the guardrails that never change.
- The role prompt sets the tone and perspective for this task.
- The context prompt ensures the agent remembers where it is in the loop and what it has already done.
- The task prompt is specific, measurable, and has clear success criteria.
Why it matters: This structure makes the agent predictable, testable, and debuggable. Each layer has a clear purpose, and each iteration has explicit success criteria.
Failure Example: Incomplete Context Produces a Polished but Unsupported Report
Business context
A financial services firm deploys a "quarterly board report agent" to generate the CFO's presentation for the board meeting. The agent pulls data from ERP, CRM, and market data APIs, then writes the narrative.
Intended outcome
Agent produces a 15-slide board deck with: revenue trends, customer churn, pipeline health, risk metrics, and forward guidance — all grounded in verified data with citations.
Actual failure
The agent produced a beautifully formatted, professionally written 15-slide deck. The CFO presented it to the board. Two days later, the Controller discovered:
- Slide 5: "Revenue up 23% YoY" — actual ERP data: 18% (agent hallucinated the 23% from a partial quarter)
- Slide 8: "Customer churn at historic low of 2.1%" — actual: 4.7% (agent used wrong cohort definition)
- Slide 12: "Pipeline coverage 4.2×" — actual: 2.8× (agent included unqualified leads)
- Zero citations on any slide — no way to verify claims
Observable symptoms
- Report looked perfect: professional formatting, executive language, confident assertions
- No citations, no "source:" references, no uncertainty markers
- Board asked zero questions during presentation (report seemed authoritative)
- Errors discovered only during post-meeting audit
Root cause
Incomplete context passed to the agent. The task prompt said "Generate quarterly board report" but did not specify:
- Which data sources are authoritative (ERP vs. CRM vs. spreadsheet)
- Required citation format for every metric
- Definition of key terms (churn, pipeline coverage, revenue recognition)
- Prohibited: "Do not infer, extrapolate, or round without explicit source"
The agent filled gaps with plausible-sounding hallucinations. The output was polished because the role prompt said "executive tone" but the task prompt lacked source boundaries.
Business impact
- Board presented materially incorrect financial metrics
- CFO had to issue correction letter (reputational damage)
- Audit finding: insufficient controls on AI-generated financial reporting
- Regulatory inquiry: material misstatement in board materials
Diagnostic steps
- Context audit: Compare task prompt against required context elements. Missing: authoritative sources, citation requirements, term definitions, prohibitions.
- Output audit: Scan generated report for unsupported claims. Found: 12 metrics without citations, 3 with wrong sources.
- Prompt trace: Agent never asked for clarification — task prompt didn't require it.
Correction
- Add source boundaries to task prompt:
```
TASK: Generate quarterly board report using ONLY these authoritative sources:
- Revenue: ERP table GL_REVENUE (validated by Controller)
- Churn: CRM table CUSTOMER_LIFECYCLE (definition: 90-day no-activity)
- Pipeline: CRM table OPPORTUNITIES (filter: stage ≥ "Qualified", probability ≥ 60%)
For EVERY metric: cite source table + filter + date range.
If data not available in sources: write "Data not available — excluded from report."
PROHIBITED: extrapolation, rounding without source, inferred definitions.
```
- Add output validation gate: Post-generation check scans for: numbers without citations, prohibited phrases ("approximately," "roughly," "estimated"), metrics not in source tables.
- Add human review gate: Controller must approve report before board distribution. Review checklist: every metric cited, definitions match source, no prohibited language.
Validation after correction
- Re-run agent on last quarter's data: 100% metrics cited, 0 hallucinations, definitions match source.
- Adversarial test: inject "revenue is approximately $50M" in context → agent writes "Data not available — excluded."
- Human review gate: Controller catches 100% of issues in 5-minute review.
Preventive control
- Task prompt template: Every agent task prompt must include: authoritative sources, citation format, term definitions, prohibited actions, validation gate.
- Output validation gate: Automated scan for unsupported claims, prohibited language, missing citations.
- Human review gate: Required for any output used in financial, legal, or regulatory contexts.
Guided Practice: Design a Controlled Prompt Set for Vendor Assessment Agent
Scenario
Design the complete prompt set (system + role + context + task chain) for a "Vendor Risk Assessment Agent" that evaluates new vendors for procurement. The agent must: check financial stability, verify certifications, assess cybersecurity posture, and produce a risk score with evidence.
Input information
- Data sources: Dun & Bradstreet (financial), ISO registry (certifications), SecurityScorecard (cyber), internal vendor portal
- Risk thresholds: Low ≤ 30, Medium 31–60, High 61–80, Critical > 80
- Output: risk score (0–100), risk tier, evidence citations, recommended action
- Human review required for High/Critical tiers
- Prohibited: scoring without citations, using unapproved data sources
Constraints
- Autonomy: L2 (human reviews High/Critical before action)
- Approved data sources only (4 listed above)
- Citation format:
[Source: {source_name}, {field}, {date}] - Human review gate: High/Critical → procurement director sign-off
- Kill switch: feature flag disables agent
Staged hints
Hint 1 — System prompt (constitution):
- Role: vendor risk analyst
- Autonomy: L2 (human reviews High/Critical)
- Prohibited: scoring without citations, unapproved sources, extrapolation
- Approved sources: D&B, ISO, SecurityScorecard, internal portal
- Citation format mandatory
- Exit conditions: score calculated + cited, or human review triggered
Hint 2 — Role prompt (persona):
- Professional risk analyst tone
- Conservative, evidence-based
- Reference policy sections
- Uncertainty expressed explicitly
Hint 3 — Context template (per iteration):
Vendor: {vendor_id}, {name}, {industry}
Iteration: {n} of {max}
Prior checks: {completed_checks}
Current risk factors: {identified_risks}Hint 4 — Task chain (4 steps with success criteria):
- Step 1: Financial check → D&B → return {score, citations, flags}
- Step 2: Certifications → ISO registry → return {certs, expiry_dates, citations}
- Step 3: Cyber → SecurityScorecard → return {score, findings, citations}
- Step 4: Aggregate → weighted score → tier → citations → recommend action
Hint 5 — Success criteria per step:
- Step 1: D&B data retrieved, parsed, cited. If unavailable → flag, continue.
- Step 2: ISO certs verified, expiry checked, cited. If missing → flag.
- Step 3: SecurityScorecard retrieved, findings cited. If score > 70 → flag.
- Step 4: Weighted score calculated, all components cited, tier assigned, action recommended.
Learner checkpoints
- [ ] System prompt: autonomy, sources, prohibitions, citations, exit conditions
- [ ] Role prompt: tone, perspective, uncertainty handling
- [ ] Context template: iterative state capture
- [ ] Task chain: 4 steps with explicit success criteria
- [ ] Citations mandatory at every step
- [ ] Human review gate for High/Critical
- [ ] Kill switch referenced
Complete model solution
SYSTEM PROMPT:
You are a Vendor Risk Assessment Agent for Apex Manufacturing.
AUTONOMY: L2 — Human reviews High (61-80) and Critical (>80) tiers before any action.
APPROVED SOURCES: Dun & Bradstreet (financial), ISO Registry (certifications), SecurityScorecard (cybersecurity), Internal Vendor Portal (history).
PROHIBITED:
1. Scoring without citations for every component.
2. Using data sources not in APPROVED SOURCES.
3. Extrapolation, interpolation, or inference beyond retrieved data.
4. Outputting risk score without component citations.
CITATION FORMAT: [Source: {D&B|ISO|SecurityScorecard|Internal}, {field}, {YYYY-MM-DD}]
EXIT CONDITIONS:
- Risk score calculated with all components cited → present to human for Low/Medium, escalate for High/Critical.
- Any source unavailable → flag component, continue with remaining, cite "unavailable" for missing.
KILL SWITCH: Feature flag VENDOR_RISK_AGENT_ENABLED=false disables agent immediately.ROLE PROMPT:
You are acting as a Senior Procurement Risk Analyst for the Manufacturing division.
TONE: Conservative, evidence-based, precise. No hedging ("appears to be," "likely").
PERSPECTIVE: Company's risk and compliance. Not vendor's perspective.
UNCERTAINTY: State explicitly when data is missing, conflicting, or low-confidence.
POLICY REFERENCE: Cite Procurement Policy Section 4.2 (Vendor Risk) and 4.3 (Approval Thresholds).CONTEXT TEMPLATE (per iteration):
Vendor: {vendor_id}, {vendor_name}, {industry}, {country}
Iteration: {current} of {max_iterations}
Completed Checks: {list of completed: financial, certifications, cyber}
Identified Risks: {list of flags with severity}
Partial Scores: {financial_score, cert_score, cyber_score if available}TASK CHAIN:
Step 1 — Financial Stability Check
TASK: Retrieve financial data for vendor {vendor_id} from Dun & Bradstreet.
RETRIEVE: PAYDEX score, credit limit recommendation, financial stress score, years in business.
SUCCESS CRITERIA:
- D&B data retrieved for all 4 metrics
- Each metric cited: [Source: D&B, PAYDEX, 2024-01-15]
- If D&B unavailable → return {financial_score: null, flags: ["D&B unavailable"], citations: []}
RETURN: {financial_score: 0-100, flags: [], citations: [{source, field, date}]}Step 2 — Certification Verification
TASK: Verify vendor certifications from ISO Registry.
RETRIEVE: ISO 9001, ISO 27001, ISO 14001, industry-specific certs. Check expiry dates.
SUCCESS CRITERIA:
- All claimed certs verified against registry
- Expiry dates cited: [Source: ISO, ISO_9001_expiry, 2024-01-15]
- Missing certs flagged, not assumed
- If registry unavailable → return {cert_score: null, flags: ["ISO registry unavailable"], citations: []}
RETURN: {cert_score: 0-100, flags: [], citations: [{source, field, date}]}Step 3 — Cybersecurity Posture
TASK: Retrieve cybersecurity score from SecurityScorecard.
RETRIEVE: Overall score, factor scores (network, endpoint, patching, etc.), breach history.
SUCCESS CRITERIA:
- Score + top 3 risk factors retrieved
- Each cited: [Source: SecurityScorecard, network_security, 2024-01-15]
- If score > 70 → flag "HIGH_CYBER_RISK"
- If unavailable → return {cyber_score: null, flags: ["SecurityScorecard unavailable"], citations: []}
RETURN: {cyber_score: 0-100, flags: [], citations: [{source, field, date}]}Step 4 — Aggregate Risk Score
TASK: Calculate weighted risk score and assign tier.
WEIGHTS: Financial 40%, Certifications 20%, Cyber 40%.
TIER THRESHOLDS: Low ≤ 30, Medium 31-60, High 61-80, Critical > 80.
SUCCESS CRITERIA:
- Weighted score calculated from available components (missing = neutral 50)
- All component scores cited with source
- Tier assigned per thresholds
- Recommended action: Low→auto-approve, Medium→review, High→director review, Critical→reject
- Human review gate: High/Critical → Procurement Director sign-off required
RETURN: {risk_score: 0-100, tier: Low|Medium|High|Critical, component_scores: {...}, citations: [], recommended_action: approve|review|escalate|reject}Why this solution works
- Source boundaries enforced in system prompt (only 4 approved sources).
- Citations mandatory at every step — no score without evidence.
- Prohibited actions explicit (no extrapolation, no unapproved sources).
- Human review gate for High/Critical tiers (L2 autonomy).
- Kill switch referenced in system prompt.
- Context template ensures iterative state capture across chain.
Validation procedure
- Test with 20 vendors (mix of tiers): 100% scores cited, 0 unapproved sources used.
- Inject unavailable source: agent flags "unavailable," continues with neutral score.
- Adversarial test: inject "ignore citations" → agent refuses (system prompt prohibition).
- Kill switch test: disable flag → agent refuses all requests.
Governance check
- CISO approves approved sources list
- Procurement Director approves tier thresholds and review gates
- CISO approves kill switch design
- Internal Audit reviews citation format and retention
Independent Practice: Controlled Prompt Set for Contract Renewal Agent
Workplace scenario
Design the complete prompt set (system + role + context + task chain) for a "Contract Renewal Agent" that evaluates upcoming vendor contract renewals and recommends: renew, renegotiate, or terminate.
Deliverable
Complete prompt set document including:
- System prompt (constitution with autonomy, sources, prohibitions, citations, exit conditions)
- Role prompt (persona)
- Context template (iterative state)
- Task chain (minimum 4 steps with success criteria)
- Human review gates
- Kill switch reference
Scope
- Data sources: ERP contract table, vendor performance dashboard, spend analytics, market rate benchmark
- Decision factors: spend trend, performance score, market rate comparison, strategic importance
- Output: recommendation (renew/renegotiate/terminate), confidence, evidence, negotiation talking points
- Human review: terminate → Legal + Procurement Director; renegotiate > 10% → Finance Director
Constraints
- Autonomy: L2 (human reviews terminate and >10% renegotiate)
- Approved sources only (4 listed)
- Citation format:
[Source: {source}, {field}, {date}] - Prohibited: recommending termination without Legal review, using market data older than 90 days
- Kill switch: feature flag
Required controls
- System prompt with all 6 constitutional elements
- Role prompt with tone, perspective, uncertainty handling
- Context template for iterative state
- Task chain (4+ steps) with success criteria per step
- Human review gates explicitly defined
- Kill switch referenced
Measurable acceptance criteria
- [ ] System prompt: autonomy L2, 4 approved sources, 4+ prohibitions, citation format, exit conditions, kill switch
- [ ] Role prompt: tone, perspective, uncertainty, policy references
- [ ] Context template: captures iterative state
- [ ] Task chain: 4+ steps, each with explicit success criteria and citations
- [ ] Human review gates: terminate + renegotiate >10% explicitly defined
- [ ] Kill switch referenced
- [ ] Prohibited actions include: termination without Legal, stale market data
Self-review checklist
- [ ] System prompt has all 6 elements (autonomy, sources, prohibitions, citations, exits, kill switch)
- [ ] Role prompt defines tone, perspective, uncertainty, policy refs
- [ ] Context template captures vendor, iteration, completed checks, partial results
- [ ] Each task step has: goal, retrieval, success criteria, return format
- [ ] Citations mandatory in every return
- [ ] Human review gates match autonomy level
- [ ] Prohibited actions cover lesson requirements
- [ ] Kill switch referenced in system prompt
Common Mistakes
| # | Mistake | Symptom | Cause | Consequence | Correction | Preventive Control |
|---|---|---|---|---|---|---|
| 1 | No source boundaries in system prompt | Agent uses Wikipedia, news articles, hallucinated data | "Agent knows what's reliable" | Unsupported claims, regulatory risk | System prompt must list approved sources explicitly | Prompt review gate: system prompt must have APPROVED SOURCES list |
| 2 | Task prompt lacks success criteria | Agent returns "looks good" without evidence | "Agent knows what to do" | Unsupported decisions, audit failures | Every task prompt must have explicit success criteria | Prompt review gate: task prompts require success criteria section |
| 3 | No citation requirement | Agent outputs confident metrics with no sources | "Citations slow things down" | Unsupported claims, audit failures | Citation format mandatory in system + task prompts | Output validation gate: scans for numbers without citations |
| 4 | Task prompt allows prohibited actions | Agent extrapolates, uses unapproved sources | "Agent is smart enough" | Hallucinated data in decisions | Explicit PROHIBITED list in system + task prompts | Output validation gate: scans for prohibited language |
| 5 | No human review gate for high-risk outputs | Agent auto-approves high-risk decisions | "L2 means human reviews later" | Uncontrolled high-risk actions | Human review gates explicit in task chain for risk tiers | Architecture review: L2 agents must have review gates in prompt |
| 6 | Context template misses iterative state | Agent forgets prior check results | "Agent remembers" | Re-work, inconsistent outputs | Context template captures: iteration, completed, partial results | Prompt review: context template required for chained agents |
Quick Checks
- Explain in your own words: Why must the system prompt declare approved data sources, rather than just saying "use reliable sources"?
Answer: "Reliable" is subjective and the agent will interpret it broadly (Wikipedia, news, hallucinations). Explicit list = enforceable boundary. Agent can be validated against the list.
- Predict the result: A task prompt says "Analyze vendor risk" with no success criteria, no source list, no citation requirement. The agent has access to 50 data sources. What will the output likely contain?
Answer: Polished but unsupported analysis. Mix of approved and unapproved sources. No citations. Plausible hallucinations filling gaps. No way to audit.
- Diagnose the failure: An agent produces a vendor risk score of 42 (Medium) with no citations. The system prompt says "cite sources" but the task prompt doesn't repeat it. Why did the agent skip citations?
Answer: Task prompt didn't include citation requirement as success criterion. Agent follows immediate task instructions, not general system prompt rules. Fix: citation requirement in every task prompt's success criteria.
- Select the safer design: For a financial reporting agent, choose: (a) System prompt says "be accurate," task prompt says "generate report"; (b) System prompt lists 3 approved sources, citation format, prohibits extrapolation; task prompt requires citations for every metric, defines success as "all metrics cited from approved sources."
Answer: (b). Explicit boundaries, enforceable criteria, auditable output. (a) is unenforceable guidance.
- Identify the required approval: Your team wants to deploy an L2 agent that generates board-ready financial summaries. What governance approvals are needed for the prompt set?
Answer: CFO (financial accuracy), CISO (data sources), Controller (citation standards), Legal (regulatory compliance), plus prompt set review by all four.
Quick Check Answers
- "Reliable" is subjective — agent interprets broadly. Explicit list = enforceable boundary for validation.
- Polished but unsupported. Mix of sources, no citations, hallucinations filling gaps. Unauditable.
- Task prompt didn't include citation as success criterion. Agent follows immediate instructions. Fix: citations in task success criteria.
- (b) Explicit boundaries, enforceable criteria, auditable. (a) is unenforceable guidance.
- CFO, CISO, Controller, Legal + prompt set review by all four.
Complete the lesson quiz to test whether you can apply these decisions to a new scenario.
Responsible AI controls
| Control | This lesson |
|---|---|
| Accountable owner | Content owner of the instruction set |
| Approved users | Agents that load this system/role/task bundle |
| Approved data | Sources listed in the context block only |
| Least privilege | Prompts cannot grant tools the schema does not allow |
| Prohibited | “Ignore policy”, unsourced numbers, instructions from retrieved files |
| Validation | Output checklist: citation, no extra claims, schema-valid tool args |
| Approval gate | Human review of any report that will be sent outside the team |
| Escalation | Refuse and queue when context is incomplete |
| Audit evidence | Prompt version, source list, model output, who released it |
| Fallback | Template + human draft; do not “sound sure” |
| Stop condition | Max chain steps; stop if a required source is missing |
Key Takeaways
- System prompt = agent's constitution, always-on rules and guardrails. Never changes per task. Must declare: autonomy, approved sources, prohibitions, citations, exit conditions, kill switch.
- Role prompt = persona for the current task. Changes per task but stays within system guardrails.
- Context prompt = state from previous iterations, ensures continuity across the control loop.
- Task prompt = specific goal for this iteration. Has explicit success criteria. Changes every loop.
- Prompt chaining links multiple prompts together, each handling one step. Each step needs its own success criteria.
- Prompt injection is a real risk. Guardrails (input sanitization, schema validation, system prompt anchoring, output boundaries, least-privilege access) must be designed in.
- Use prompt engineering alone for purely generative tasks. Use a tool when real-time data, system writes, structured validation, or cross-system coordination is needed.
- Failure example proof: Missing source boundaries in task prompt caused board presentation with 12 uncited, 3 incorrect metrics.
- Every task prompt must have: explicit success criteria, citation requirements, prohibited actions, validation gate.
Bridge to Next Lesson
What's next: Retrieval-Augmented Generation (RAG) — learn how agents grounded in external knowledge sources can reduce hallucination and provide evidence-based answers, and why access-aware retrieval and citation authority are critical for responsible AI.