haystack-agentmesh
AgentMesh governance components for Haystack pipelines — policy enforcement, trust scoring, and tamper-evident audit trails.
Installation
pip install haystack-agentmesh
With Haystack:
pip install "haystack-agentmesh[haystack]"
Components
GovernancePolicyChecker
Enforces governance policies loaded from YAML files. Checks tool allowlists/blocklists, content patterns, token limits, and rate limits.
from haystack_agentmesh import GovernancePolicyChecker
checker = GovernancePolicyChecker(policy_path="policy.yaml")
result = checker.run(action="search", params={"query": "hello"}, agent_id="agent-1")
# {"decision": "allow", "reason": "All policy checks passed", "passed": True}
Policy YAML example:
allowed_tools:
- search
- summarize
blocked_tools:
- delete_all
blocked_patterns:
- pattern: "DROP TABLE"
type: substring
- pattern: "rm\\s+-rf"
type: regex
max_tokens: 4096
rate_limit:
max_calls: 10
window_seconds: 60
TrustGate
Trust scoring with time-based decay and routing decisions.
from haystack_agentmesh import TrustGate
gate = TrustGate(pass_threshold=0.7, review_threshold=0.4)
gate.record_success("agent-1")
result = gate.run(agent_id="agent-1")
# {"trusted": False, "score": 0.55, "action": "review"}
Actions: pass (trusted), review (marginal), block (below threshold).
AuditLogger
Append-only audit log with SHA-256 hash chain hashing for tamper evidence.
from haystack_agentmesh import AuditLogger
logger = AuditLogger()
result = logger.run(action="search", agent_id="agent-1", decision="allow")
# {"entry_id": "a1b2c3d4e5f67890", "chain_hash": "sha256..."}
assert logger.verify_chain() # Verify integrity
logger.export_jsonl("audit.jsonl") # Export for analysis
Pipeline Example
from haystack import Pipeline
from haystack_agentmesh import GovernancePolicyChecker, TrustGate, AuditLogger
pipe = Pipeline()
pipe.add_component("trust_gate", TrustGate())
pipe.add_component("policy_checker", GovernancePolicyChecker(policy_path="policy.yaml"))
pipe.add_component("audit", AuditLogger())
Component Reference
| Component | Inputs | Outputs |
|---|---|---|
GovernancePolicyChecker |
action: str, params: dict, agent_id: Optional[str] |
decision: str, reason: str, passed: bool |
TrustGate |
agent_id: str, min_score: Optional[float] |
trusted: bool, score: float, action: str |
AuditLogger |
action: str, agent_id: str, decision: str, metadata: Optional[dict] |
entry_id: str, chain_hash: str |
Development
pip install -e ".[dev]"
pytest tests/ -v
License
Apache-2.0
Metadata
Release files for haystack_agentmesh 3.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| haystack_agentmesh-3.6.0.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| haystack_agentmesh-3.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / haystack_agentmesh-3.6.0.tar.gz
| Download URL | haystack_agentmesh-3.6.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
711eb155e34aa3f24672ba08eeea8e39be3eb82ec7e339c913c1ede882e8a81b
|
|
BLAKE2b-256 checksum How to use checksums |
8927fe4ce182547a3c91278c7af4b7875c94521192071d4aec310166e6ef82e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / haystack_agentmesh-3.6.0-py3-none-any.whl
| Download URL | haystack_agentmesh-3.6.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d7692f5ab7510be235b3c04613e3efd16c405618d96494165bc424cd0433f72
|
|
BLAKE2b-256 checksum How to use checksums |
4120f834ee80d6c551da25f9328b0c194fecab39dbe2e0aa028d3dd2ebb0146c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Security for haystack_agentmesh 3.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.