Threshold Agent Response Tuning Exercises
Last updated
Was this helpful?
Last updated
Was this helpful?
These hands-on exercises help learners understand how to modify and tune assistant behavior in the Threshold Memory template by editing key blocks. You'll learn how to change how the agent evaluates, explains, and responds to policy violations.
Learn which blocks control logic, memory, and response formatting
Customize fallback behavior and explanation style
Practice modifying output to match business tone or policy emphasis
Metadata Assigner
Sets key memory variables and conversation metadata
Add tags like review_required
or flagged
Expense Evaluation
Runs comparison logic (amount vs. threshold, vendor checks)
Modify IF/ELSE branches or add filters
Fallback Reasoning
LLM-based explanation block for ambiguous or missing logic
Change prompt tone or level of formality
Final Decision
Outputs APPROVED
, REJECTED
, ESCALATE
with reason
Customize wording or formatting
🎯 Goal: Make fallback explanations more formal, structured, and compliance-focused — especially when policy violations are detected.
Open the LLM Block (currently titled "LLM")
Locate the SYSTEM message under the Context
section
Modify the final explanation sentence of the <Example>
block to read:
(This replaces the current: “No exception rule found. Logged for escalation or review.”)
Optionally, tweak the opening sentence of the SYSTEM prompt to reinforce tone:
Save and re-test using:
Receipt_4_Only.pdf
(This file contains a suspicious invoice split pattern and exceeds the global threshold)
Teach users how to modify the fallback LLM block’s response tone when no policy match is found or ambiguity arises (e.g. split invoices, unclear categories).
Helps enterprise users adjust how AI communicates policy enforcement (e.g. strict vs supportive tone)
Ensures responses align with internal brand or compliance voice
Enables better UX when agents must reject or escalate expenses
Open the LLM Fallback Block
Locate the block that handles ambiguous or missing-policy cases (typically tagged <policy>
and <receipts>
)
Identify the Current Prompt
Look for something like:
Modify the Tone
Try rewriting the prompt in one of the following styles:
🔍 Strict:
“This expense appears to violate corporate policy and will be flagged for immediate rejection.”
💼 Professional:
“Based on the provided policy, this expense may not be compliant. Please advise.”
🤝 Supportive:
“This expense might fall outside standard policy. Would you like me to escalate for review?”
Save and Re-run a Test
Use a borderline case like Receipt_4_Only.pdf
Observe how the assistant’s tone changes based on the new prompt
Output clearly reflects new tone
System still uses memory-driven policy context
Learner understands where and how to control fallback behavior
Escalate receipts that include alcohol, even if thresholds are not exceeded.
Open Expense Evaluation
Add a condition:
Upload Receipt_3.pdf
and confirm escalation
Agent response is visibly changed (different tone, tags, or decision path)
conversation_notes
reflect updated explanations
Output is aligned with edited logic and assistant behavior
Try adjusting block logic to fit different organizational policies or tone-of-voice standards!