How agents act on live customer behavior
AI agents act on live customer behavior in one of two ways. They pull the customer's current state when the customer talks to them, or a behavior crosses a threshold you set and pushes the agent to act before the customer asks. Both run the same loop: an event updates a computed value, the agent reads it and decides, and what it did is recorded as a new event.
How do AI agents act on live customer behavior?
AI agents act on live customer behavior in one of two ways. In the pull pattern, the agent asks for the customer’s current state when the customer talks to it. In the push pattern, a behavior crosses a threshold you set, such as a checkout failing twice, and that event starts the agent before the customer asks for anything.
Both depend on the agent reading state that is current, which is the case made in why AI agents need real-time context. This article is about what happens next: how the reading turns into an action, and how to keep that action safe.
What is the difference between pull and push?
Pull is the familiar shape. A customer opens the chat, and before its first reply the agent calls a tool that returns what this customer has done in the session: pages viewed, searches run, errors hit. The customer starts the conversation, and the live state makes the first answer a useful one. What is agentic context? covers what that state contains and how it is shaped for a model.
Push turns that around. Nothing has been typed. A rule watches the customer’s live state, and the moment its condition is true it sends an event to your agent, which decides whether to act. The customer did not ask, so the agent has to be right about the moment as well as the message.
Most teams start with pull, because the customer has already invited the agent in. Push is where the timing pays off most, and where an agent can most easily become a nuisance.
How do the three approaches compare?
| Reactive chat | Pull with live context | Push triggered by behavior | |
|---|---|---|---|
| Who starts it | The customer | The customer | A rule over the customer’s behavior |
| What the agent knows at the first reply | The conversation and any stored profile | The conversation, plus what the customer did this session | What crossed the threshold, plus the session behind it |
| When it acts | After the customer explains the problem | On the first reply | While the problem is happening, before any message |
| What you build | A chat agent | A tool call that reads live state | A rule, a destination for it, and an agent that can start a conversation |
| How it goes wrong | The customer repeats what your site already recorded | Stale or missing state, so the agent guesses | It fires too often, at the wrong moment, or without consent |
| Good for | General questions with no session behind them | Support and shopping help in a live session | Moments that pass if nobody acts: failed payments, a stuck setup step, an idle high-value basket |
The columns are not exclusive. A push usually opens a conversation that then runs as pull, with the agent reading state on each turn.
What does the loop look like, step by step?
The loop is the same for both patterns. Only step three changes.
- Event. The customer does something and your site or app records it: a page view, a search,
a
checkout_errorwith the step it failed at. - Attribute update. A value computed from those events is brought up to date. An attribute is a value computed from events about one key, such as a session or a user. “Payment failures this session” goes from one to two.
- Tool call or trigger. In pull, the agent calls a tool and reads the attribute along with the recent session. In push, a rule over the attribute becomes true and an event is sent to your agent’s backend or to the page itself.
- Agent decision. The agent, with your instructions and rules, decides whether to act and how. Two failures might mean “offer another way to pay”. Two failures on a known-bad card type might mean “hand over to a person”.
- Action. A message in the chat, an offer your rules allow, a change to the page, or a route to a person with the context attached.
- The action, logged as an event. What the agent did, and what the customer did next, are recorded like any other behavior. That closes the loop: the next decision can see the last one, and you can measure whether acting changed anything.
Step six is the one teams skip. Without it, an agent can make the same offer three times in one session, and nobody can tell afterward whether the proactive message saved the sale or annoyed a customer who was about to pay anyway.
What guardrails does an agent that acts need?
An agent that acts on behavior, and especially one that acts first, needs limits written down before it ships. Anthropic’s guide to building effective agents recommends stopping conditions, checkpoints where an agent can “pause for human feedback”, and testing in a sandbox, and all three apply here.
- Rate limits. Decide how often one customer can be contacted: once per session, once per day, never twice for the same reason. Enforce it in the rule and again in the agent, because each sees different things.
- Human handoff. Set the point at which a person takes over, such as a second failed payment on a large order, and hand over the session with the conversation so the customer does not start again. What is a customer-facing AI agent? covers why this matters more when nobody reviews the reply before the customer reads it.
- Consent. Act only on data the customer agreed you could use, and only through channels they agreed to. A proactive message by email or text is a marketing contact in many jurisdictions. In the EU, the AI Act’s Article 50 requires that people are told when they are interacting with an AI system, unless it is obvious.
- A narrow set of actions. Limit push to actions that cost little if the timing is wrong, such as an offer of help. Leave refunds and account changes to a conversation the customer started.
Example: reaching out when checkout fails twice
A shopper reaches payment and the card is declined. They try again and it is declined again. They have not opened the chat. The pull version, where the customer asks first, is the example in what is a customer-facing AI agent? This is the push version, built on the same attribute.
First, the attribute: a count of payment failures in this session.
from snowplow_signals import (
Attribute, Criteria, Criterion, Event, EventProperty, StreamAttributeGroup, domain_sessionid,
)
checkout_error = Event(name="checkout_error", vendor="com.example", version="1-0-0")
error_step = EventProperty(vendor="com.example", name="checkout_error", major_version=1, path="step")
payment_failures_session = Attribute(
name="payment_failures_session",
type="int32",
events=[checkout_error],
aggregation="counter",
criteria=Criteria(all=[Criterion.eq(error_step, "payment")]),
default_value=0,
)
shop_checkout_payment = StreamAttributeGroup(
name="shop_checkout_payment",
version=1,
attribute_key=domain_sessionid,
owner="you@example.com",
attributes=[payment_failures_session],
)
Then the trigger condition: fire when that count reaches two.
from snowplow_signals import InterventionCriterion, RuleIntervention
payment_failed_twice = RuleIntervention(
name="payment_failed_twice",
owner="you@example.com",
criteria=InterventionCriterion(
attribute="shop_checkout_payment:payment_failures_session",
operator=">=",
value=2,
),
)
Set the rule to fire once per session, so the shopper gets it on the second failure and not again on a third or fourth. That is the first rate limit, and it belongs in the rule.
When it fires, your agent receives the trigger with the session it belongs to. It reads the recent session as context, sees the two payment errors on a basket with one jacket in it, and decides. Your rules might say: under a set basket value, open the chat with “Your card was declined twice. Would you like to try another card, or pay another way?”; over it, offer a person. The chat opening, and the shopper’s reply, are tracked as events, so the next turn knows the offer was made and you can compare sessions where it fired against sessions where it did not.
Where Signals fits
You can build this loop yourself on an event stream, a stream processor and a store your agent
can read, or use a service for the parts before the agent decides. Snowplow Signals covers those
parts: it collects the events, computes attributes like the one above, serves an agent the recent session
over a REST API or an MCP server, and evaluates rules like payment_failed_twice, delivering them
into your app or to Braze, Kafka, a webhook or Pub/Sub. The decision and the action stay in your
agent and your code. Real-time triggers covers the push side and
agentic context the pull side.
The rest of the AI agents and memory topic covers what an agent should read, and how it remembers.
See it on your own traffic
Add the SDK, define one attribute, and see an attribute updating against your own traffic in the first session. The free tier runs on the real engine: no card, no sales call.