Enable Tool Tracing for SDK Scans
When you drive scans with the SDK, bind your conversation id to the scan session so the tool calls your agent reports join the right scan.
This is the scan-driver half of tool tracing. First instrument your agent’s runtime — see Trace Agent Tools — then bind the id here.
Prerequisites
- An agent runtime instrumented for tracing, per Trace Agent Tools
- A scan you run with the SDK — see the Quickstart
- A Red Team API Key from the AI Red Teaming platform
Bind the conversation id
In your scan driver, bind the scan session to the same conversation id your tools report with. The binding is a set-once call on the session, valid any time before the session ends — this also covers targets that reveal their id only in the first response.
TypeScript
Python
Targets you connect in the AI Red Teaming platform don’t need this — Red captures the target’s session id and associates tool activity with the scan automatically.
Reference
setConversationId / set_conversation_id
Binds the scan session to your conversation id. Set-once: callable any time before the session ends, idempotent, and errors only if you change an already-set id.