Skip to content

Testing Your Approval Workflow

Verify your Preloop setup is working correctly by testing the complete approval workflow end-to-end.


Overview

This guide walks you through testing:

  1. Tool Call Triggering - Verify MCP client can call tools
  2. Approval Interception - Confirm Preloop intercepts prelooped tools
  3. Notification Delivery - Check you receive approval requests
  4. Approval Processing - Test approve/decline functionality
  5. Tool Execution - Verify approved tools execute correctly
  6. Audit Trail - Confirm all actions are logged

Time Required: 10-15 minutes

Prerequisites: - Preloop account created (Creating Your Account) - API key generated - MCP client connected (Connect Your MCP Client) - At least one tool prelooped


Test 1: Basic Approval Workflow

Goal

Verify the complete approval flow works: call tool → receive notification → approve → tool executes.

Setup

Step 1: Use the Example MCP Server

If you haven't already, add the hosted example MCP server:

  1. Go to Tools & MCP+ Add SourceMCP Server
  2. Configure:
    Name: Example MCP Server
    URL: https://example-mcp.preloop.ai/mcp
    Transport: http-streaming
    Auth Type: none
    Status: active
    
  3. Click Save
  4. Click Scan Tools

Step 2: Preloop the pay Tool

  1. Find pay tool in Tools & MCP list
  2. Click Configure (gear icon)
  3. Toggle Require Approval to ON
  4. Set approvers: Add yourself
  5. Notification: Select "Email"
  6. Click Save

📸 Screenshot needed: test-pay-tool-config.png

Execute Test

Step 1: Trigger Tool Call

In your MCP client (e.g., Claude Code):

Using @preloop tools, pay alice@example.com $500

Expected behavior: - MCP client sends request - Shows "Waiting for approval..." or similar - Does NOT execute immediately

📸 Screenshot needed: test-waiting-for-approval.png

Step 2: Check for Notification

Within 30 seconds, check:

Email: - Check inbox for email from hello@preloop.ai - Subject: "Approval Required: pay" - Body includes: - Tool name: pay - Arguments: recipient=alice@example.com, amount=500 - Approve and Decline buttons - Request ID

📸 Screenshot needed: test-approval-email.png

Web Dashboard: - Look for notification bell (top-right) - Badge should show "1" - Click bell to see pending request - Click request to see details

📸 Screenshot needed: test-approval-dashboard-notification.png

Mobile (if configured): - Push notification should appear - Shows tool name and key arguments - Can approve directly from notification

Step 3: Approve Request

Choose one method to approve:

Method A: Email (Fastest) - Click Approve button in email - Should see confirmation page - "✓ Approval recorded successfully"

Method B: Web Dashboard - Click notification bell → Click request - Review details in modal - Click Approve button - Optional: Add reason (e.g., "Test approval") - Click Confirm

Method C: Mobile App - Tap notification - Review details - Tap Approve - Authenticate (Face ID/Touch ID)

📸 Screenshot needed: test-approval-confirmed.png

Step 4: Verify Execution

After approving:

In MCP Client: - Should see approval confirmation - Tool executes - Result displayed:

✓ Approval received
✓ Payment of $500 sent to alice@example.com
Transaction ID: tx_abc123

📸 Screenshot needed: test-tool-executed.png

In Web Dashboard: - Notification clears (badge decreases) - Request moves to "Approved" in Approvals → History - Shows execution result

Verify Audit Trail

  1. Go to ApprovalsHistory
  2. Find your test request
  3. Click to view details
  4. Verify it shows:
  5. ✅ Requester: Your MCP client
  6. ✅ Tool: pay
  7. ✅ Arguments: recipient=alice@example.com, amount=500
  8. ✅ Status: Approved
  9. ✅ Approved by: You
  10. ✅ Approved at: Timestamp
  11. ✅ Executed: Yes
  12. ✅ Result: Success

📸 Screenshot needed: test-audit-trail.png

Expected Results

PASS if: - Notification received within 30 seconds - Approval buttons work - Tool executes after approval - Result shown in MCP client - Audit log shows complete record

FAIL if: - No notification received - Approval buttons don't work - Tool executes immediately (without approval) - No audit log entry


Test 2: Decline Workflow

Goal

Verify declining an approval request works correctly and prevents execution.

Execute Test

Step 1: Trigger Another Tool Call

Using @preloop tools, pay bob@example.com $1000

Step 2: Decline Request

When notification arrives:

Via Email: - Click Decline button (not Approve) - Optional: Add reason (e.g., "Test decline") - Click Confirm

Via Web Dashboard: - Click notification → View request - Click Decline button - Add reason: "Test decline" - Click Confirm

📸 Screenshot needed: test-approval-declined.png

Step 3: Verify No Execution

In MCP Client: - Should see decline message - Tool does NOT execute - Error or cancellation message:

✗ Approval declined
Reason: Test decline
The tool was not executed.

In Web Dashboard: - Request shows as "Declined" - Status: ❌ Declined - No execution result - Shows decline reason

Expected Results

PASS if: - Decline button works - Tool does NOT execute - MCP client receives decline message - Audit log shows "Declined" status

FAIL if: - Tool executes despite decline - MCP client doesn't receive decline message


Test 3: Conditional Approval

Goal

Verify CEL conditions work: approval only required when condition matches.

Setup

Step 1: Update pay Tool Policy

  1. Go to Tools & MCP → Find pay tool → Configure
  2. In Approval Condition field, enter:
    args.amount > 1000
    
  3. Click Save

This means: Only require approval if amount > $1000.

📸 Screenshot needed: test-conditional-policy.png

Execute Test

Test A: Amount Below Threshold (No Approval)

Using @preloop tools, pay charlie@example.com $500

Expected behavior: - No approval request sent (amount ≤ 1000) - Tool executes immediately - MCP client shows result without waiting

PASS: Tool executes without approval

Test B: Amount Above Threshold (Approval Required)

Using @preloop tools, pay charlie@example.com $1500

Expected behavior: - Approval request sent (amount > 1000) - Notification received - MCP client waits - Approve → Tool executes

PASS: Approval required for amount > 1000

Expected Results

PASS if: - Small amounts (≤ $1000) execute immediately - Large amounts (> $1000) require approval - Condition evaluated correctly - Audit log shows condition result

FAIL if: - All amounts require approval (condition ignored) - No amounts require approval (condition broken)


Test 4: Team-Based Approval

Goal

Verify team-based approvals with quorum work correctly.

Setup

Prerequisites: - You need at least 2 users in your account for this test - If testing alone, skip to Test 5

Step 1: Create a Test Team

  1. Go to SettingsTeams
  2. Click + Create Team
  3. Configure:
    Name: Test Approvers
    Members: [Add yourself + another user]
    
  4. Click Create

Step 2: Update pay Tool Policy

  1. Tools & MCP → pay → Configure
  2. Approvers: Select "Test Approvers" team
  3. Quorum: 2 (require 2 approvals)
  4. Condition: Remove (or set to always true)
  5. Click Save

📸 Screenshot needed: test-team-policy.png

Execute Test

Step 1: Trigger Tool Call

Using @preloop tools, pay dave@example.com $2000

Step 2: First Approval

  • You receive notification (as team member)
  • Other user also receives notification
  • You approve
  • Tool does NOT execute yet (quorum not met)

Step 3: Second Approval

  • Other user approves
  • Quorum met (2 approvals)
  • Tool NOW executes

Step 4: Verify Quorum

In audit log: - Shows both approvers - Shows quorum: 2/2 met - Execution after quorum met

Expected Results

PASS if: - Both team members notified - Tool waits for quorum (2 approvals) - Executes after 2nd approval - Audit log shows both approvers

FAIL if: - Tool executes after 1st approval (quorum ignored) - Only one person notified


Test 5: Timeout and Escalation

Goal

Verify approval requests timeout and escalation works.

Setup

Step 1: Update pay Tool Policy

  1. Tools & MCP → pay → Configure
  2. Approvers: Yourself
  3. Timeout: 120 seconds (2 minutes)
  4. Escalation:
  5. Enabled: ON
  6. Escalate to: [Add another email or leave as admin]
  7. Escalation delay: 60 seconds (1 minute)
  8. Click Save

📸 Screenshot needed: test-escalation-policy.png

Execute Test

Step 1: Trigger Tool Call

Using @preloop tools, pay eve@example.com $3000

Step 2: Wait Without Approving

  • Receive notification
  • Do NOT approve or decline
  • Wait 1 minute

Step 3: Verify Escalation

After 1 minute: - Escalation notification sent - Email to escalation contact - Subject: "[ESCALATED] Approval Required: pay" - Shows original requester and timeout

📸 Screenshot needed: test-escalation-notification.png

Step 4: Continue Waiting

  • Total 2 minutes pass
  • Still do not approve

Step 5: Verify Timeout

After 2 minutes: - Request times out - MCP client receives timeout error:

✗ Approval request timed out
The tool was not executed.
- Audit log shows "Timeout" status

📸 Screenshot needed: test-timeout-result.png

Expected Results

PASS if: - Escalation notification sent after 1 minute - Request times out after 2 minutes - Tool does NOT execute on timeout - Audit log shows timeout + escalation

FAIL if: - No escalation notification - Tool executes despite timeout - Request never times out


Test 6: Multiple Notification Channels

Goal

Verify notifications work across email, mobile, Slack, and web.

Setup

Prerequisites: - Email: Always configured - Mobile: Optional (iOS app installed and registered) - Slack: Optional (Slack integration configured)

Step 1: Enable All Channels

  1. Go to SettingsNotifications
  2. Verify enabled:
  3. ✅ Email: ON (always)
  4. ✅ Mobile: ON (if configured)
  5. ✅ Slack: ON (if configured)
  6. ✅ Web: ON (always)

Step 2: Update pay Tool Notification

  1. Tools & MCP → pay → Configure
  2. Notification channels:
  3. ✅ Email
  4. ✅ Mobile (if configured)
  5. ✅ Slack (if configured)
  6. Slack channel: #approvals (if using Slack)
  7. Click Save

Execute Test

Step 1: Trigger Tool Call

Using @preloop tools, pay frank@example.com $4000

Step 2: Check All Channels

Within 30 seconds, verify notification received on:

✅ Email: - Inbox has approval email - Approve/Decline buttons present

✅ Web Dashboard: - Notification bell badge: 1 - Pending request visible

✅ Mobile (if configured): - Push notification received - Can view details in app

✅ Slack (if configured): - Message posted to #approvals channel - Interactive Approve/Decline buttons - Shows tool name and arguments

📸 Screenshot needed: test-multi-channel-notifications.png (showing all channels)

Step 3: Approve from Any Channel

  • Approve from ONE channel (e.g., Slack)
  • All other channels should update:
  • Email shows "Already approved" if you click button
  • Web dashboard notification clears
  • Slack message updates with approval status
  • Mobile notification clears

Expected Results

PASS if: - Notifications arrive on all configured channels within 30 seconds - Approve from any channel works - Other channels reflect approval status - Tool executes after approval

FAIL if: - Missing notifications on any channel - Approve from one channel doesn't update others - Duplicate executions


Test 7: Non-Prelooped Tool

Goal

Verify non-prelooped tools execute immediately without approval.

Setup

Step 1: Add a Tool Without Approval

Use the get_random_number tool from example MCP server:

  1. Tools & MCP → Find get_random_number
  2. Verify Require Approval is OFF
  3. If ON, toggle it OFF and save

📸 Screenshot needed: test-non-prelooped-tool.png

Execute Test

Step 1: Call Non-Prelooped Tool

Using @preloop tools, generate a random number between 1 and 100

Expected behavior: - No approval request sent - Tool executes immediately - Result shown instantly:

✓ Random number: 42

Step 2: Verify No Notification

  • No email received
  • No web dashboard notification
  • No Slack message
  • Tool just works

Expected Results

PASS if: - Tool executes immediately - No approval request - Result shown instantly - Still logged in audit trail (as "Auto-approved")

FAIL if: - Approval requested (tool shouldn't require it) - Tool doesn't execute


Test 8: Error Handling

Goal

Verify error handling when tool execution fails or MCP server is unavailable.

Test A: Tool Execution Error

Step 1: Trigger Invalid Tool Call

Use invalid arguments to cause execution error:

Using @preloop tools, pay invalid-email $-100

Expected behavior: - Approval request still sent (if prelooped) - You approve - Tool tries to execute - Execution fails with error:

✗ Tool execution failed
Error: Invalid email address format
- Audit log shows "Approved but execution failed"

PASS: Error handled gracefully, shown to user

Test B: MCP Server Offline

Step 1: Temporarily "Break" Connection

  1. Go to Tools & MCP → Example MCP Server
  2. Click Edit
  3. Change URL to invalid: https://invalid-server-url.example.com
  4. Click Save

Step 2: Try to Use Tool

Using @preloop tools, pay grace@example.com $500

Expected behavior: - Error message:

✗ Cannot connect to MCP server
Tool 'pay' is currently unavailable
- No approval request sent (can't reach server)

Step 3: Fix Connection

  1. Edit server again
  2. Restore correct URL: https://example-mcp.preloop.ai
  3. Click Save
  4. Try tool call again → Should work

PASS: Server errors handled, shown to user

Expected Results

PASS if: - Invalid arguments shown as errors - Server offline errors reported - No mysterious failures - Errors logged in audit trail

Next Steps

Your setup is working! Next: Add your own MCP tools or create automated flows.