Skip to main content
Autonomous agents are powerful because they can take many actions in sequence. They’re dangerous for the same reason: a runaway loop, an unexpectedly expensive model call, or a buggy tool invocation can send API costs spiraling. AgentGuard is PRYSM’s built-in cost-safety layer for multi-step agent runs. It enforces a hard spend ceiling that the agent cannot exceed, regardless of how many steps it takes or which models it calls.

The problem: uncapped agent runs

AgentGuard: hard stop at your ceiling

AgentGuard tracks the cumulative spend across every LLM call in the run. Before each new step, it checks whether the remaining budget is enough to make a minimum-cost call. If not, it stops the agent cleanly and returns what it has so far.

The budget envelope

AgentGuard uses a conservative dual-budget strategy:
  1. Soft cap (80% of max_cost_usd) — the router switches to the cheapest eligible model when spend crosses this threshold. This squeezes the last few steps into the cheapest possible tokens.
  2. Hard cap (100% of max_cost_usd) — the run stops immediately. No more LLM calls are made. The agent returns a partial result with a stopped_reason: "budget_exceeded" flag.

Trajectory: see every step

BRAIN.md integration: repo-level cost ceiling

Set a default max_cost_per_request in BRAIN.md and AgentGuard picks it up automatically:

Verifiable proof of every run

AgentGuard produces a PrysmProof v2 receipt for the entire run, covering every step:
Store this receipt in your audit log. You can verify it later via GET /v1/proof/{request_id} (no API key required) or reconstruct the hash offline.