500 từ
3 phút đọc
Prompt Engineering 2026: Production Patterns & Anti-Patterns — Banking, SaaS và Dev Tools
Đây là prompt engineering trông như thế nào khi có real money, real users và real compliance requirements.
Sau 4 bài về mechanisms (system prompts, steering files, agent instructions), hidden prompt (MCP tools), formats (structured prompting) và evaluation pipeline — giờ chúng ta đặt tất cả cùng nhau với production patterns từ 3 domain.
Domain 1: Banking & Fintech
Pattern: Audit-Trail Prompting
class BankingAgent: def run(self, query): response = self.agent.run(f""" <task>{query}</task> <compliance_rules> - Không process transactions > $10,000 không verification - Không share account details người khác - Mọi response phải có disclaimer </compliance_rules> <audit_required> Giải thích reasoning (customer sẽ không thấy): - Dùng thông tin gì? - Compliance rules nào áp dụng? - Đã verify identity chưa? </audit_required> """) self.audit_log.append({"response": response, "compliance_check": verify(response)})Pattern: Progressive Identity Verification
verification_levels = { "balance_check": {"name", "last_4_digits"}, "transfer": {"full_ssn", "2fa_code", "device_verification"},}Domain 2: SaaS Customer-Facing Agents
Pattern: Empathy-First Escalation
Response structure: Acknowledge → Diagnose → Resolve → Confirm.
- User frustrated (caps, swears) → skip diagnosis
- Can’t resolve in 3 messages → escalate
- Never make user repeat info
Pattern: Progressive Onboarding
onboarding_stages = { "welcome": "Be warm. Don't mention billing yet.", "power_user": "Skip basics. Offer API access.", "churning": "Be proactive but not pushy.",}Domain 3: Dev Tools & Internal Agents
Pattern: Read-Then-Write Guard
dev_agent = Agent(instructions="""Mandatory workflow:1. ALWAYS read file first2. ALWAYS check existing tests3. ALWAYS run tests after changes4. NEVER overwrite without reading5. NEVER deploy on Friday after 2 PM""")12 Anti-Patterns
- Everything System Prompt — 2,500 words → Giữ ≤ 200 từ
- Giấu critical rules — Rule quan trọng ở paragraph 47/83 → Đưa lên đầu
- Silent Failure — Agent quyết định không làm nhưng không nói lý do
- Instructions giống nhau cho agents khác nhau — Mỗi agent cần unique instructions
- Không steering file — Project rules trong system prompt static
- Prompt có thể là tool — “Calculate total…” → Viết tool
- Over-specifying output format — 47 fields → JSON valid nhưng content hallucinated
- Không evaluation baseline — “It felt better” → Đo lường
- Prompt changes không PR — Tweak production → 2h sau P0 incident
- Ignore token budget — 60K tokens consumed, 12K left cho conversation
- One prompt cho tất cả — New users vs power users vs admins khác nhau
- Không rollback plan — “Broken nhưng không có old version”
Prompt Engineering Manifesto 2026
- Prompts là code. Version, test, review.
- Steering files > system prompts. Project rules trong repo.
- Tools là prompts. Tool descriptions steer behavior hơn instructions.
- Structure output. JSON schemas, Pydantic prevent parse failures.
- Test before deploy. LLM-as-judge không perfect nhưng tốt hơn nothing.
- Rollback là feature. Mọi prompt change phải reversible.
- Context finite. Mỗi token trong prompt là token không available cho reasoning.
- Agents cần prompts khác nhau. One prompt cho tất cả = sai 9/10 lần.
- Critical rules đầu tiên. Safety, compliance, must-follow rules ở top.
- Khi nghi ngờ, thêm tool. Prompts instruct; tools enable.
Series Recap
| Bài | Chủ đề | Key Takeaway |
|---|---|---|
| 1 | System Prompts vs Steering Files vs Agent Instructions | Three layers, khác concerns |
| 2 | MCP Tools as Prompts | Tool definitions là instructions |
| 3 | Structured Prompting | XML, JSON, CoT, output types |
| 4 | Prompt Testing & Evaluation | LLM-as-judge, versioning, regression |
| 5 | Production Patterns & Anti-Patterns | Banking, SaaS, dev tools, 12 anti-patterns |
Series: Prompt Engineering 2026 — Production Patterns. Hoàn thành 5 bài.
Tiếp theo: muốn khám phá gì?
Advertisement
Prompt Engineering 2026: Production Patterns & Anti-Patterns — Banking, SaaS và Dev Tools
https://minixium.com/vi/posts/prompt-engineering-production-patterns-anti-patterns-banking-saas-devtools-vi/ Advertisement