The guard wraps the call your agent already makes. You keep your MCP client, your Login with Amazon tokens and your account selection. The guard needs three things: the mandate, your view of the account (current budgets and bids, brand per campaign) and the function that sends the call.
pip install "moltrust-enforce[client]>=0.7"
from moltrust_enforce import EnforceClient
from moltrust_enforce.adapters.amazon_ads import AmazonAdsGuard, Forbidden, HoldRequired
guard = AmazonAdsGuard(EnforceClient("https://api.moltrust.ch", api_key=KEY), profile)
try:
guard.call(tool, args, send_to_amazon, context=account_state)
except HoldRequired as e:
approval_queue.put(e.outcome) # a person signs, then the call runs
except Forbidden as e:
log.warning(e.outcome.reason) # names the limit, e.g. daily_budget 5,000.00 outside 0.00..500.00
| Sent per check | Example |
|---|---|
| Tool and kind of change | campaign_management-update_campaign_budget, budget_daily |
| Ad account ID and brand | ENTITY1ABC, Acme Outdoor |
| The limited values, in cents or basis points | new daily budget, account total after the change, bid change |
| Decision minute | for the mandate's validity window |
Not sent: tokens, client IDs, campaign names, targeting, creatives, reports or any response from Amazon.
/mcp/lite every operation arrives as amazon_ads_mcp-invoke_tool. The guard unpacks it and checks the inner tool. Amazon does not document the wrapper's argument names yet; anything the guard cannot read is forbidden.Encoding and the Amazon tool facts behind it: aae-ads-profile.md. Example repository: moltrust-ads-example.