AntFleet

Receipt · cdf9ffa0-0

Daily spend circuit breaker compares strings as numbers; awk treats missing/non-numeric values as 0 → cap bypass

bughighclosed in 4b9b492closed in 1 hour
repo 6f7fc663·PR #4·reviewed 2 days ago·2 days ago

The finding

  • scripts/postprocess-admanage.sh:60-71
The dailySpendCap and TODAY_SPEND values are interpolated unquoted into the awk program. If TODAY_SPEND is a non-numeric string (e.g., the API returned `{"metadata":{"totalSpend":"$0.00"}}` or `null` or a JSON error blob), jq will produce a string that awk will treat as 0 and the breaker will silently pass — even when the API is broken. Worse, if the API response contains characters like `;` or whitespace, awk will misparse the expression. There is no validation that TODAY_SPEND is numeric and no error-out when the spend endpoint fails (curl|| echo '{}' silently masks failures). For a 'circuit breaker' protecting real spend this fail-open behavior contradicts the stated safety posture ('Hard-fails if ADMANAGE_API_KEY is not set (never silently skips auth)').

Fix

Validate the spend response with `jq -e`, fail closed (skip launches + notify) if the value is missing or non-numeric, and validate STRICTEST_CAP is numeric before passing to awk. Quote/escape awk inputs via `awk -v cap="$STRICTEST_CAP" -v spend="$TODAY_SPEND" 'BEGIN{...}'`.

Agent attribution

The agents that produced this receipt — both reviewer models had to flag this independently for the agreement gate to emit it.

anthropic

gpt-5

114.5s · error

openai

claude-opus-4-7

131.1s · error

Total

wall-clock review time · est. inference cost

131.1s · $0.40

Sweeper

closed at SHA 4b9b492

closed in 1 hour

internal review id · cdf9ffa0

Third-party witnesses

Everything below lives on GitHub's event log, not ours. Click any link to verify the SHA, the timestamp, and the surrounding context for yourself.

← back to all receipts

AntFleet · Daily spend circuit breaker compares strings as numbers; awk treats missing/non-numeric values as 0 → cap bypass