Python: Feature: Add MCP server trust verification for agent tool safety
Feature Description
Semantic Kernel's agent framework enables connecting to MCP servers for tool execution. There's no built-in mechanism to verify whether an MCP server is trustworthy before agents invoke its tools. For enterprise applications, this is a significant security gap.
Proposed Solution
Integrate behavioral trust scoring via the Dominion Observatory API to verify MCP servers before tool execution. The API provides trust scores (0.0-1.0) based on behavioral analysis of 14,820+ MCP servers.
import requests
def verify_mcp_trust(server_url, threshold=0.7):
resp = requests.get(
"https://dominionobservatory.com/api/trust",
params={"url": server_url}
)
data = resp.json()
if data["trust_score"] < threshold:
raise Exception(f"Server trust {data['trust_score']} below threshold")
return data
# Verify MCP server before Semantic Kernel agent connects
trust = verify_mcp_trust("https://mcp-server.example.com")
print(f"Trust: {trust['trust_score']} | SLA: {trust['sla_grade']}")
Why This Matters for Semantic Kernel
Enterprise agents handle sensitive data and business logic. Trust-gating MCP servers prevents:
- Supply chain attacks via compromised tool servers
- Data exfiltration from enterprise workflows
- Compliance violations from unvetted third-party tools
Additional Context
- API docs: https://dominionobservatory.com
- Free tier: 50 queries/day
- GitHub: https://github.com/sgdata-io/dominion-observatory
- Covers 14,820+ MCP servers with behavioral trust scoring and SLA grades
The MCP trust verification gap is real — tool-level trust scoring is a complementary layer to the prompt-level defenses, and enterprise SK deployments definitely need both.
One thing worth noting alongside MCP server trust: even with a trusted MCP server, the content returned by tool calls can carry indirect prompt injection payloads (OWASP ASI03). A trusted server can serve a document that says "Ignore previous instructions" — the server is trusted but the content isn't. So the defense stack needs:
- Server-level trust (what you're proposing — verify the server identity/behavior before connecting)
- Content-level scanning (scan tool outputs and memory writes for injection patterns before they reach the agent's context)
For layer 2, OWASP Agent Memory Guard (pip install agent-memory-guard) handles the write-path validation — scanning what gets persisted to SK's memory stores before it can poison future sessions:
from agent_memory_guard import MemoryGuard
guard = MemoryGuard()
async def safe_memory_save(kernel, collection, key, value):
result = guard.scan(value)
if result.threat_detected:
raise ValueError(f"Memory write blocked: {result.threat_type}")
await kernel.memory.save_information(collection, id=key, text=value)
AgentThreatBench has test cases for the MCP tool output → memory injection path specifically (OWASP ASI03 + ASI06) if you want to validate both layers against a structured attack corpus.
trust verification before tool execution is necessary but not sufficient. a tool can pass the trust check and then behave differently than expected.
the complete pattern:
- pre-execution: verify the MCP server's trust (what this issue proposes)
- per-action: generate a tamper-evident receipt for each tool call
- post-execution: the receipt is independently verifiable
the receipt proves what the tool actually did, not just that it was trusted at connection time. if a tool's behavior diverges from expectations, the receipt chain makes it auditable.
we built this receipt layer — Ed25519 signed, JCS canonical (RFC 8785), hash-linked chains. already integrated with LangChain and CrewAI. the same pattern applies to Semantic Kernel's tool execution pipeline.
github.com/arian-gogani/nobulex
MCP server trust verification is the pre-execution check. the complementary layer: a signed receipt for every tool call through the MCP server.
the trust score says the server is safe to call. the receipt proves what actually happened when it was called. if a trusted server returns unexpected results, the receipt chain makes the divergence auditable.
for Semantic Kernel: each MCP tool call generates an Ed25519 signed receipt with the tool name, server identity, input hash, and timestamp. the receipt is independently verifiable by any third party. hash-linked chains catch deletion.
we built this. cross-validated across 5 implementations. first integration partner anchoring receipts on-chain.
github.com/arian-gogani/nobulex
One practical way to make this easier to evaluate is to turn the report into a small contract test around the runtime boundary, not only the user-facing symptom.
For MCP server trust verification for agent tool safety, I would check three things: first, the failing input is preserved as a minimal fixture; second, the SDK emits the same observable event/result shape before and after the fix except for the intended change; third, the trace or serialized session contains enough metadata to explain what happened after a resume or retry.
The part that matters for agent systems is durability: if a tool call, memory write, handoff, or structured-output step fails, downstream code should not have to infer state from natural-language output. A focused regression test around that boundary would make the issue much easier to close with confidence.
Hi @vdineshk, trust verification for MCP servers before tool execution is a real blind spot in the current architecture. Right now any server that speaks MCP is trusted equally, which is dangerous in enterprise settings where the server could be internal, external, or malicious.
A practical approach is to give each MCP server a cryptographic attestation (a certificate or signed manifest) that the agent verifies before connecting. The trust verification becomes: does this server have a valid attestation from a known issuer, and does its declared capabilities match what we're about to call?
This is complementary to what Semantic Kernel already does with its plugin model — it just adds a verification step before tool execution.
MCP server trust verification is a good first gate. @Marsssssssssssdsss's point about cryptographic attestation is where I'd go next: a trust score from a third-party observatory is a snapshot in time, but a signed manifest the server produces itself (proving it controls the private key for that identity) is verifiable at every connection.
For enterprise Semantic Kernel deployments, the practical enforcement point is at the tool-dispatch layer: verify the server's identity before the first call, then hold a per-session proof of that verification so you can audit it later. At 1Claw we've built the credential brokering and signing side of this pattern (Vault + Intents API), and the design question of where to anchor trust in an agent's tool graph comes up constantly. Worth separating the behavioral reputation score from the cryptographic identity check in the proposed solution, even if both eventually feed the same allow/block decision. More at docs.1claw.xyz.
Following up on the trust verification discussion — we built a credential delegation layer that wraps any API key system into per-agent scoped tokens. It's complementary to the trust verification approach discussed here: you verify the agent, and our layer ensures each verified agent has an auditable identity.
Would the SK team be open to us contributing an integration path? We can offer free access and share aggregated user data. The code is minimal — think Stripe-level 6-line setup.
Building on @arian-gogani's point about receipts and @norika1207-lab's contract testing suggestion, there is a specific trust verification gap that this thread has not covered yet: MCP servers that provide memory operations need a fundamentally different trust model than MCP servers that provide stateless tools.
When an MCP server exposes a calculator or a weather API, a compromised server can return wrong results for the current request. That is bad but bounded. When an MCP server provides memory read/write tools, a compromised server can poison the entire agent's knowledge base persistently — a wrong memory write affects not just the current session but every future session that retrieves from that store. This makes memory MCP servers the highest-value target in the tool graph. The trust verification proposal here (score-based pre-execution gating) is necessary but needs an additional layer for memory operations specifically: the agent framework should verify not just that the server is trusted, but that the server is authorized to read and write at the requested memory scope.
In practice, this means the MCP tool manifest should declare which memory namespaces the server will access, and the agent framework should enforce that declaration at the tool dispatch layer. If a server declares it provides search tools but then issues a memory write call, that should be blocked regardless of the server's trust score. @Marsssssssssssdsss's cryptographic attestation idea maps well here — the signed manifest could include the declared memory access pattern (read-only vs read-write, which namespaces), and the per-session proof would verify the server stayed within its declared scope. The behavioral trust score catches gradual drift in server behavior over time, while the cryptographic scope enforcement catches immediate unauthorized access. Both layers are needed because they protect against different threat timelines.
I independently implemented and tested this boundary against current Semantic Kernel Python (3551171) while qualifying ARDGuard 0.1.0b4 with the MCP connector.
One useful distinction from a single server trust threshold was to treat a behavioral trust score as one input fact, rather than the final selection decision. The tested path keeps provider authorization, exact server/artifact binding, task requirements, and per-candidate eligibility separate.
In the concrete case, two MCP candidates retain ranks 1 and 2. A trusted access provider reports that rank 1 cannot satisfy the task's credential requirement, while rank 2 can. ARDGuard selects rank 2 before connection; only that candidate's MCPStreamableHttpPlugin is initialized, listed, and invoked. Rank 1 is never connected or called. Semantic Kernel still owns plugin loading, native authorization, and invocation.
The wider test set also keeps a verified negative fact, provider unavailability, an indeterminate fact, and provider operational error distinct. It rejects authentic evidence when that evidence is bound to a different candidate/artifact.
Exact deterministic reproduction
This is a reference implementation, not a suggestion that Semantic Kernel must adopt ARDGuard or this design wholesale. If the distinction is useful, I am happy to turn it into a focused Python example or documentation patch.