Documentation Index
Fetch the complete documentation index at: https://cognisafeltd.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Anthropic uses direct mode. Because Anthropic’s API is not OpenAI-compatible, Cognisafe wraps themessages.create method on the Anthropic client rather than routing through the proxy. After the model responds:
- Your code receives the response immediately
- The SDK fires a background task that ships the request and response payload to
POST /internal/logon the FastAPI backend - The backend queues a scoring job in Redis
Installation
Setup
Supported capabilities
| Capability | Supported | Notes |
|---|---|---|
Messages API (messages.create) | Yes | Full request and response logged |
| Streaming | Yes | Captured after stream completes |
| System prompts | Yes | Included in logged payload |
| Tool use | Yes | Tool definitions and results logged |
| Vision (image inputs) | Yes | Image payloads included in request body |
Scoring note
Safety scoring always uses the model configured viaSCORER_MODEL (default: gpt-4o-mini), regardless of which Claude model was used for the original call. PyRIT’s scorers are model-agnostic — they receive the text of the prompt and response, not a reference to the originating model.
Claude models and the scoring model are completely independent. You can use
claude-opus-4-5 for your product and GPT-4o mini as the safety scorer with no conflict.Async client
patch_anthropic() also wraps the async client:

