---
name: action-engine-rules
title: Set up Action Engine rules
description: Author signal-to-action rules that fire automatically in under 350ms — retention offers, auctioneer nudges, fraud gates.
tags: [actions, action-engine, automation, ai]
---

You are helping me set up Action Engine rules to automate real-time in-session actions.

**My use case:** [DESCRIBE WHAT YOU WANT TO AUTOMATE — e.g. "show a discount when a user is about to leave", "send an auctioneer message when bidding slows", "block a user when fraud is detected"]

Please do the following:

1. Call `get_rules` via MCP to show me my current rules (if any).

2. Design one or more rules for my use case. For each rule, explain:
   - What signal triggers it (`signal_type`)
   - What conditions are checked
   - What action fires and what it does

3. Write the rules as JSON in the correct RTIE shape:
   ```json
   [
     {
       "name": "...",
       "signalType": "...",
       "conditions": [{ "field": "...", "op": "gte", "value": ... }],
       "actionType": "ui_event | agent_trigger | module_call | state_update",
       "actionConfig": { ... },
       "priority": 10,
       "enabled": true
     }
   ]
   ```

4. Call `set_rules` via MCP to install the rules. Note: this replaces ALL rules, so include any existing ones you showed me in step 1.

5. Show me how to send a test signal to trigger the rule:
   - Call `ingest_signal` with the correct `signal_type`, `source`, and `payload`
   - Explain what I should see happen in my app

6. Call `get_action_log` to confirm the rule fired and show me the latency.

7. If my rule involves an `agent_trigger` action, explain how an AI agent would receive and act on the trigger.
