An AI Question is a variable that asks your OpenAI account a yes/no question about each email, for example "Does this email contain financial or personal data?". Rules can then act on the answer: apply stricter link security, hold the message, or file it in a different folder. This page explains how to connect OpenAI, write a question, use it in a rule, and set it up so that doubtful results stay on the safe side.
AI Question is part of Mail2Cloud. It is not the same as Mail2Cloud Advanced, which indexes email for AI search. See Mail2Cloud Advanced Overview.
Before you begin
- Your own OpenAI account and API key. mxHERO does not supply an AI key. Requests use your key, and OpenAI bills your account.
- Approval to send email content to OpenAI. For each email a rule evaluates, mxHERO sends the email's subject, sender, recipients, date and body text to OpenAI's API. Check that this fits your organization's data policies and your OpenAI agreement.
- An Owner or Administrator account on the Admin Dashboard.
How it works
An AI Question is evaluated only when a rule uses a policy that contains it.
- The question is stored in a variable (Auto Filling › Variables).
- You use the variable in a policy: a security policy (choose link security), a filter policy (decide whether a rule runs), or a copy policy (choose a folder).
- The policy is used in a rule. Only then is the question sent, and only for emails that rule evaluates.
- The condition is met when the answer is Yes. The answer text is also the variable's value.
The AI Question option appears in the Variables editor only after your organization has saved an OpenAI key.
What is sent to OpenAI
| Sent | Details |
|---|---|
| Your question | As written in the variable |
| The Question context | mxHERO's built-in instructions: answer the first question only YES or NO, and NO when unsure |
| From the email, by default | Subject, From, all recipients, sent or received date, body text |
| Not sent by default | Attachments and attachment text |
If you edit the Question context and add other variables in braces, their values are sent too. For example, adding the attachments' text variable would send the text extracted from attachments.
- Requests go directly from mxHERO to OpenAI's API, with your key.
- mxHERO chooses the OpenAI model. You can't change it. The OpenAI card in Settings › Integrations shows the model in use.
- Answers are cached for one hour. If the same email is processed again within an hour, no second request is sent.
- Timeouts, rate limits and OpenAI server errors are retried, and the email is processed again later.
Step 1: Connect your OpenAI account
Open Settings › Integrations › Applications.
-
On the OpenAI card, turn on Open AI integration.
Paste your OpenAI API key into the token field.
Save.
Use a key from an OpenAI project dedicated to mxHERO, so you can track usage and set spending limits for it in OpenAI.
Step 2: Create the AI Question variable
- Open Auto Filling › Variables and click Create.
- In the first condition list, where you would normally choose When Fields, choose When AI Question.
- Type your question. Write one clear yes/no question. See "Writing a good question" below.
- Leave the Question context as it is, unless you need to send other email fields.
- Enter a Variable Name, for example
AI – Sensitive content, and a Variable Description. - Click Save variable.
Test the question
- Open the variable and click Test variable.
- Enter sample values, or click Upload an email and choose a
.emlor.msgfile (up to 25 MB). - Click Test and check the answer.
Each test sends a real request to OpenAI with your key. Test with several emails that should get Yes and several that should get No.
Step 3: Use the variable in a policy and a rule
Option A: Choose link security from the answer (AI security rule)
- Open Auto Filling › Security Policies and click Create.
- Enter a Policy name and Policy description, and choose the Cloud storage the rule uses.
- In #1 Policy Condition, under When these variables:, select your AI Question variable and choose All match.
- Under Apply the security definition, choose the stricter option, for example Preset: Organization access links or a password-protected definition.
- Turn on Use a default condition and, under In any other case apply the security definition, choose the less strict option.
- Click Save policy.
- In your rule's Cloud Storage step, open Select a security option: and choose Security policy:
.
See Security Definitions and Policies.
Option B: Run a rule only when the answer is Yes
- Open Auto Filling › Filter Policies and click Create.
- Enter a Name. In #1 Policy Condition, select your AI Question variable and choose All match.
- Click Save Policy.
- In the rule, click Add Filters under the Target step, turn on Use filter policy, and select the policy.
For example, a Temporary Hold rule with the filter policy "Does this email contain financial data?" holds only those messages for the sender to review. See Filter Policies.
Option C: File by the answer
Use the variable in a copy policy to save matching emails to a different folder. See Copy Policies.
Set it up so doubtful results stay safe
AI answers are not guaranteed. A model can misread an email, and a request can fail or return an incomplete answer. Design every AI Question so that the protective outcome is what happens on Yes, and the less protective outcome is the fallback.
- Phrase the question so that Yes means "protect". Ask "Does this email contain sensitive information?", not "Is this email safe to share publicly?".
- Map Yes to the stricter setting. In a security policy, put the strict definition on the AI condition and the relaxed one in Use a default condition. In a filter policy, use the AI condition to turn a protective rule on, with All match.
- Don't use an AI Question to turn protection off. Avoid policies that skip Protect Attachments or a hold when the answer is Yes (for example "Is this a newsletter?"), or that rely on No match to apply the stricter setting.
- Keep the Question context's YES/NO instruction. If you edit it, keep the instruction to answer the first question only YES or NO.
- Pilot before rolling out. Run the rule for a pilot group, then check results in Reports › Email Flow Logs: which rules ran, and which links recipients received.
Writing a good question
| Do | Avoid |
|---|---|
| One question, answerable from the subject and body | Several questions in one |
| Concrete criteria: "Does this email include bank account numbers, invoices or payment instructions?" | Vague words: "Is this important?" |
| Questions where Yes means the email needs protection or review | Questions where Yes means "safe" |
| Questions about the text of the message | Questions about attachments, which aren't sent by default |
Verify
- Test the variable with sample emails (Test variable).
- Send test messages through a rule that uses the policy, for one Yes case and one No case.
- In Reports › Email Flow Logs, check that the rule ran for each message. Open the links the recipient received and check that the expected security applies.
- In your OpenAI account, check that requests appear in usage.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| The AI Question option is missing in the Variables editor | No OpenAI key is saved for the organization | Complete Step 1 above. |
| Answers are inconsistent | The question is ambiguous or depends on attachment content | Make the criteria concrete. Test with more sample emails. |
Security policy applies no definition (security_policy_no_definition in Email Flow Logs) |
No condition matched and there is no default | Turn on Use a default condition in the security policy. |
| Many emails are processed late | OpenAI is rate-limiting your key, so mxHERO retries later | Check your OpenAI project's rate and spending limits. |
| Requests stop after a while | Your OpenAI key was revoked, or the account ran out of credit | Replace the key in Settings › Integrations, or add credit in OpenAI. |
Comments
0 comments
Please sign in to leave a comment.