Anthropic API direct: keeping the key safe in your agent code.
Anthropic API direct: keeping the key safe in your agent code
The Anthropic Python and TypeScript SDKs read ANTHROPIC_API_KEY from the process environment by default, which means every dependency and prompt-injected output can read it too. Here is the broker pattern that keeps sk-ant out of the process, for both SDKs.