fix(memory,a2a)!: harden Qdrant search limits and A2A trust defaults - #6615
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 20, 2026 21:29
bug-ops
force-pushed
the
fix/6553-memory-a2a-trust-hardening
branch
from
July 20, 2026 21:30
ee459a9 to
be7aa58
Compare
Address four low-severity defense-in-depth findings from a security audit: clamp caller-supplied search limits inside zeph-memory itself instead of relying on the sole external MCP-tool clamp, warn when a non-loopback Qdrant endpoint lacks TLS/an API key, warn (in logs and the TUI chat pane) when CardTrustPolicy resolves to the permissive ignore default, and require A2aClient::new callers to pass an explicit SecurityPolicy instead of silently inheriting a permissive one. BREAKING CHANGE: A2aClient::new now requires a SecurityPolicy argument. Callers of A2aClient::new(client) must migrate to A2aClient::new(client, policy) or A2aClient::new_insecure(client) for the previous permissive-by-default behavior.
bug-ops
force-pushed
the
fix/6553-memory-a2a-trust-hardening
branch
from
July 20, 2026 21:39
be7aa58 to
43a3d22
Compare
8 tasks
bug-ops
added a commit
that referenced
this pull request
Jul 20, 2026
The MAX_SEARCH_LIMIT clamp added in #6553/PR #6615 only covered the EmbeddingStore/EmbeddingRegistry/ReasoningMemory wrapper methods. A caller reaching a VectorStore implementor directly bypassed the clamp entirely — confirmed live in zeph-index's CodeStore::search and zeph-core's generic RetrievalStep<P, V: VectorStore>. Add a shared clamp_search_limit helper and call it first-thing inside search on all three production implementors (QdrantOps, DbVectorStore, InMemoryVectorStore). Wrapper-level clamps are left in place since re-clamping an already-clamped value is a no-op. Closes #6616
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four low-severity, defense-in-depth hardening fixes from a security audit sweep of zeph-memory Qdrant query construction and zeph-a2a trust boundary. None were independently exploitable — each closes a footgun that becomes real only if a future call site omits a safeguard that currently exists exactly once.
zeph-memory: clamp caller-suppliedlimit/top_kto[1, 100]directly insideEmbeddingStore::search/search_collection,EmbeddingRegistry::search_raw, andReasoningMemory::retrieve_by_embedding, instead of relying on the sole external MCP-tool clamp. Logs a one-shot warning when the clamp actually reduces a caller's requested value (covers config-driven pools likememory.retrieval.depthexceeding the ceiling).zeph-config: non-fatal warning whenmemory.qdrant_urlis non-loopback and lacks TLS and/or an API key.zeph-a2a: keptCardTrustPolicy::Ignoreas the default (behavior-preserving), but now log a warning (and surface it in the TUI chat pane) when it's in effect, so operators know peer AgentCard verification is off.zeph-a2a:A2aClient::newnow requires an explicitSecurityPolicyargument instead of silently defaulting topermissive(). AddedA2aClient::new_insecure()for callers that want the old behavior explicitly.Closes #6553
Breaking change
A2aClient::new(client)→A2aClient::new(client, policy)orA2aClient::new_insecure(client).zeph-a2ais a published crate; no workspace version bump in this PR (handled separately via/rust-release), consistent with prior precedent for this crate.Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(15000 passed)RUSTFLAGS=-D warnings+RUSTDOCFLAGS=--deny rustdoc::broken_intra_doc_links)gitleaks protect --staged