An SDK's happy path is the cheapest thing to test and the least valuable. A response that parses cleanly tells you the transport works and your JSON shape matches. It tells you nothing about the two minutes a month when the provider returns 429, when a proxy truncates a chunked response, or when a socket dies between the tool-call header and its arguments. Those are the moments that corrupt databases and wake people up.
The reason to test failure modes is that production code acts on failures, not successes. On success your function returns a string. On failure it decides whether to retry, how long to wait, whether to reuse an idempotency key, whether to write a half-finished record, whether to tell the user something actionable. Each of those decisions is a branch, and branches need tests.
There is a second reason, specific to model SDKs. The dependency itself is a moving target. Software supply chain research keeps showing how quickly trust in a package can be abused: a single malicious or simply changed version spreads through automated pipelines before anyone reviews it, which is the core lesson of both the npm ecosystem attack analysis and the NCSC guidance on checking dependencies. If a version bump can change your SDK's retry defaults, your failure tests are also a regression alarm. The same idea applies to model artifacts: verify integrity with checksums before use, as discussed in this walkthrough of AI supply chain security.
The pattern generalizes. CISA's Cyber Essentials frames readiness as practicing the response before the incident, and the starter kit's crisis-response chapter makes the point plainly: plan, prepare for, and drill for attacks as you would a fire. A failure-mode suite is the fire drill for your SDK.



