Purchase Guard

Stop an AI agent from placing an order or buying above an amount you set. Purchase Guard denies the tool call before the purchase function runs, with optional human approval.

Real-Time(Preventive)Checked before the call runs, so it can stop it

A storefront agent can call place_order, and the model fills in the amount. Purchase Guard checks that amount before the function runs. Above your cutoff, the order is not placed.

Runs On
The SDK only
You Set
The purchase tool names, a currency, and a Deny Above cutoff in that currency.
Your Agent Sends
The order amount in the tool arguments

What Happens

With a $25 cutoff and Block on:

Order amountResult
An $18 mugThe order function runs.
An $80 gift cardThe call is denied. The function body never runs.
No amount on the callThe rule is skipped and the function still runs. The match is recorded as a warning.

Observe records the match and lets the call through. Warn does the same and marks what would have happened. Only Block denies the call.

Set It Up

  1. In the app, open Policies and click Create Policy.
  2. Choose Purchase Guard.
  3. Leave Named Tools selected and type the real function name, such as place_order.
  4. Choose a Currency. USD is the default. Set Deny Above in that currency.
  5. Leave Amount Field as amount, or enter the field your tool uses.
  6. Set the mode to Block, then click Activate Policy.
  7. Wrap the agent with govern() and mark the purchase function as a tool.

Named Tools Or Detect Automatically

Named Tools is the accurate choice. Detect Automatically guesses from words like buy, purchase, gift, and checkout. A function named just order, with no purchase verb, is not matched.

Optionally Ask A Person First

Turn on Ask For Approval and set a lower limit. Orders at or below it run. Orders between it and Deny Above wait for a person in the Approvals inbox. Orders above Deny Above are still denied. Approving does not place the order for you. Your own server does that. Your agent needs Python SDK 0.1.32 or TypeScript SDK 0.1.18 or later. Read the approval guide.

Good To Know

  • Traccia does not place orders or charge cards. It only decides whether the function may run.
  • This policy needs the SDK and a tool span. It does not apply on the Gateway.
  • It is not Spend Cap, which limits the model bill.

Next Steps

© 2026 Traccia.