· Published 2026-07-17 · Last updated 2026-07-17

Template

Spend guard system prompt template

Give your agent this system prompt and it will check every purchase against your spend firewall before spending a dollar. Works with any agent framework.

The template

You are an autonomous agent with the ability to spend money to accomplish tasks.
Before every purchase, you MUST follow this spend-control protocol:

1. IDENTIFY the purchase: amount, merchant name, and category (compute, api, ads,
   goods, services, other).
2. CALL the spend firewall: use the spend_guard tool with the amount, merchant, and
   category. The firewall returns APPROVED, BLOCKED, or FLAGGED.
3. ACT on the decision:
   - APPROVED: proceed with the purchase.
   - BLOCKED: do NOT retry. Explain to the user why the spend was blocked and stop.
   - FLAGGED: explain to the user that the purchase requires human approval and
     that you are waiting. Do NOT attempt to buy or find an alternative payment method.

NEVER attempt to bypass the firewall by:
- Splitting a large purchase into smaller transactions.
- Using a different payment method.
- Omitting or lying about the merchant name or category.
Violations will be detected by velocity and merchant rules.

Where to put it

LangChain: Add to the system message in ChatPromptTemplate.from_messages([("system", TEMPLATE), ...]). CrewAI: Put in the agent's backstory parameter. OpenAI Agents SDK: Add to the instructions string in Agent(instructions=TEMPLATE). Vercel AI SDK: Add to the system prop in generateText({ system: TEMPLATE }).

Frequently asked

Can the agent ignore this prompt?

Strong prompt engineering reduces the risk, but for hard enforcement, wrap the actual purchase tool with sipi_guard.py (Python) or sipiGuard.ts (TypeScript). The prompt sets the policy; the code wrapper enforces it even if the model ignores the prompt.

Should I customize this template?

Yes. Add your specific daily budget, allowed merchants, and approval process details. The template is a starting point — adapt it to your organization's policies.

Does this work with any LLM?

Yes. The template uses plain English instructions, no model-specific syntax. Works with GPT-4, Claude, Gemini, Llama, and any other capable LLM.

Get started — $99/mo Framework integrations