NORNR
Mandates, approvals and evidence for autonomous agents.
Guide / Cursor
10 minutesHow to control AI spend when running agents in Cursor
Add a governed wallet and per-run approval gate to AI agent scripts running inside Cursor using NORNR in under 10 minutes.
1. The problem: Cursor agents have no native spend gate
Cursor lets you write and run AI agent scripts rapidly. When those scripts call paid AI APIs — OpenAI, Anthropic, Perplexity, external data vendors — there is no native checkpoint between the script execution and the billing event.
NORNR gives you that checkpoint. Run a one-line mandate check before the paid call. If the spend is within mandate, it proceeds. If it is above your approval threshold, it queues for review. If it is out of policy, it is blocked.
2. Install the SDK
bash
# In the Cursor terminal
pip install agentpay
3. Add a mandate check to your agent script
python
from agentpay import Wallet
import openai
# Create or reuse a wallet for this project's agent runs
wallet = Wallet.create(
owner="cursor-agent-project-x",
daily_limit=30,
require_approval_above=10,
base_url="https://nornr.com",
)
# Gate the paid call
decision = wallet.pay(
amount=5.00,
to="openai",
purpose="code review and refactoring suggestions",
)
if decision.get("status") == "approved":
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Review this function for security issues: ..."}]
)
print(response.choices[0].message.content)
elif decision.get("status") == "queued":
print("Spend queued — check the NORNR control room to approve.")
else:
print("Spend blocked by policy:", decision.get("reasons"))
4. TypeScript version
typescript
import { Wallet } from "@nornr/sdk";
const wallet = await Wallet.create({
owner: "cursor-agent-project-x",
dailyLimit: 30,
requireApprovalAbove: 10,
baseUrl: "https://nornr.com",
});
const decision = await wallet.pay({ amount: 5, to: "openai", purpose: "code review" });
if (decision.status === "approved") {
// run the paid agent step
} else {
console.log("Not proceeding:", decision.status, decision.reasons);
}
5. Decision output
output
{"status": "approved", "requiresApproval": false}
{"status": "queued", "requiresApproval": true}
{"status": "rejected", "reasons": ["daily_limit_exceeded"]}
6. Common mistakes
- Running the agent script without the mandate check first — the billing happens before you can stop it.
- Setting the daily limit too high for development runs where cost predictability matters.
- Silently swallowing queued decisions — log them so you remember to approve or reject.