Picture this war room.
The CFO has seen three vendor demos. The CMO wants a “customer agent” by quarter-end. Security wants a kill switch. A junior engineer has wired GPT to Salesforce with a service account that can update every Case. Someone says the word Agentforce. Someone else says RAG. Everyone nods. Nobody owns the failure mode.
If you are an applied AI architect, this is your job interview — every week. Not “which model is smartest,” but: what do we tell the agent, what is it allowed to see, how does it act inside our systems, and how do we know it still works on Tuesday?
I compress that whole discipline into four topics:
- Prompt engineering — the behaviour contract
- Context engineering — the truth supply chain
- Agent harness — the runtime that can act safely
- Agent evals — the proof under change
Miss one and you do not have an architecture. You have a LinkedIn clip.
The story that keeps repeating
A global retailer builds a returns assistant. In the demo, it apologises beautifully, cites a policy PDF, and “opens a case.” Applause.
In week two of limited rollout:
- It invents a goodwill refund because the prompt said “be helpful”
- It quotes last year’s EU policy for a US customer — wrong context, confident tone
- It calls
UpdateCasewith a shared integration user — no per-user auth, no human gate - Nobody notices until undo volume spikes, because there is no eval suite
Same model. Same logo. Different outcome. The difference was never the LLM brand. It was the four topics below.
1. Prompt engineering — write the law, not the poem
Most teams still treat prompting like creative writing. Applied architects treat it like policy as code.
The prompt is not “be a friendly assistant.” It is the constitution:
- Who the agent is — and who it is not
- What it must refuse (refunds above a threshold, inventing entitlements, guessing PII)
- How it thinks (plan → verify → act, or escalate when unsure)
- What “done” looks like (structured JSON, citations, next-best-action)
In a real enterprise, that constitution is versioned, reviewed by security and legal, and different for a dealer portal vs an internal warranty analyst. If you cannot roll a prompt back the way you roll back an API policy, you are shipping vibes.
Field test: ask the room, “Which git commit is the system prompt in?” If the answer is a Confluence page from March, you already know why the pilot is sticky.
Learn more
- Salesforce Trailhead — Write Better Prompts
- Salesforce Trailhead — Advanced Prompt Engineering Techniques
- Salesforce Developers — Prompt Builder (Agentforce)
- OpenAI — Prompt engineering guide
2. Context engineering — stop stuffing, start curating
Prompts tell the agent how to behave. Context decides whether it is telling the truth.
This is where expensive models still fail. They will cheerfully answer from the wrong region’s policy, a stale CRM note, or a chunk that “feels similar” in the vector store. Context engineering is the supply chain:
- What to fetch — policies, cases, orders, entitlements
- How to fetch it — RAG patterns, search, graphs, SQL, live APIs
- What stays in the window — summaries, memory, session state
- What must never enter — other tenants, secrets, unauthorised fields
I go deep on retrieval patterns in Types of RAG. The architect’s upgrade is bigger than “add Pinecone.” You name sources of truth, freshness rules, and how identity travels with every chunk.
Stuffing the prompt with everything “just in case” is not diligence. It is context pollution — and it makes evals look mysterious later.
Also the boring foundation that keeps winning deals: there is no AI without API. If the agent cannot fetch trusted data on demand, you are running a museum exhibit.
Field test: for one golden question, can you point to the exact system of record that should win — and prove the agent used it?
Learn more
- Salesforce Trailhead — Grounding Agents with Data
- Salesforce Trailhead — Data Cloud / Data 360 powered Agentforce
- Salesforce Developers — Agentic Context (GetContext API)
- Anthropic — Effective context engineering for AI agents
3. Agent harness — the chassis, not the chatbot
Here is the uncomfortable line: a chat UI is not an agent. An agent harness is.
The harness is the chassis around the model — the part integration architects already recognise:
- Tool / action registry — which APIs exist, with schemas and side effects
- Orchestration loop — plan, call, observe, retry, stop
- AuthN / AuthZ on every tool call — least privilege, not “god mode” demo users
- Timeouts, idempotency, rate limits, human-in-the-loop gates
- Tracing, cost caps, kill switches
If your agent can “update Salesforce” with fewer controls than a MuleSoft API, you have not innovated. You have skipped a decade of hard-won enterprise habits.
Whether you land on Agentforce actions, MuleSoft Agent Fabric, LangGraph-style loops, or a custom orchestrator, the review questions do not change:
- What can it discover?
- What can it invoke?
- Who approved that capability?
- What happens when the tool lies, times out, or partially succeeds?
Field test: break the downstream API on purpose in a lower environment. Does the agent escalate cleanly — or invent a happy path?
Learn more
- MuleSoft Docs — Agent Fabric overview
- Salesforce — Agent Fabric product overview
- MuleSoft Docs — Get started with Agent Fabric
- Anthropic — Writing effective tools for AI agents
4. Agent evals — if you cannot score it, you cannot ship it
Chatbots can hide behind “feels good in the demo.” Agents that change money, inventory, or cases cannot.
Agent evals are how you notice the loop getting worse after a “tiny” prompt tweak. They are a regression suite for behaviour:
- Task success — did the job actually finish?
- Groundedness — did it invent policy?
- Tool correctness — right API, right args, right order?
- Safety — jailbreaks, PII, out-of-scope actions
- Latency and cost — correct answers that cost £2 a turn will not scale
Start with ten scenarios that represent real money and real risk — not a hundred toy questions. Happy path. Hostile user. Missing context. Tool outage. Wrong region. Then block releases that drop below the bar.
Salesforce’s Agentforce Testing API exists for a reason: production agents need automated expectations, not vibes in a Builder preview pane.
Field test: change one sentence in the system prompt. Which eval fails first — and who gets paged?
Learn more
- Salesforce Developers — Agentforce Testing API
- Salesforce Developers — Build agent tests (AiEvaluationDefinition)
- Salesforce Developers — Custom evaluation criteria
- Anthropic — Demystifying evals for AI agents
- OpenAI — Evaluate agent workflows
How the four lock together
Think of the agent as a stack, not a shopping list:
Business goal
→ Prompt (the law)
→ Context (the evidence)
→ Harness (the hands)
→ Evals (the courtroom)
Change the prompt without touching evals and you are flying blind. Improve retrieval without hardening the harness and you get a smarter agent that can still do the wrong thing faster. Build a gorgeous harness with a vague prompt and muddy context and you have enterprise plumbing attached to a confused brain.
Applied AI architecture is the discipline of keeping all four coherent under change — while vendors ship new model names every quarter.
Steal this design-review checklist
- Prompt: Versioned? Role-specific? Rollback path clear?
- Context: Named source of truth per claim? ACL on every retrieval?
- Harness: Least privilege? Observable? Fail-safe on tool errors?
- Evals: Which suite fails if this change makes the agent worse?
If any answer is “we will figure it out after the pilot,” you do not have a production design. You have a slide with a robot icon.
Closing
Model choice still matters. Platforms still matter. Brand still matters in the boardroom.
But the architects who ship durable agents obsess over prompt engineering, context engineering, agent harness, and agent evals — because that is where demos become operating systems for work.
Master those four and every new model release becomes an upgrade path. Skip them and every new model release becomes another expensive pilot that dies the same quiet death.