Add xaidr integration - #595
ownerdelphisecurity wants to merge 4 commits into
Conversation
Signed-off-by: Anirudh Kotaru <anirudh@delphisecurity.ai>
|
@ownerdelphisecurity is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Signed-off-by: Anirudh Kotaru <anirudh@delphisecurity.ai>
Signed-off-by: Anirudh Kotaru <anirudh@delphisecurity.ai>
There was a problem hiding this comment.
🟡 Changes recommended
Moderate issues remain around Haystack compatibility metadata and handling scan verdicts.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds documentation for integrating xaidr with Haystack Agents for runtime security scanning.
Changes:
- Documents installation and hook-based usage.
- Adds monitoring, blocking, composition, and serialization examples.
- Describes coverage boundaries and licensing.
File summaries
| File | Summary |
|---|---|
integrations/xaidr.md |
New xaidr integration documentation and examples; compatibility metadata and tool-result handling require updates. |
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| type: Monitoring Tool | ||
| report_issue: https://github.com/delphisecurity/xaidr/issues | ||
| logo: /logos/xaidr.png | ||
| version: Haystack 2.0 |
| def scan_tool_results(state): | ||
| for message in state.data.get("messages", []): | ||
| if message.is_from("tool"): | ||
| sensor.scan(message.tool_call_result.result, direction="input") |
|
|
||
| [xaidr](https://github.com/delphisecurity/xaidr) is a local-first security sensor | ||
| for AI agents. It scans for prompt injection, jailbreak and role-override | ||
| attempts, destructive tool calls, and secrets leaving in a response — and returns |
| from haystack.core.serialization import allow_deserialization_module | ||
|
|
- frontmatter: version Haystack 2.0 -> 3.0. The page installs haystack-ai>=3.0 because the Agent hooks= API landed in 3.0, so a 2.x reader cannot follow it. Matches integrations/voyage.md, the repo's existing 3.x-only entry. - tool results: rewrite the section as audit-only. The old hook called sensor.scan() and discarded the verdict, while the prose framed it as a seam you "can close yourself" - it closed nothing. It also failed at decoration time under haystack-ai 3.1.1: @hook requires the parameter be annotated State. The section now says plainly that the hook records what a tool returned and does not stop it reaching the model, and notes that acting on the verdict means replacing the message in state. No blocking example, since none has been run. - serialization: add the missing `from haystack import Pipeline` import. - router example: add the missing `from haystack.dataclasses import ChatMessage` import - same defect as the serialization block, found by running it. - replace the `chat_generator=...` / `tools=[...]` Ellipsis placeholders in two examples, which raise AttributeError as copied. Every code block on the page was run against real haystack-ai 3.1.1 and xaidr 1.17.0. Signed-off-by: Anirudh Kotaru <anirudh@delphisecurity.ai>
|
Thanks, all three substantive points were right. Addressed in fc46081. 1. Version metadata. 2. Tool-results hook. Rewritten as audit-only. It was worse than discarding the verdict: the block failed at decoration time under haystack-ai 3.1.1, because With that fixed, I ran it end to end against a tool returning an injected payload in 3. Serialization example. 4. Wording. Leaving "secrets leaving in a response" as is. It names the egress direction that Ran every other block against haystack-ai 3.1.1 and xaidr 1.17.0. Two more failed as copied and are fixed:
Every block on the page now runs as copied. |
Adds xaidr, an open source runtime security sensor for AI agents. It hooks Haystack's Agent hook points to scan model input, tool calls, and model output, and can block a tool call before it executes.
PyPI: https://pypi.org/project/xaidr/
Repo: https://github.com/delphisecurity/xaidr
Every example on the page was executed against haystack-ai 3.1.1.