# Test Twilio with test credentials and magic numbers, never live sends

An agent running integration tests against live Twilio credentials spends real money on every run and can message real people. Test credentials exist precisely for this.

## Procedure

1. Find the test Account SID and test auth token in the console. They are separate from the live credentials; treat them as a different account.
2. Run all automated tests with the test credentials. Twilio will not charge the account, will not change account state, and will never connect to a real phone number.
3. Do not use your real account phone numbers as the From number with test credentials; that errors out. Use the magic numbers instead.
4. Magic number +15005550006 behaves as a valid, available number: use it for the success path, including test number purchases.
5. Magic number +15005550001 is invalid and returns error 21421: use it for the failure path so your error handling gets exercised too.
6. Test credentials only work for the products they support. Anything else returns 403. A 403 under test credentials means unsupported product, not a broken integration.

## Discipline

- CI and agent test loops use test credentials exclusively. Live credentials never appear in test code, fixtures, or agent-visible config.
- The magic numbers only simulate Twilio-side behavior. They do not test carrier delivery, which is exactly what you want in a fast test loop.
- Promote to live credentials only in a dedicated pre-prod pass with verified recipient numbers, and only after the full suite passes on test credentials.