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.
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.
What Happens
With a $25 cutoff and Block on:
| Order amount | Result |
|---|---|
| An $18 mug | The order function runs. |
| An $80 gift card | The call is denied. The function body never runs. |
| No amount on the call | The 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
- In the app, open Policies and click Create Policy.
- Choose Purchase Guard.
- Leave Named Tools selected and type the real function name, such as
place_order. - Choose a Currency. USD is the default. Set Deny Above in that currency.
- Leave Amount Field as
amount, or enter the field your tool uses. - Set the mode to Block, then click Activate Policy.
- Wrap the agent with govern() and mark the purchase function as a tool.
Named Tools Or Detect Automatically
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.