Skip to content

Commit 183f3e8

Browse files
authored
Add asqav governance integration (#439)
* Add asqav governance integration * Fix hallucinated API methods in asqav integration docs Replace non-existent asqav.wrap(), asqav.get_logs(), asqav.export_logs(), and AsqavPipeline with the real API: AsqavComponent from asqav.extras.haystack, asqav.init(), and Agent-based signing. Install command corrected to pip install asqav[haystack]. Removed fabricated features (policy enforcement, CSV/JSON export, offline storage) and documented the actual component interface and fail-open behavior. * Address review: expand overview, use OpenAIChatGenerator and ChatPromptBuilder
1 parent 32138ef commit 183f3e8

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

integrations/asqav.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
layout: integration
3+
name: Asqav
4+
description: Signed audit trails for Haystack pipelines - tamper-evident governance records for every pipeline run
5+
authors:
6+
- name: Jag Marques
7+
socials:
8+
github: jagmarques
9+
linkedin: https://www.linkedin.com/in/jagmarques
10+
pypi: https://pypi.org/project/asqav/
11+
repo: https://github.com/jagmarques/asqav-sdk
12+
type: Monitoring Tool
13+
report_issue: https://github.com/jagmarques/asqav-sdk/issues
14+
version: Haystack 2.0
15+
toc: true
16+
---
17+
18+
### **Table of Contents**
19+
20+
- [Overview](#overview)
21+
- [Installation](#installation)
22+
- [Usage](#usage)
23+
- [License](#license)
24+
25+
## Overview
26+
27+
AI agents running in production need more than observability. When a pipeline makes a decision, calls a tool, or generates output, you need tamper-evident proof of what happened, not just a log entry someone could edit later. This matters for regulatory compliance (EU AI Act Article 12 requires automatic, verifiable event recording for high-risk systems), incident investigation (reconstructing exactly what an agent did and why), and accountability across teams that share pipelines.
28+
29+
Asqav provides cryptographic governance for AI agent actions. Every action gets signed server-side with ML-DSA-65 (NIST FIPS 204), hash-chained to the previous action, and stored as a verifiable receipt the agent can't forge. The signing key never touches the agent's runtime.
30+
31+
The Haystack integration adds `AsqavComponent`, a native Haystack component that signs data flowing through your pipeline. Drop it in, and every run produces a signed, tamper-evident audit record.
32+
33+
- Tamper-evident records for every pipeline run, signed with quantum-safe cryptography
34+
- Fail-open design: signing failures are logged but never break your pipeline
35+
- Native Haystack component with typed inputs and outputs
36+
- Compliance bundle export for EU AI Act, DORA, and SOC 2 audits
37+
- Public verification endpoint: anyone can verify a signature without an API key
38+
39+
## Installation
40+
41+
```bash
42+
pip install asqav[haystack]
43+
```
44+
45+
## Usage
46+
47+
### Adding AsqavComponent to a Pipeline
48+
49+
`AsqavComponent` is a standard Haystack component. Add it to your pipeline like any other component. It accepts a `data` string and optional `metadata` dict, signs the action through asqav, and passes everything through with a `signature_id` attached.
50+
51+
```python
52+
import asqav
53+
from asqav.extras.haystack import AsqavComponent
54+
from haystack import Pipeline
55+
from haystack.components.generators.chat import OpenAIChatGenerator
56+
from haystack.components.builders import ChatPromptBuilder
57+
58+
# Initialize asqav with your API key
59+
asqav.init("sk_live_...")
60+
61+
# Build a standard Haystack pipeline
62+
prompt_template = "Answer the following question: {{question}}"
63+
pipe = Pipeline()
64+
pipe.add_component("prompt_builder", ChatPromptBuilder(template=prompt_template))
65+
pipe.add_component("llm", OpenAIChatGenerator())
66+
pipe.add_component("asqav", AsqavComponent(agent_name="my-rag-pipeline"))
67+
pipe.connect("prompt_builder", "llm")
68+
```
69+
70+
### Running and Inspecting Signatures
71+
72+
Each call to the `AsqavComponent` returns the original data, metadata, and a `signature_id` that links to the signed audit record.
73+
74+
```python
75+
result = pipe.run(
76+
{
77+
"prompt_builder": {"question": "What is Haystack?"},
78+
"asqav": {"data": "What is Haystack?", "metadata": {"source": "user"}},
79+
}
80+
)
81+
82+
# The asqav component output includes the signature reference
83+
print(result["asqav"]["signature_id"]) # e.g. "sig_a1b2c3"
84+
print(result["asqav"]["data"]) # original data passed through
85+
print(result["asqav"]["metadata"]) # original metadata passed through
86+
```
87+
88+
### Using an Existing Agent
89+
90+
If you already have an agent registered in asqav, pass its ID instead of creating a new one:
91+
92+
```python
93+
governance = AsqavComponent(agent_id="agt_x7y8z9")
94+
pipe.add_component("asqav", governance)
95+
```
96+
97+
### License
98+
99+
`asqav` is licensed under MIT. See the [GitHub repository](https://github.com/jagmarques/asqav-sdk) for details.

0 commit comments

Comments
 (0)