Must-read
Overriding Agentforce safety classifications with named Agent Script subagents (opens in a new tab)
You will learn how Agentforce screens messages before the LLM runs, how repeated violations escalate, and how to override a built-in safety classification by naming a subagent exactly as the classification.
Why read this
The article also gives a full sample script and test utterances.
- User sends a message
- Safety classification matched?
- Turn halted, refusal returned
- Third violation escalates to rep
- Clearly safe: business subagent runs
Agentforce checks every user message against built-in safety classifications before the agent’s reasoning runs. If a message matches, the agent halts the turn and returns a refusal without calling the downstream LLM, so unsafe input never reaches your logic. A counter tracks violations within a session, and on the third the turn escalates to a human rep, but only if an escalation path is configured.
To change a classification’s behavior, you add a subagent whose name exactly matches the classification, such as Prompt_Injection, and give it a description that governs when it applies. The name ties the override to the classification, while the description tells the agent both when to use the subagent and when not to. The article’s sample Employee Agent overrides three classifications this way and routes safe requests to an Event_Management subagent, with the router instructed to check safety subagents first.
Each safety subagent in the sample pairs a “use for” description with a “Do NOT use for” list of ordinary business phrases to reduce false positives, and carries reasoning instructions that set a polite, non-echoing refusal tone. The Event_Management action is gated with an available-when condition on currentRecordId, with a fallback asking the user to navigate to a record. The article closes with test utterances for each override and best practices such as configuring an escalation path and routing distress cases to HR or a manager.
Read the original at InfallibleTechie (opens in a new tab)