向營銷智能體提供 API 存取權限前的四項離線檢查
Four offline checks before giving a marketing agent API access
Dmitry Lukashov 提供四項在連接營銷智能體至實際帳戶前可執行的離線檢查,涵蓋廣告 CPA、競品套餐比較、CRM 活動讀取及電郵發送資格。合成數據示例中,總 CPA 為 1,200.00 RUB;競品套餐價格上升 25%,但交付時間與訪談數量也有變動;電郵樣例則有一筆按所提供規則符合資格,五筆被排除。四個合成示例命令均離線執行,但結果不驗證實際同意、送達或操作真實帳戶的準備程度。
A marketing agent can produce valid JSON and still make the wrong decision. It can average ratios instead of totals, compare packages with different scope, interpret an incomplete CRM response as absence, or turn a local email check into permission to send.
Here are four small offline exercises I use to make those errors visible before connecting an agent to a live account. Each has synthetic input and a result you can reproduce with Python 3.9+ and the standard library. There is no paid-core dependency or signup.
These are four independent tools, not an integrated marketing pipeline or a benchmark of any particular model. I maintain the modules as part of Lookatshow. AI assistance was used to prepare this article; the commands below were run against the public artifacts on 16 October 2026.
1. Check the denominator before recommending an ad change
Direct report audit reads a normalized placement CSV or TSV. It does not connect to Yandex Direct.
Download and unpack the v0.1.0 ZIP, open its directory, then run:
python3 -B direct_report_audit.py --json audit examples/synthetic-placements.csv --max-cpa 1000
The fictional input contains five rows and four grouped placements. The result has 97 clicks, 6,000 RUB cost and 5 conversions. Total CPA is 1,200.00 RUB, calculated from total cost divided by total conversions. Two placements are manual-review candidates under these demonstration thresholds.
Give the agent a narrower task than "optimize this campaign":
Recalculate the totals from the fixture. Explain why total CPA is a ratio of sums. List the review candidates and their reasons. Explain which attribution, tracking and sample-size checks would be needed before a campaign change.
An attractive recommendation to exclude a placement is not a passing answer. The program has not established causal waste or a complete customer journey. Native export headers and cost units must also be normalized first; the CLI is not a universal parser for every advertising export.
2. Separate a price change from a package change
Competitor offer radar compares supplied local snapshots. It does not scrape websites or verify that an offer was really available.
Use the pinned source archive. This later source revision includes a console-encoding fix; the original v0.1.0 release ZIP predates it.
python3 -B competitor_offer_radar.py compare examples/before.json examples/after.json
In the synthetic strategy-session package, the price changes from 10,000 to 12,500 RUB: +25%. Delivery changes from four to six business days, and interview quantity changes from two to one. The output includes scope_changed_warning=true.
Ask the agent:
Show the arithmetic and identify the changed scope. Can this establish a 25% price increase for equivalent work? What does an offer absent from the later snapshot actually prove?
A useful answer preserves the warning. Missing from a supplied snapshot does not establish that a competitor discontinued the product. Different package content does not support a clean like-for-like price conclusion.
3. Keep incomplete CRM reads out of the absence queue
Bitrix read kit has a synthetic demonstration that needs no portal or credentials. Its separate live mode is read-only and limited to what the configured user can see.
Download the v0.1.0 ZIP, unpack it and run:
python3 -B bitrix_read_kit.py demo
There are five fictional open deals and three unique visible unfinished activities. One deal has a scheduled activity, one an overdue activity, one an undated activity, one a complete activity read with no visible unfinished item, and one an incomplete activity read.
Ask:
Which deal supports an absence claim, and which needs a coverage check? Keep overdue-but-present activities separate from missing ones. State the demo's analysis time.
Deal 101 has the complete empty read. Deal 105 has incomplete coverage: its absence status cannot be established. The fixed analysis time is 10 October 2026, 10:00 MSK. Rerunning the fixture today is not a fresh portal capture, and a CRM activity is not proof of an agreed customer next step.
4. Keep a local eligibility check separate from sending
UniSender campaign kit checks a draft, a supplied permission ledger and a suppression file locally. It has no UniSender API connection, contact import or send command.
Download the v0.1.0 ZIP, unpack it and run:
python3 -B lookatshow_mail_plan.py demo
The six invented rows produce one eligible-under-supplied-rules row and five excluded rows. The reasons are a duplicate address, suppression, expired supplied permission, an unsubscribe flag and no affirmative supplied permission. All addresses use example.invalid.
The JSON still reports:
{
"consent_evidence_verified": false,
"legal_permission_verified": false,
"provider_acceptance_verified": false,
"deliverability_verified": false,
"sending_performed": false
}
Ask the agent to explain those false fields before proposing any next step. A successful command means the local calculation completed. It does not verify a person's actual consent, a provider's acceptance or delivery. The demonstration also uses a fixed evaluation time rather than today's date.
A compact acceptance prompt
After downloading and reading the four modules' READMEs, try this with your coding agent:
Run only the four bundled synthetic commands above. For each exercise, report the exact command, exit code, observed values, supported conclusion and one tempting unsupported conclusion. Compare observed values with the stated expectations and report mismatches. Do not connect accounts, fetch customer data, send messages, alter campaigns or upload files. Stop and explain any missing input. Do not present synthetic results as a client case.
The distinction to inspect is between a calculation, the evidence it actually received, and the action someone wants to take. Passing these examples does not establish readiness for a live account. Failing one gives you a specific behavior to fix first.
The open-tools catalog links the installation instructions, licenses and limitations. Each module is independently usable for free. There is no hidden telemetry in these offline exercises. If you pass real output to a cloud agent later, that provider's data policy still applies.
If you try a fixture, which unsupported conclusion did your agent make? A command, environment and synthetic mismatch are useful in a comment or repository issue; please keep customer exports, addresses and credentials private.
Prepared by Dmitry Lukashov. If your team needs help adapting this kind of evidence check to its own workflow, discuss implementation. Scope and cost are agreed separately from the free tools.
來源:DEV Community · dev.to