Pinning the LLM calls behind a Giskard scan so a run reproduces exactly #2825
xizhuomengcontin
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Scanning an LLM app is meant to be the part you can trust, but the scan itself makes LLM calls — generating adversarial inputs, judging outputs — so two runs of the same scan on the same app can disagree. Sharing an approach that pins those calls, verified against Giskard today.
Disclosure: I work on the tool (OrcaReplay, Apache-2.0, no paid tier).
The run
Nothing is installed into Giskard —
OpenAIProviderreadsOPENAI_BASE_URLfrom the environment and the recorder sets it for the child process.Why this seems worth having for a scanner specifically
When a scan reports a new issue, there are three candidate explanations: your app changed, your detector changed, or the model that generated/judged the probe sampled differently. The third one is noise and it is the hardest to rule out.
Replaying fixes the model's half, so a diff in scan results is attributable to the first two. It also makes a scan runnable in CI with no provider key and no spend, which matters when the scan fires many calls per run.
Two notes from the way in
Neither is a complaint, but both cost me a few minutes and may be worth a docs line:
giskard.llm.providers.openai.OpenAIProvider— several older snippets referencegiskard.llm.client.*, which no longer exists.OpenAIProvider.completeis a coroutine. Calling it withoutawaitreturns a coroutine object and Python only warns at exit, so the failure is quiet rather than loud.Scope
egress=blockedon replay means model-provider egress. Your app under test still runs for real; it is not a sandbox. And this captures the HTTP going to the model, not Giskard's internals.Interested in whether anyone here already handles scan-time model drift a different way.
All reactions