How AI scoring works
When a lead arrives, AgentFlow assembles the available contact and intent data — name, company, message, source, and any enrichment you have configured — and sends it to OpenAI via a server-side API call. OpenAI evaluates the lead against the qualification dimensions you define and returns a structured JSON response. AgentFlow stores that response, updates the lead record, and surfaces the score in the operator dashboard for review or automated routing.Every OpenAI call is made from AgentFlow’s server-side qualification boundary. Your API key and your scoring prompt are never exposed to the client or logged in browser-accessible storage. Treat your OpenAI key as a server secret and manage it through your deployment environment variables.
Understanding the score output
Each scored lead receives four fields in its qualification result:| Field | Type | Description |
|---|---|---|
score | integer (0–100) | Overall qualification strength. Higher scores indicate stronger fit. |
confidence | string | high, medium, or low — how certain the model is given the available data. |
summary | string | A one-to-two sentence plain-language explanation of the score. |
recommended_action | string | approve, review, or reject — a suggested next step based on your thresholds. |
Configure AI qualification
Open Qualification Settings
In your AgentFlow operator dashboard, navigate to Settings → AI Qualification. This panel controls everything that shapes how leads are scored.
Define your ideal customer profile
In the Qualification Criteria field, describe your ideal customer in plain language. AgentFlow injects this context into every scoring prompt. Be specific: include target company sizes, industries, roles, budget ranges, and use cases your product is best suited for.
Configure scoring dimensions
Enable the scoring dimensions that matter most for your pipeline. AgentFlow can evaluate leads across:
- Company fit — size, industry, and vertical match
- Intent strength — how clearly the message signals purchase intent
- Budget signal — any indicators of budget readiness or spending authority
- Timeline urgency — whether the lead has a defined decision timeline
Set score thresholds
Define the numeric cutoffs that drive automatic routing decisions:
Adjust these values based on your pipeline volume and operator capacity. Lower the auto-approve threshold if you want more leads reaching review; raise it to keep the queue focused on high-signal leads.
| Threshold | Default | Behavior |
|---|---|---|
| Auto-approve above | 75 | Leads at or above this score are marked approved and trigger handoff automatically. |
| Manual review between | 45–74 | Leads in this range are queued for operator review before handoff. |
| Auto-reject below | 45 | Leads below this score are marked rejected and receive no handoff. |
Tune your qualification criteria over time
Your scoring quality improves as you refine the qualification criteria to reflect real pipeline learnings. After your first batch of scored leads, review cases where the recommended action did not match your operators’ judgment:- Score too high for weak leads: Add negative signals to your criteria — for example, note that student emails, personal Gmail addresses, or companies under five employees are not a strong fit.
- Score too low for strong leads: Add positive signals for use cases or job titles your ideal customers share, even if their message is brief.
- Confidence consistently
low: This usually means leads are arriving with too little data. Consider adding required fields to your intake form or enabling enrichment to give the model more signal to work with.
Cost considerations
Every qualification call consumes OpenAI API tokens. The exact cost depends on how much data each lead carries and how detailed your qualification criteria are. A typical scoring call uses roughly 300–600 input tokens and 150–300 output tokens. Estimating monthly usage:| Monthly lead volume | Estimated token usage | Approximate cost (GPT-4o) |
|---|---|---|
| 500 leads | ~450,000 tokens | ~$1.80 |
| 2,000 leads | ~1,800,000 tokens | ~$7.20 |
| 10,000 leads | ~9,000,000 tokens | ~$36.00 |
These estimates are approximate and will vary with your criteria length and lead data richness. Monitor actual usage in your OpenAI dashboard and set a usage cap if you are operating with a fixed budget.
- Keeping your qualification criteria concise and focused
- Filtering out obvious spam or incomplete submissions before they reach the scoring step
- Caching scores for duplicate or near-duplicate submissions
Server-side safety
AgentFlow enforces a strict server-side boundary around all OpenAI interactions. Your API key is stored as a server-only environment variable and is never returned in API responses, embedded in client-side bundles, or logged in browser-accessible storage. The scoring prompt — which contains your proprietary qualification logic — is also evaluated exclusively on the server. This architecture means that even if a user inspects browser network traffic, they see only the lead submission and the returned score result, not the credentials or the logic that produced it.Related concepts:
- Lead Qualification — how AgentFlow models the qualification lifecycle
- Operator Review — how your team acts on scored leads in the dashboard