How To Protect Registration

Sending registration events for risk scoring

How to instrument the sign-up flow so that BotBye risk scoring can detect multi-accounting and registration farms.

Send two events per registration

Registration detections count accounts that were actually created, not form submissions:

  • a second account registered on the same mailbox within 24 hours, including its aliases (john+1@, j.o.h.n@gmail.com)
  • many accounts registered from one IP within a day (registration farms)
  • etc.

At the same time, the only moment a decision can still stop an abusive sign-up is before the account is created. So each registration needs two calls:

1. Before creating the account — status: ATTEMPTED. This is the decision you act on: a BLOCK here means the account is never created.

2. After the outcome is known — status: SUCCESSFUL with the new account id, or status: FAILED if the registration was rejected. This is the event the counters are built from.

If only the first call is sent, the counters above stay at zero: the engine sees attempts but never learns which mailbox or IP ended up owning an account. If only the second call is sent, the counters work, but the decision arrives after the account already exists.

Name the event registration

Set event.type to "registration" on every call (letter case doesn't matter).

It is a reserved name: the registration detections only count events of this type. An event named "signup" or "register" is accepted without an error, but they never see it.

Set the status to the real outcome

  • "ATTEMPTED" — the form was submitted and the account doesn't exist yet. Send it before you write anything
  • "SUCCESSFUL" — the account was created
  • "FAILED" — the registration was rejected (address already taken, validation error, blocked by you). Optional for scoring, but it keeps the attempt's outcome visible in the dashboard

Map the user fields

Set status, accountId, email and username per step:

Step status accountId email / phone / username
Before creating the account ATTEMPTED empty string "" as submitted
Account created SUCCESSFUL the new account id as submitted
Registration rejected FAILED empty string "" as submitted

Leave accountId empty until the account exists. Don't send a placeholder such as "pending", and don't use the email or a temporary id. A constant value would collapse every sign-up into one synthetic account; a temporary id that never becomes a real account would count as an extra account on the mailbox and the IP. An empty accountId is excluded from per-account metrics, while the attempt is still scored on its IP and mailbox.

On the SUCCESSFUL event, send the same id you will later send as accountId on that user's logins.

Send the real email address, never a hash. BotBye folds aliases of one mailbox onto one key itself (case, +suffix, Gmail dots, googlemail.com), so you don't need to normalise the address first. A hashed address can't be folded, and the mailbox detection won't work for it.

Send the address the user submitted, not one read back from your profile: if your system masks or rewrites stored contacts, the masked value won't match the next sign-up on the same mailbox.

Sign-ups by phone only: send phone and leave email empty. The mailbox detection doesn't apply to them; the IP detection still does.

Example (Node SDK)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
async function handleRegistration({
  ip, headers, method, url, token, login, email, phone, password,
}) {
  const submitted = { username: login, email, phone };

  // 1. before anything is written: this is the decision that can stop the sign-up
  const precheck = await evaluate({
    type: "full",
    request: { ip, headers, requestMethod: method, requestUri: url, token },
    event: { type: "registration", status: "ATTEMPTED" },
    // the account doesn't exist yet: empty accountId, never a placeholder
    user: { accountId: "", ...submitted },
  });

  if (precheck.decision === "BLOCK") return { status: 403 };
  // CHALLENGE -> step up (CAPTCHA); ALLOW -> proceed

  let account;
  try {
    account = await createAccount({ login, email, phone, password });
  } catch (e) {
    // 2a. rejected: report the outcome, still without an accountId
    await evaluate({
      type: "risk",
      request: { ip },
      event: { type: "registration", status: "FAILED" },
      user: { accountId: "", ...submitted },
      botbyeResult: precheck.botbye_result, // links both calls into one event
    });
    throw e;
  }

  // 2b. created: this event is what the per-mailbox / per-IP counters count
  await evaluate({
    type: "risk",
    request: { ip },
    event: { type: "registration", status: "SUCCESSFUL" },
    // the new account id; contacts as SUBMITTED, not read back from the profile
    user: { accountId: account.id, ...submitted },
    botbyeResult: precheck.botbye_result,
  });

  return { status: 201 };
}

The token is validated once, in the first call. The second call uses type: "risk" and passes botbye_result from the first response, so both are shown as one event; if the response has no botbye_result, omit it.

Act on the first decision only. By the time of the SUCCESSFUL event the account exists; a BLOCK there can't undo it. Use it, if at all, to flag the new account for review.

Answer a BLOCK with the same generic error you use for other refusals. A message like "this email is already registered" tells whoever is probing which addresses (and aliases) already have an account with you.

What you'll see

Once SUCCESSFUL registrations start flowing in, the ATTEMPTED call begins returning CHALLENGE / BLOCK on the patterns above, with email_multi_accounting or ip_registration_burst in signals. The first registration on a mailbox or IP never triggers them.