📘 Context
A marketing AI agent managing paid ad campaigns across Google, Meta, LinkedIn
must enforce daily, weekly, and per-channel spend caps to prevent budget
runaway from agent-driven optimization loops or hallucinated bid increases.
This policy acts as a deterministic gate before any bid adjustment or budget
increase action, enforcing finance-aligned spending discipline.
🎯 The Goal
Write an ad spend cap policy for a marketing AI assistant.
Variables you can use:
channel (Enum): "GOOGLE", "META", "LINKEDIN", "TIKTOK", "OTHER".
requested_action (Enum): "INCREASE_BID", "INCREASE_BUDGET", "CREATE_CAMPAIGN", "PAUSE".
proposed_daily_spend_usd (Float): Proposed daily budget.
current_daily_spend_usd (Float): Current actual daily spend.
monthly_budget_usd (Float): Approved monthly budget.
month_to_date_spend_usd (Float): Spend so far this month.
cpa_target_usd (Float): Target cost-per-acquisition.
current_cpa_usd (Float): Observed CPA in the last 7 days.
cmo_approved (Boolean): Whether CMO approved the action.
Requirements:
- BLOCK if
proposed_daily_spend_usd > current_daily_spend_usd * 1.5 and cmo_approved is False (cap on day-over-day increase).
- BLOCK if
month_to_date_spend_usd + proposed_daily_spend_usd * remaining_days > monthly_budget_usd.
- BLOCK if
current_cpa_usd > cpa_target_usd * 2 and requested_action == "INCREASE_BUDGET".
- BLOCK if
proposed_daily_spend_usd > 5000 and cmo_approved is False.
- ESCALATE if
requested_action == "CREATE_CAMPAIGN" and proposed_daily_spend_usd > 1000.
- ESCALATE if
current_cpa_usd > cpa_target_usd * 1.5.
📚 Resources
- Start here:
docs/getting-started.md
- Check syntax:
quickstart/01_hello_world.csl
- See how examples are structured:
examples/community/
✅ Definition of Done
Submit a PR with: examples/community/marketing_ad_spend_cap.csl
📘 Context
A marketing AI agent managing paid ad campaigns across Google, Meta, LinkedIn
must enforce daily, weekly, and per-channel spend caps to prevent budget
runaway from agent-driven optimization loops or hallucinated bid increases.
This policy acts as a deterministic gate before any bid adjustment or budget
increase action, enforcing finance-aligned spending discipline.
🎯 The Goal
Write an ad spend cap policy for a marketing AI assistant.
Variables you can use:
channel(Enum): "GOOGLE", "META", "LINKEDIN", "TIKTOK", "OTHER".requested_action(Enum): "INCREASE_BID", "INCREASE_BUDGET", "CREATE_CAMPAIGN", "PAUSE".proposed_daily_spend_usd(Float): Proposed daily budget.current_daily_spend_usd(Float): Current actual daily spend.monthly_budget_usd(Float): Approved monthly budget.month_to_date_spend_usd(Float): Spend so far this month.cpa_target_usd(Float): Target cost-per-acquisition.current_cpa_usd(Float): Observed CPA in the last 7 days.cmo_approved(Boolean): Whether CMO approved the action.Requirements:
proposed_daily_spend_usd > current_daily_spend_usd * 1.5andcmo_approvedis False (cap on day-over-day increase).month_to_date_spend_usd + proposed_daily_spend_usd * remaining_days > monthly_budget_usd.current_cpa_usd > cpa_target_usd * 2andrequested_action == "INCREASE_BUDGET".proposed_daily_spend_usd > 5000andcmo_approvedis False.requested_action == "CREATE_CAMPAIGN"andproposed_daily_spend_usd > 1000.current_cpa_usd > cpa_target_usd * 1.5.📚 Resources
docs/getting-started.mdquickstart/01_hello_world.cslexamples/community/✅ Definition of Done
Submit a PR with:
examples/community/marketing_ad_spend_cap.csl