NORNR
Mandates, approvals and evidence for autonomous agents.
Guide / Claude computer use
10 minutesHow to set a cost limit on Claude computer use agents
Add a governed wallet and approval gate to Claude computer use sessions to cap spend and require human sign-off above a threshold.
1. Why computer use agents need a spend gate
Claude computer use gives an AI agent control of a browser or desktop environment. These sessions consume significant token budget — a long browser automation run against a complex site can cost tens of dollars per session if unchecked.
Unlike a simple API call, computer use sessions are hard to interrupt mid-run. The right intervention is before the session starts. NORNR adds a mandate check at session launch: the session proceeds only if it is within the approved budget and counterparty policy.
2. Install the SDK
pip install agentpay anthropic
3. Gate the computer use session before it starts
import anthropic
from agentpay import Wallet
# Wallet for this computer use workflow
wallet = Wallet.create(
owner="claude-computer-use-browser-agent",
daily_limit=100,
require_approval_above=25,
base_url="https://nornr.com",
)
# Estimate cost for a typical session and gate it
ESTIMATED_SESSION_COST = 18.00 # conservative estimate in USD
decision = wallet.pay(
amount=ESTIMATED_SESSION_COST,
to="anthropic",
purpose="computer use browser automation session",
)
if decision.get("status") != "approved":
print(f"Session not approved: {decision.get('status')} — {decision.get('reasons', [])}")
raise SystemExit(1)
# Proceed with computer use session only after approval
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-opus-4-6",
max_tokens=4096,
tools=[{"type": "computer_20241022", "name": "computer", "display_width_px": 1280, "display_height_px": 800}],
messages=[{"role": "user", "content": "Navigate to the dashboard and export the monthly report."}],
betas=["computer-use-2024-10-22"],
)
print(response)
Set ESTIMATED_SESSION_COST conservatively. The decision records the intent — you can reconcile actual usage against it in the audit trail after the session completes.
4. Decision output
{"status": "approved", "requiresApproval": false}
{"status": "queued", "requiresApproval": true}
{"status": "rejected", "reasons": ["require_approval_above_threshold"]}
5. Handling queued sessions
When a computer use session is queued, the operator reviews the intent in the NORNR control room: the declared amount, counterparty and purpose are all visible. The operator approves or rejects, and the session is either released or cancelled with a recorded reason.
This is the most important difference between a spend limit and a spend gate. A limit lets the session run and bills you afterward. A gate stops the session from starting until the mandate is satisfied.
6. Common mistakes
- Underestimating session cost — set a conservative upper bound, not an average.
- Running the computer use session in the except block — never let a blocked session proceed.
- Using one wallet for all session types — create separate wallets with appropriate limits per task category.