# Spend guards for automated Twilio sends: test-first, caps, approval gates

An agent in a retry loop against the messaging API is a money fire. These guards make automated sending safe by default.

## Procedure

1. Develop and CI-test exclusively with test credentials and magic numbers. Live credentials never touch a test suite, a fixture, or an agent-visible config file.
2. In the agent's runtime, use a restricted API key scoped to messaging only, never the master auth token. If the key leaks, the blast radius is one product, not the whole account.
3. Set usage triggers in the console: daily spend alerts that page a human. A runaway loop should wake someone up, not drain the account quietly.
4. Validate every recipient with Lookup before sending (see the Lookup skill). No spend on invalid, landline, or mistyped numbers.
5. Gate the first live send to any new recipient list behind explicit operator approval. Automate the draft and the validation; keep the send itself a human decision until the list is proven.
6. Log every send with its MessageSid and reconcile against the bill. Unexplained SIDs mean something is sending that you did not authorize.

## What this buys

- A compromised or confused agent can at most burn the scoped key's product, and the spend alerts catch it fast.
- Test credentials make the entire dev loop free, so there is never a cost excuse for testing against live.
- The approval gate is the one control auditors actually ask about. Have it, document it, keep the log.