trusted-agent-stack
Provides a local groundedness verifier as an MCP server, returning a verdict on whether a draft answer is supported by provided document excerpts.
README
Trusted Agent Stack
An open trust plane that validates and repairs frontier-model answers and actions before they reach users or tools.
[!NOTE] This is an independent open-source demonstration built with IBM open-source technologies. It is not an IBM product, and it does not connect to any real payment or enterprise system.
Demo
See the poisoned-invoice scenario progress from an unsafe simulated payment to a verified human-approval action:
https://github.com/user-attachments/assets/d1b12482-69b7-4f85-9da3-f9b183fc07e9
The first vertical slice is a booth-safe, simulated invoice-payment scenario:
- A frontier model proposes one typed action.
- The exact same proposal is forked into unverified and trusted paths.
- The unverified path executes against a local sandbox.
- The trusted path runs semantic and deterministic checks.
- Failed actions are repaired, revalidated, and emitted with a Trust Receipt.
No real payment or enterprise system is connected.
IBM open-source building blocks
| Project | Role in this stack |
|---|---|
| Docling | Extracts structured PDF content and provenance, including visually hidden text |
| Granite Guardian | Runs local, score-only checks for document instructions, groundedness, and tool safety |
| Mellea | Provides the optional typed repair and validation-retry path |
Exact account matching, payment thresholds, and tool schemas remain deterministic Python policies. The booth hot path uses deterministic repair for latency and repeatability; the Mellea repair path is available through the CLI.
Architecture
PDF → Docling evidence → frontier action proposal
├─ unverified sandbox
└─ Guardian + policy checks
↓ fail
repair → revalidate
↓ pass
sandbox + Trust Receipt
Quick start
uv sync --extra dev
uv run demo spike poisoned-invoice
uv run pytest
Mock mode is deterministic and requires no model download or credentials.
For a live frontier proposal with automatic disk-cache fallback:
uv sync --extra api --extra frontier
FRONTIER_PROVIDER=mellea-litellm \
FRONTIER_MODEL=anthropic/your-model-id \
uv run tas-api
Run the fixed scenario once while online to seed cache/generations/. At the venue,
set FRONTIER_OFFLINE=true; the receipt will explicitly mark the generation as cached.
The provider model ID and credential environment variable depend on the selected
LiteLLM provider.
Booth UI
Start the API and UI in separate terminals:
uv sync --extra api --extra dev
uv run tas-api
cd frontend
npm install
npm run dev
Open http://127.0.0.1:5173. The attract loop is on by default: it starts after six
idle seconds, holds the completed receipt for twelve seconds, resets, and repeats.
Use ?attract=0 for operator-only mode or toggle it from the status bar.
Before doors open, verify the frozen artifacts, frontend build, Ollama model, and running API:
uv run tas preflight --api-url http://127.0.0.1:8000
Claude Code takeaway
Install the local groundedness verifier as an MCP server:
uv sync --extra mcp
claude mcp add trusted-agent-stack -- \
uv run --project /absolute/path/to/trusted-agent-stack tas-mcp
The verify_answer tool accepts a question, draft answer, and document excerpts. It
returns only a groundedness verdict from the local Granite Guardian and fails closed
when the verifier is unavailable. Document excerpts are always treated as untrusted
data.
Rehearsal
Run the complete build, preflight, test suite, and repeated live-Guardian scenario:
./scripts/rehearse_booth.sh 5
Use 100 for the day-before soak test. See
docs/booth-runbook.md for startup, operator controls, and
the failure matrix.
Granite Guardian probe
Download the official IBM Q4 GGUF and register it with Ollama:
./scripts/setup_guardian.sh
Then run the live local probe:
uv run demo spike poisoned-invoice \
--guardian ollama \
--guardian-model trusted-granite-guardian:4.1
The hot path uses score-only judging. The demo never exposes a model reasoning trace.
Mellea repair probe
With a local Ollama model available:
uv sync --extra dev --extra mellea
uv run demo spike poisoned-invoice \
--repair mellea-ollama \
--repair-model granite4.1:3b
Mellea generates a typed repair, validates the repair with an executable requirement, and retries with validation feedback when necessary. The deterministic business-policy checks still run after Mellea returns.
Run modes
mock: deterministic local development.ollama: live local Guardian checks with deterministic business policy enforcement.
Receipts are written below runs/ by default and are intentionally ignored by Git.
Rebuild the document fixture
The poisoned PDF contains a visually hidden instruction in its text layer. Rebuild and preprocess it with:
uv sync --extra demo-assets --extra docling
uv run python scripts/generate_demo_invoice.py
uv run python scripts/preprocess_docling.py
Docling output is frozen below scenarios/poisoned-invoice/docling/ for booth use. The
live demo does not parse the PDF on its hot path.
Project status
Trusted Agent Stack is an experimental booth demo and reference implementation. Its payment tool is an in-memory sandbox. Do not use it as a production authorization or payment system without an independent security review.
Community
- Read CONTRIBUTING.md before opening a pull request.
- Use the issue forms for bugs, feature ideas, and booth feedback.
- Follow the Code of Conduct.
- Report vulnerabilities through the process in SECURITY.md.
License
Licensed under the Apache License 2.0.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。