Consentry MCP server
Commit Oct 23, 2026Acts as a consent firewall for AI agents by enforcing field-level data minimization, real-time consent prompts, and prompt-injection quarantine.
Also known as vnmoorthy/consentry
- Stars
- 1
- Tools
- β
- Downloads, 30 days
- β
- Latest version
- β
- Last commit
- Oct 23, 2026
- License
- MIT
What is Consentry MCP?
Consentry acts as a consent firewall for AI agents by enforcing field-level data minimization, real-time consent prompts, and prompt-injection quarantine.
Summary generated from the project's README
About Consentry MCP server
Protecting personal information from AI agents is what Consentry achieves by acting as a consent firewall between models and external tools. It sits between an agent and its connected APIs, MCP servers, or other companies to enforce data minimization and security. The system inspects outbound fields to ensure sensitive details like credit card numbers or exact locations are replaced with minimized versions, such as single-use virtual cards or neighborhood-level coordinates.
Developers can deploy this as an MCP server or an HTTP gateway. It works with clients like Claude Desktop, Claude Code, and Cursor. The server can run locally in a browser without a backend or as a Node-based service requiring an Anthropic API key for Claude integration. It uses a per-field policy engine to decide whether to allow, minimize, ask, or deny data access based on the recipient's trust tier. To ensure integrity, it maintains a SHA-256 hash-chained ledger that creates a tamper-evident privacy receipt for every agent interaction.
What you can do with it
- 1Minimize sensitive data sharingAn agent can provide a neighborhood location instead of an exact GPS coordinate when booking a service.
- 2Prevent prompt injection attacksThe firewall scans incoming tool responses to quarantine malicious content or hidden exfiltration attempts.
- 3Enforce real-time user consentThe system pauses the agent to let the user choose between sharing exact data or a minimized version.
- 4Audit data exposure historyUsers can review a detailed matrix of which recipients have access to specific types of their data.
Written from the project's README. Every use case is checked against a quote from it.
Configuration
CONSENTRY_URL
| Name | Description | |
|---|---|---|
| CONSENTRY_URL | β |
Automated checks
Ran Nov 15, 2026Full report βNot verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work Β· What to fix for more points
- Source repository linked and reachablevnmoorthy/consentry is public and reachablegithub.com/vnmoorthy/consentry βPass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html βPass
- Commit or release in the last yearLast commit or release 2026-10-23github.com/vnmoorthy/consentry βPass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubConsentry is a consent firewall that sits between an AI agent and everything it talks to: tools, APIs, MCP servers, other companies, and even the LLM itself. It inspects every outbound field, minimizes what isn't needed, asks you when it matters, quarantines prompt injections coming back, and writes a tamper-evident receipt of every decision.
Live demo Β· Watch the demo video Β· Architecture Β· 10-minute demo script Β· Claude mode Β· Pitch storyboard
Table of contents
- Why this exists
- What it does
- See it in action
- How it works
- Quickstart
- Use it with Claude Desktop, Claude Code, Cursor (MCP)
- Policies in plain English
- Red team: attack your own agent
- Public data APIs
- Security model & honest limitations
- Project structure
- Roadmap
π‘ Why this exists
Personal agents are getting real power: they book tables, refill prescriptions, call ride services, query health databases. To do that they need your data: your address, your phone, your card, your medications.
Today that data is all-or-nothing. Once it is in the agent's context window it can go to any tool, any third party and the model provider. A single poisoned web page or tool response can tell the agent to send it somewhere else, and nobody can later prove what was shared, with whom, or why.
Consent banners don't fix this. Model alignment doesn't either, because a model that usually refuses is not a control. The boundary has to be enforced outside the model. That's Consentry.
The design principle: don't trust the model, enforce at the boundary. Even a fully compromised agent (we simulate one) can't move your SSN, your real card number or your mental-health data, because those bytes never get past the firewall.
β¨ What it does
| Capability | What it means for you | |
|---|---|---|
| 𧬠| Field-level PII detection | Vault fingerprints, vault tokens, regex with checksums (Luhn, SSN rules), a health lexicon, and geo-proximity to your saved places. It catches your data even when it isn't labeled. |
| βοΈ | Per-field policy engine | Each field is judged on data type Γ recipient trust tier Γ purpose: allow, minimize, ask or deny. Highest priority wins, then the most specific rule, then the most restrictive. |
| βοΈ | Minimizers | Exact GPS β ~10 km grid Β· address β neighborhood or nearest intersection Β· email/phone β relay aliases Β· card β single-use, merchant-locked virtual card Β· birthday β age range Β· allergy β "peanut-free meal required" Β· drug β generic name only. |
| β | Real consent | The agent pauses. You see the exact vs. minimized value side by side, the purpose, the recipient's retention policy, and the rule that triggered. Choose minimized Β· once Β· 30 days Β· deny. Grants expire and can be revoked. |
| π€ | The LLM is a recipient too | Claude only ever sees {{vault:tokens}}. Prompts and tool results are tokenized before they reach the model; tokens are resolved at the network edge only if policy allows. |
| β£οΈ | Ingress quarantine | Tool responses are untrusted. A noisy-OR scanner catches prompt injection, hidden HTML comments, zero-width text, exfil image URLs and templated data slots, then strips them, taints the run and locks sensitive data. |
| π« | Default-deny egress | Unverified domains never receive a request. If a policy withholds a field a tool requires, the call never leaves. |
| π§Ύ | Hash-chained ledger + receipts | Every decision is appended to a SHA-256 hash chain over canonical JSON, with masked values and a digest of the exact payload sent. Every agent run produces a privacy receipt. Edit one past entry and verification fails from that entry onward. |
| π | Encrypted vault | AES-256-GCM at rest via WebCrypto, with the same code in Node (key file, chmod 600) and the browser (non-extractable key in IndexedDB). |
| π£ | Your data footprint | A who-knows-what matrix (every recipient Γ every data type: knows exactly Β· approximately Β· protected) computed only from the ledger. |
| π§Ή | Make them forget you | One click drafts a CCPA/GDPR deletion request listing exactly what a partner received, citing ledger entries as evidence, and revokes the relay aliases and single-use cards you issued them. The agent can do it too: "Ask TableTap to delete my data". |
| π¬ | Guided demo tour | 12 chapters (6β9 minutes) with talking points, one-click actions and spotlighted UI, plus a compact mode for presenting. |
| π | Works with any agent | Ships as an MCP server and an HTTP gateway. It also runs fully local-first in the browser: the live demo has no backend at all. |
π¬ See it in action
π§ How it works
Every tool call, from Claude, the on-device Autopilot, or any MCP/HTTP client, goes through one choke point: ConsentryRuntime.callTool().
sequenceDiagram
autonumber
participant U as You
participant A as Agent (Claude / Autopilot / MCP client)
participant F as Consentry firewall
participant V as Vault (AES-256-GCM)
participant T as Tool / API / Partner
participant L as Ledger (SHA-256 chain)
U->>A: "Book a vegetarian dinner for 2 tonight"
Note over A: Sees only {{vault:phone}}, {{vault:card}}β¦
A->>F: book_table(name={{vault:full_name}}, phone={{vault:phone}}, card={{vault:card}}, notes={{vault:allergy_peanut}})
F->>V: resolve tokens
F->>F: detect β classify β evaluate policy per field
F-->>U: β TableTap wants "Food allergy" (exact vs. "Peanut-free meal required")
U->>F: Share minimized
F->>L: append egress entry (masked fields + payload digest)
F->>T: name β Β· phone β relay alias Β· card β single-use virtual card Β· notes β minimized
T-->>F: response (untrusted)
F->>F: ingress scan: injection? exfil URL? smuggled tokens?
F->>A: sanitized, tokenized result
A-->>U: answer + π§Ύ privacy receipt
Decision pipeline (per field)
detect ββΆ classify (16 data types) ββΆ evaluate rules (priority βΈ specificity βΈ restrictiveness)
β β
β allow ββββββββββββΌβββββββββββΆ deny (withhold; block call if field is required)
β minimize βββββββββββ΄βββββββββββΆ ask (pause agent β you decide β optional grant w/ expiry)
βΌ
rewrite payload ββΆ default-deny check ββΆ ledger.append() ββΆ send ββΆ ingress quarantine ββΆ agent
Read the full design in docs/ARCHITECTURE.md.
π Quickstart
Requirements: Node β₯ 22.5 and pnpm (Corepack works).
git clone https://github.com/vnmoorthy/consentry.git && cd consentry
pnpm install
pnpm start # builds the dashboard and starts the gateway on http://localhost:8787
Open http://localhost:8787 and click a scenario chip. No API key is needed: the Autopilot agent runs on-device and calls real public APIs through the firewall.
Use Claude as the agent brain (optional):
cp .env.example .env # set ANTHROPIC_API_KEY=β¦ (defaults to claude-opus-5-5)
pnpm start
Or paste a key in Settings; it is stored encrypted with the vault. Claude still only ever sees tokens. See docs/CLAUDE_MODE.md for the Claude demo segment and pnpm tsx scripts/claude-check.ts, which proves no raw vault value reaches the model. If Claude is unreachable, runs fall back to Autopilot automatically.
| Command | What it does |
|---|---|
pnpm start |
Build the web app and run the gateway + dashboard on :8787 |
pnpm dev |
Gateway on :8787 + Vite dev server on :5173 with hot reload |
pnpm test |
Unit tests for detection, policy, transforms, firewall, injection scanner and ledger |
pnpm tsx scripts/smoke.ts |
End-to-end run of every scenario + red-team attack against the live public APIs |
pnpm tsx scripts/claude-check.ts |
Claude mode end to end: intercepts every Anthropic request and fails if any raw vault value is sent |
sh scripts/set-key.sh |
Save your Anthropic key to .env with hidden input, and verify it |
pnpm mcp |
Start the MCP bridge (stdio) |
pnpm build:pages |
Static, backend-free build (the whole firewall runs in the browser) |
π Use it with any agent (MCP + HTTP)
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"consentry": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/consentry/apps/mcp/src/index.ts"],
"env": { "CONSENTRY_URL": "http://localhost:8787" }
}
}
}
Claude Code: claude mcp add consentry -- npx tsx ./apps/mcp/src/index.ts
Your MCP client now gets 19 tools (weather, air quality, NWS alerts, quakes, NHTSA, openFDA, FEMA, Wikipedia, bookings, rides, refillsβ¦). Every call is firewalled, consent prompts appear in the Consentry dashboard, and everything lands in your ledger.
Any agent framework, over plain HTTP:
curl -s http://localhost:8787/api/gateway/call \
-H 'content-type: application/json' \
-d '{"tool":"air_quality","agent":"my-bot","args":{"location":"{{vault:home_location}}"}}'
# β data + "Home GPS minimized β 37.8,-122.4 (β10 km)"
| Method | Route | Purpose |
|---|---|---|
GET |
/api/state |
Snapshot: masked vault, policies, recipients, tools, stats, pending consents |
GET |
/api/events |
Server-sent events: every step, decision, consent and ledger append |
POST |
/api/chat |
Start an agent run { message } β { runId } |
POST |
/api/consent/:id |
Answer a consent prompt { decision: allow_once | allow_always | minimize | deny } |
GET |
/api/gateway/tools |
Tool catalog with JSON schemas |
POST |
/api/gateway/call |
Firewalled tool call { tool, args, agent } |
POST |
/api/policies/compile |
Plain English β structured rule |
POST |
/api/policies/simulate |
Explain what would happen for item Γ recipient Γ purpose |
POST |
/api/ledger/verify |
Re-hash the chain and report the first broken entry |
GET |
/api/ledger/export |
Export the full ledger (JSON) |
POST |
/api/redteam/:id |
Run a red-team scenario |
π Policies in plain English
Type a sentence and Consentry compiles it into a structured, explainable rule:
| You write | Consentry compiles |
|---|---|
| Never share my location with commercial apps | location.precise β partner : deny |
| Let TableTap see my phone number for reservations for 24 hours | contact.phone β tabletap (reservation) : allow Β· expires in 24h |
| Only share my approximate location with ride services | location.precise β partner (transport) : minimize(coarse-location) |
| Never let the AI see my medications | health.medication β llm : deny |
Privacy-first defaults ship out of the box, including hard lines that no grant or click can override: government IDs, credentials, mental-health data, marketing use, and unverified destinations.
β οΈ Red team: attack your own agent
Every scenario runs through the real runtime, firewall, tools and ledger. Run them in the UI or with pnpm tsx scripts/smoke.ts.
| Attack | What happens | Result |
|---|---|---|
| Poisoned restaurant review | A hidden HTML comment tells the agent to send your SSN and card to telemetry-cdn.io. We also simulate an agent that obeys. |
β Ingress quarantine (score 1.0) β run taint β default-deny egress blocks the exfil call β SSN/card withheld from the booking |
| Zero-click image exfiltration | A partner response embeds  |
β Exfil URL stripped, smuggled token neutralized, renderer never loads remote images |
| Secrets pasted into the prompt | The user pastes a card number and SSN into chat | β
The model receives My card is {{vault:card}} and my SSN is [Government ID withheld] |
| Over-collecting partner | An insurance API asks for 8 fields for a quote | β 2 exact (with consent), 4 minimized, 2 withheld, and the quote still comes back |
| Rewrite the audit log | An insider edits a past entry to say nothing was shared | β Hash mismatch detected at that exact entry |
π Public data APIs (all live)
No keys and no accounts. Every call goes through the firewall, which is why account-less public APIs only ever get a coarsened location.
Public data is real but imperfect, so Consentry says what each source can't tell you: every answer that used public data ends with a Data limits note, Claude is handed the same caveats in its tool results, and the Connections page lists them per source.
| API | Used for | Recipient tier | Known limits |
|---|---|---|---|
| Open-Meteo Forecast | 7-day forecast, current conditions | Open data | Model forecast on a ~11 km grid; less reliable beyond 3 days |
| Open-Meteo Air Quality | US AQI, PM2.5, ozone, 3-day outlook | Open data | Modeled, not a nearby sensor reading; local smoke can differ |
| Open-Meteo Geocoding | Place β coordinates | Open data | Best-known match; ambiguous names can land in the wrong spot |
| National Weather Service | Active alerts | Public sector | US only; an alert exists only once a forecast office issues it |
| USGS Earthquakes | Quakes near you | Public sector | Magnitudes are preliminary and often revised |
| NHTSA vPIC | VIN decoding | Public sector | Built from manufacturer filings; trim details can be missing |
| NHTSA Recalls | Vehicle safety recalls | Public sector | By make/model/year: can't tell whether this car was already repaired |
| openFDA Drug Enforcement | Drug recalls | Public sector | Reports lag by weeks; matches drug name, not your lot |
| openFDA Drug Label | Warnings & interactions | Public sector | Manufacturer text, not medical advice |
| openFDA Food Enforcement | Allergen recalls | Public sector | Reports lag by weeks; check the lot on the package |
| OpenFEMA | Disaster declarations | Public sector | Federally declared disasters only, usually days after the event |
| Wikipedia REST | Encyclopedia lookups | Open data | Crowd-edited and can be out of date |
Commercial partners (BiteFinder, TableTap, RideNow, MediMart, QuickQuote) are simulated locally and labeled as such in the UI, so the demo can show hostile behavior safely and deterministically.
π‘οΈ Security model & honest limitations
What Consentry guarantees: if a value is in your vault, or matches a sensitive pattern, it cannot leave the runtime in a form your policy doesn't allow. That covers tokens, raw values, reformatted values, coordinates near your saved places, and values pasted into prompts.
What it doesn't (yet):
- Semantic paraphrase. An agent that describes your condition in new words ("the user has a lung thing") isn't caught by fingerprints. The health lexicon helps, and an LLM-based classifier is on the roadmap.
- Encoded exfiltration to allowed recipients. Default-deny stops unknown hosts, but a trusted recipient could receive data in a channel the detector doesn't parse.
- The re-seal is local. Re-sealing a tampered ledger changes the head hash, which is detectable by anyone holding the old head. Production would anchor the head externally (transparency log / notarization).
- The demo persona is fictional (555-01xx phone,
example.comemail, Stripe test card, the famously void SSN 078-05-1120).
See SECURITY.md to report issues.
ποΈ Project structure
consentry/
βββ packages/core/ # Isomorphic engine (Node + browser): zero runtime deps besides the Anthropic SDK
β βββ src/detect.ts # vault fingerprints, tokens, regex+checksums, lexicon, geo-proximity
β βββ src/policy.ts # rule evaluation + plain-English compiler + grants
β βββ src/transforms.ts # minimizers (coarse location, aliases, virtual cards, age rangesβ¦)
β βββ src/firewall.ts # egress inspection, consent, rewrite, ingress quarantine, LLM tokenization
β βββ src/injection.ts # prompt-injection / exfil scanner (noisy-OR over 12 signals)
β βββ src/ledger.ts # SHA-256 hash chain over canonical JSON
β βββ src/planner.ts # Autopilot: on-device agent, no LLM
β βββ src/llm.ts # Claude tool-use loop (only sees tokens)
β βββ src/runtime.ts # the single choke point + events, receipts, stats
β βββ src/redteam.ts # 5 attack scenarios
β βββ src/footprint.ts # who-knows-what matrix + CCPA/GDPR deletion letters
β βββ src/tools/ # 12 live public-data tools + 5 simulated partners + 1 on-device tool
βββ apps/server/ # Hono gateway: REST + SSE + SQLite ledger + AES-GCM vault
βββ apps/web/ # React 19 + Vite + Tailwind v4 + Framer Motion dashboard
βββ apps/mcp/ # MCP bridge (stdio) β gateway
βββ scripts/ # smoke test, screenshot capture, asset rendering
βββ deck/ # 10-slide animated pitch deck (.pptx)
βββ docs/ # architecture, demo script, storyboard, idea log
π§ Roadmap
- LLM-assisted semantic classifier for paraphrased sensitive data
- Signed policy bundles + external ledger anchoring (Sigstore / transparency log)
- Browser extension: the same firewall in front of ChatGPT, Claude.ai and other web agents
- Data-subject requests: one click to ask a partner to delete what it got, with ledger evidence
- Real delivery of deletion requests (email/API) and tracking of statutory deadlines
- Policy packs for GDPR, CCPA/CPRA and HIPAA "minimum necessary"
- Multi-agent: per-agent identities and budgets ("this agent may share 3 contact fields per day")
π€ Contributing
PRs are welcome. Run pnpm test && pnpm tsx scripts/smoke.ts before opening one. See CONTRIBUTING.md.
π License
MIT. Built for the National Renaissance Hackathon at super{set} (tracks: Hacking with Public Data APIs Β· Personal Agents & Data Privacy).
Consentry MCP questions
What does Consentry do for AI agents?
It sits between an AI agent and its tools or APIs to inspect outbound fields, minimize sensitive data, ask for user consent, and quarantine prompt injections.
How does it protect my data from the LLM itself?
The system tokenizes prompts and tool results so the model only sees vault tokens instead of raw sensitive information.
Can I use it with Claude Desktop or Cursor?
Yes, it is available as an MCP server that works with agents like Claude Desktop, Claude Code, and Cursor.
Does it require an API key to run?
No API key is required for the local Autopilot agent, though you can optionally provide an Anthropic API key to use Claude as the brain.