AgentShield: Runtime security guard for Haystack pipeline tool calls #11140
Replies: 1 comment
-
|
For Haystack, the most useful integration pattern would probably be a first-class pre-tool component rather than only a decorator around individual tools. The reason is that the guard needs context beyond the function call itself. A good decision normally depends on:
I would model the guard as producing a structured decision object, for example One design point I would be careful with is fail-open behavior. It is acceptable for low-risk read-only tools, but for tools that send email, modify records, call external APIs, execute code, or access confidential data, the default should be configurable and preferably fail-closed or require human approval. A dedicated Haystack component could also make trust labels explicit in document metadata. For example, retrieved documents from web/email uploads could carry In short: this is a valuable control point, but I would make the integration policy-driven, context-aware, auditable, and risk-tiered by tool impact. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Haystack community!
We've open-sourced AgentShield, a runtime security layer for AI agents that intercepts tool calls before execution. We think it's a natural fit for Haystack pipelines where agents invoke tools.
The problem
When a Haystack agent processes external data (emails, web pages, RAG documents) and has access to tools, a prompt injection hidden in that data can trick the agent into misusing tools — sending unauthorized emails, exfiltrating data, or executing malicious code.
How AgentShield helps
Every tool call passes through a multi-layer security pipeline:
Integration with Haystack
AgentShield can integrate as a pipeline component that wraps tool-calling nodes:
Or as a pre-execution guard in custom components that checks tool name + params against policy before forwarding to the actual tool.
We also have a transparent sidecar proxy mode that requires zero code changes — it intercepts HTTP traffic between the agent and tool services.
Links
Would love to hear from Haystack users about your security concerns with agent tool execution. Happy to build a dedicated Haystack component if there's interest.
Beta Was this translation helpful? Give feedback.
All reactions