Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

We put a spend gate in front of our AI agents. It denied 35 of its first 43 decisions

Description and use

A spend gate was implemented to block AI agents from making provider calls unless the agent’s token is valid, caps are respected, and the decision is logged immutably. Out of 43 decisions, 35 were denials and 8 were allows, with total external spend of EUR 0.024.

Problem

Prevent AI agents from spending money without a deterministic pre‑call check and ensure every decision is immutable in a ledger.

Outcome

Out of 43 decisions, 35 were denials (33 due to bad or unscoped token, 1 for unknown provider, 1 for daily cap) and 8 were allows (2 test rows, 6 real image generation calls). Total external spend was EUR 0.024.

Workflow

  • Configure agents to point to http://127.0.0.1:8899/anthropic
  • Run gate as root on loopback port 8899 forwarding to real provider with key
  • On each request: 1) Verify agent identity via SHA256 token digest; 2) Check caps (per request, per day, per month, token limits); 3) Reserve worst‑case cost atomically; 4) Forward request to provider; 5) On success, settle metered cost; 6) On failure or vault lookup error, release reservation and deny; 7) Append decision to ledger with hash chain; 8) Write denial to alerts.jsonl

Evidence

Six agents run against a local proxy instead of talking to providers directly.

Source

The ledger is append-only JSONL. One record per decision, each carrying a prev field with the previous record's hash, and a separate head file with the current tip.

Source

As of the read for this post (2026-10-13 01:27 EEST, pinned with the batch) it holds 43 records: 35 denies, 8 allows

Source

  • Record date: 2026-10-12T23:41:00.837Z