Threshold Agent Response Tuning Exercises
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.
Objectives
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
Blocks to Explore
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
Exercise 1: Change How Violations Are Explained
🎯 Goal: Make fallback explanations more formal, structured, and compliance-focused — especially when policy violations are detected.

✅ Steps
Open the LLM Block (currently titled "LLM")
Locate the SYSTEM message under the
Context
sectionModify the final explanation sentence of the
<Example>
block to read:Reason: This expense violates policy due to exceeding the threshold without an exception rule. A formal review is required for compliance logging.
(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:
You are a compliance-focused corporate accountant. Review the receipt and policy to determine validity using formal, transparent justifications.
Save and re-test using:
Receipt_4_Only.pdf
(This file contains a suspicious invoice split pattern and exceeds the global threshold)
The LLM is used here as a fallback explanation agent, especially when the IF/ELSE blocks don’t capture ambiguous or edge-case logic. This edit lets learners experiment with output tone, formality, and compliance narrative structure — without altering business logic.
Exercise 2: Tone Tuning in the Fallback Reasoning Block
Goal
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).
Why This Matters
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

Steps
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:
Please review the following receipt in the context of the policy: <policy>{{policy_memory}}</policy> <receipts>{{receipt_text}}</receipts>
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
✅ Success Criteria
Output clearly reflects new tone
System still uses memory-driven policy context
Learner understands where and how to control fallback behavior
Exercise 3: Add Logic to Escalate Alcohol Violations
Goal
Escalate receipts that include alcohol, even if thresholds are not exceeded.
Steps
Open Expense Evaluation
Add a condition:
If invoice_data.contains_alcohol == true → Set `approval_result = ESCALATE`
Upload
Receipt_3.pdf
and confirm escalation
Success Criteria
Agent response is visibly changed (different tone, tags, or decision path)
conversation_notes
reflect updated explanationsOutput is aligned with edited logic and assistant behavior
Try adjusting block logic to fit different organizational policies or tone-of-voice standards!
Last updated
Was this helpful?