Technical and operational implementation guide · Implementation guides
How to Build an AI Sales Agent: Architecture and Controls
AI may assist research organization and drafting. A human editor reviews every published page, checks material claims against the cited sources and owns the final decision. No company paid for placement in this article.
AI use policyAgent-ready brief
AI takeaways
Keep the key points here, or take a source-aware text brief into Claude, ChatGPT or another AI workspace.- 01Start with one job contract that names eligible records, completion, exclusions, owner and stop states.
- 02Separate facts, interpretations and hypotheses before the model proposes an action.
- 03Keep permissions action- and field-specific, with consequential CRM changes human-approved.
- 04Use validation, idempotency, postconditions, retry ceilings and exception ownership around every tool call.
- 05Promote from shadow mode only after the real test pack, failure trace and rollback path pass.
done;Build one bounded sales job inside a deterministic control loop with typed evidence, action-level permissions, observable outcomes and model-independent rollback.
01 / How to build an AI sales agent
1. How to build an AI sales agent around one useful job
- classify and route an opted-in inbound lead;
- research one approved account list and produce a sourced brief;
- propose a reply disposition for human review;
- book a meeting after explicit interest and validated availability;
- create a follow-up task from a completed call;
- flag an account-expansion signal for its human owner.
- find our best market;
- replace the SDR team;
- run outbound end to end;
- manage all CRM records;
- negotiate pricing;
- decide which legal rules apply.
Write a job contract
| Field | Example for a first agent |
|---|---|
| Business job | Qualify an opted-in demo request |
| Trigger | Valid website-form event with consent state |
| Eligible records | New business contacts not suppressed, duplicated or owned |
| Required evidence | Form, approved firmographics, product interest, territory and calendar |
| Allowed outcome | Route, request one missing fact, propose a meeting or close as ineligible |
| Prohibited outcome | Set price, promise features, create an opportunity or change owner |
| Human owner | Assigned SDR or exception queue |
| Stop states | Human request, contradiction, tool failure, sensitive topic or missing permission |
| Baseline | Current response, accepted-meeting and error definitions |
| Rollback owner | Named RevOps or engineering operator |
02 / Write the evidence contract
2. Write the evidence contract
- stable lead, contact, account and agent-run IDs;
- source system or URL;
- captured or updated timestamp;
- field authority when sources disagree;
- freshness rule;
- allowed use;
- confidence or verification state;
- missing and contradictory state;
- sensitive-data exclusion;
- suppression and prior-contact state.
Separate facts from interpretations
| State | Meaning | Allowed use |
|---|---|---|
| Verified fact | Current source supports the exact statement | May support a bounded decision or claim |
| Bounded inference | Evidence suggests, but does not establish, a meaning | May guide a question, not a confident claim |
| Sales hypothesis | Commercial idea the seller wants to test | Requires human approval and buyer confirmation |
| Missing or conflicting | Required evidence is absent or disagrees | Pause, ask or route; do not improvise |
03 / Define the event contract
3. Define the event contract
json { "run_id": "stable-id", "record_id": "lead-or-account-id", "workflow_version": "v1.3", "trigger": "demo_request_received", "evidence_refs": ["crm:contact:...", "form:event:..."], "proposed_action": "book_meeting", "arguments": { "timezone": "IANA timezone", "start": "ISO-8601 timestamp", "owner_id": "approved-owner-id" }, "permission": "approval_required", "status": "proposed", "reviewer": null, "result": null } received → normalized → evaluated → proposed → validated → approved → attempted → confirmed.rejected, suppressed, duplicate, failed, uncertain, human_requested and rolled_back. Timers and retries must read the current state before acting.04 / Build the control loop
4. Build the control loop
- Observe: load the trigger and approved evidence.
- Normalize: resolve identity, schema and time formats.
- Apply deterministic rules: suppression, ownership, required fields and hard prohibitions.
- Ask the model for a proposal: use a typed output schema.
- Validate the proposal: schema, business preconditions, permission and current state.
- Request approval if required.
- Execute the tool action: use tested code and an idempotency key.
- Check the postcondition: confirm that the expected state exists.
- Record the event: include result, latency, error and version.
- Hand off, wait or close.
The calendar failure that explains the boundary
- the model interpreted the conversation;
- it returned a typed JSON proposal;
- deterministic code checked timezone, availability and required fields;
- the calendar API executed only after validation;
- the workflow recorded confirmation or created an exception.
05 / Map permissions by action
5. Map permissions by action
AI SDR as one block. Grant it to specific actions under specific conditions.| Action | Starting permission | Required control |
|---|---|---|
| Read approved lead fields | Autonomous | Least-privilege access and logging |
| Read suppression state | Autonomous, mandatory | Authoritative source and fail-closed behavior |
| Summarize evidence | Autonomous proposal | Source references and uncertainty labels |
| Recommend qualification | Autonomous proposal | Rubric, reason and human correction |
| Draft follow-up | Autonomous draft | Allowed claims and campaign-level review |
| Send follow-up | Approval required | Current state, suppression and sender checks |
| Book a meeting | Bounded automation after validation | Timezone, availability, idempotency and confirmation |
| Change Opportunity Stage | Human approval | Current value, owner and audit |
| Create opportunity | Human approval | Qualification and CRM admission rule |
| Set price or discount | Human only | Commercial authority |
| Negotiate contract terms | Human only | Legal and executive authority |
| Pause and escalate | Always available | Deterministic safe-stop path |
06 / Assemble the production architecture
6. Assemble the production architecture
| Component | Responsibility |
|---|---|
| Trigger and queue | Receive events, control concurrency and retry safely |
| Identity and normalization | Match lead, contact and account; standardize fields and time |
| Evidence retrieval | Load only approved, current sources |
| Deterministic policy | Apply suppression, ownership, limits and prohibited states |
| Model layer | Interpret language and return a typed proposal |
| Validator | Check schema, evidence, permissions and business preconditions |
| Tool adapter | Call CRM, calendar, email, voice or enrichment APIs |
| State store | Preserve run and contact state across steps and channels |
| Approval queue | Give a human the evidence, proposal and consequence |
| Audit and observability | Record versions, traces, errors, corrections and outcomes |
| Secrets and access | Keep keys outside prompts and apply least privilege |
| Kill switch and rollback | Stop new actions and reverse supported changes |
Keep CRM writes reversible
- read the current record and version;
- verify the expected owner and state;
- check suppression and duplicate action;
- store the proposed before-and-after values;
- use an idempotency key;
- require approval when policy says so.
- confirm the actual stored value;
- record API response and timestamp;
- link the evidence and reviewer;
- create an inverse action or restoration record when possible.
07 / Protect customer data, secrets and tool boundaries
Protect customer data, secrets and tool boundaries
- give each connector a separate service identity;
- grant read and write scopes by object and action, not broad administrator access;
- keep API keys and tokens in a secrets manager, never in a prompt, trace or source repository;
- send the model the minimum evidence needed for the current step;
- redact sensitive values from logs while preserving stable references for investigation;
- validate every tool argument on the server;
- allow destinations, domains, phone regions and tool operations explicitly;
- rotate credentials and test revocation;
- preserve suppression and deletion state when data is copied;
- review provider retention and model-training settings for the actual plan.
propose_meeting(slot_id, contact_id) over a general calendar command and create_followup_task(record_id, reason) over arbitrary CRM mutation. Validate identifiers against the current tenant and record. Reject fields that are not part of the schema. Apply rate and spend limits outside the model.08 / Make observability answer operational questions
Make observability answer operational questions
run_id, record_id, workflow version, model version and policy version. Correlate those identifiers across queues, model calls, tools, approvals and CRM results.| Trace field | Operational question it answers |
|---|---|
| Trigger and eligibility result | Why did this record enter the workflow? |
| Evidence references and timestamps | What did the agent know, and how fresh was it? |
| Deterministic rule results | Which suppression, owner or permission rule applied? |
| Typed model proposal | What did the model recommend without executing? |
| Validation result | Which schema or business precondition passed or failed? |
| Approval event | Who accepted, changed or rejected the consequence? |
| Tool request and provider response | What was attempted, and did the provider confirm it? |
| Postcondition | Does the target system now contain the expected state? |
| Handoff or terminal state | Who owns the next step? |
| Correction and rollback | How was the record repaired? |
09 / Version the workflow as one release unit
Version the workflow as one release unit
- describe the intended change and affected actions;
- identify the test cases and risks that must be rerun;
- compare the candidate with the current version on the same answer key;
- require approval from the technical and operational owners;
- deploy to a limited cohort;
- monitor corrections, failures and downstream outcomes;
- preserve a tested rollback or disable path.
10 / Assign operating ownership before launch
Assign operating ownership before launch
| Role | Accountable decision |
|---|---|
| Business owner | Job, eligible cohort, expected outcome and budget |
| Sales or service owner | Qualification, handoff, customer promise and exception handling |
| RevOps owner | CRM semantics, ownership, suppression and reporting |
| Technical owner | Integrations, state, deployment, reliability and rollback |
| Risk owner | Data use, market rules, prohibited actions and incident escalation |
| Content or knowledge owner | Approved claims, source updates and expiry |
| QA owner | Answer key, review sample, severity and promotion evidence |
11 / Design retries and exception ownership
7. Design retries and exception ownership
- error category;
- record and run ID;
- last safe state;
- evidence and proposed action;
- attempts and provider responses;
- human owner;
- deadline or service expectation;
- allowed resolution;
- correction and re-entry rule.
12 / Create a prelaunch test pack
8. Create a prelaunch test pack
| Test family | Example |
|---|---|
| Normal | Eligible lead with complete evidence and valid slot |
| Missing | No timezone, owner or required qualification answer |
| Contradictory | CRM and form disagree on company or country |
| Duplicate | Same person, account or action arrives twice |
| Suppressed | Contact or account has an opt-out or active owner |
| Stale | Old role, archived domain or expired availability |
| Adversarial | Prompt injection or request to ignore policy |
| Unsupported | Prospect asks about an unapproved product or legal topic |
| Tool failure | Timeout, partial write, provider 500 or invalid response |
| Handoff | Human requested, no agent available or queue fails |
| Permission | Model proposes a stage, price or owner change it may not make |
| Rollback | Write succeeds, then reviewer reverses it |
- initial state;
- approved evidence;
- expected proposal;
- allowed and prohibited actions;
- expected event trail;
- human owner;
- pass rule;
- cleanup or rollback.
13 / Roll out in stages
9. Roll out in stages
Shadow mode
Approval mode
Limited autonomy
Monitored expansion
14 / Build versus buy
Build versus buy
- the job matches a product's documented pattern;
- your team lacks the engineering capacity for telephony, orchestration or monitoring;
- the vendor can expose sufficient logs, permissions and exports;
- implementation support is worth the service cost;
- the contract preserves data, access and exit rights.
- proprietary evidence or decision logic creates the value;
- field-level CRM permissions are unusual;
- you need provider choice or custom latency/cost tradeoffs;
- the product cannot implement the required handoff or rollback;
- you have engineers and an operational owner for production.
15 / Common failure modes
Common failure modes
The agent owns too many decisions
The prompt contains policy
The system cannot explain a field
Retries create duplicates
The handoff is a transcript dump
The pilot shows more meetings but no better pipeline
16 / Frequently asked questions
Frequently asked questions
Do I need to code an AI sales agent?
Which model should I use?
Should the AI write directly to CRM?
How do I prevent hallucinations?
What belongs in the human handoff?
17 / Production checklist
Production checklist
- the job contract has one primary outcome;
- evidence fields have authority and freshness rules;
- every external action has an idempotency key;
- permissions are action- and field-specific;
- high-impact writes require approval;
- suppression fails closed;
- time and arithmetic use tested code;
- tool calls have postcondition checks;
- retries have ceilings and owners;
- logs contain evidence, versions, action and outcome;
- handoff and no-agent fallback are tested;
- rollback does not depend on the model;
- the team can pause, export and revoke the system;
- warning and stop rules are defined before launch.
Research note
Methodology
- 01The architecture applies NIST risk-management principles to an operational sales workflow rather than presenting a vendor blueprint.
- 02Calendar and CRM examples come from anonymized owner-supplied operating evidence in an affiliated NextLevel.AI context.
- 03The guide makes no universal model, accuracy, ROI or conversion claim; those outcomes require the reader's own fixed test set and baseline.
Source ledger
Sources & editorial notes
- 01NIST AI Risk Management Framework
nist.gov · Primary, official or disclosed research source used for the bounded claim cited in this guide; scope and current status require rechecking.
- 02Generative AI Profile
National Institute of Standards and Technology · Primary, official or disclosed research source used for the bounded claim cited in this guide; scope and current status require rechecking.