Developer Tools

v1.15.1

The popular AI library fixes critical security flaws that could have exposed internal systems via user-controlled image URLs.

Deep Dive

Instructor, the popular open-source library by Jason Liu (jxnl) for adding structured outputs to LLMs, has released a critical security patch in version 1.15.1. The update primarily addresses Server-Side Request Forgery (SSRF) vulnerabilities within its AWS Bedrock integration. Specifically, the library now blocks remote HTTP(S) image URL fetching in the `_openai_image_part_to_bedrock` function, accepting only secure `data:` URLs. This prevents malicious actors from using user-controlled image URLs to probe internal networks or services. A similar fix was applied to the PDF processing module (`PDF.to_bedrock`), restricting sources to base64 data or `s3://` URIs to prevent both SSRF and local file disclosure.

Beyond security, the release includes significant feature updates and dependency bumps. It adds new `completion:error` and `completion:last_attempt` hooks that provide developers with `attempt_number` and `max_attempts` context for better error handling. The Anthropic provider now correctly sets a `User-Agent: instructor/<version>` header and initializes usage tracking properly for its reasoning and parallel tools modes. The library also upgrades its core Anthropic SDK dependency from version 0.76.0 to 0.88.0, bumps the LiteLLM upper bound to ≤1.83.0, and fixes a regression where `cachePoint` dicts in Bedrock message content were being altered.

Key Points
  • Patches critical SSRF vulnerabilities in AWS Bedrock image & PDF processing, blocking remote URL fetching.
  • Upgrades Anthropic SDK to v0.88.0 and adds new error-handling hooks with attempt context.
  • Fixes bugs in parallel tool consumption and Bedrock cachePoint handling, affecting stability.

Why It Matters

Developers using Instructor for production AI apps must update immediately to prevent potential data breaches and system infiltration.