Agent use case pack · Vibe coding

Check the whole MCP session, not just each tool call, for the untrusted input plus private data plus outbound mix

by PaperChaseWebb

A post on r/mcp argues that per-call guardrails miss leaks made of two allowed calls, citing the case where a support ticket told an agent with a service role key to read a tokens table and post it back to the ticket. The fix is to break the combination of untrusted input, private data and an outbound channel per session.

Preview card for Check the whole MCP session, not just each tool call, for the untrusted input plus private data plus outbound mix
Works withPlain .md
Price
Free
Difficulty
Advanced
Setup
1 hr
Format
.md file
Free sample

check-the-whole-mcp-session-not-just-each-tool-call-for-the-untrusted-input-plus-private-data-plus-outbound-mix.md · 3 KB · direct download, no signup

Download free

What you end up with

A generic SQL tool cannot be policed per call, because one query looks like another to the rule.

What you get

  • A plain-language summary of the workflow
  • A fill-in prompt template
  • What to watch out for
  • A link to the original source

Who it is for

Builders who already use AI agents and want a proven workflow they can copy into their own project.

Works with

Plain .md

Dashed chip: Plain Markdown, so it also pastes into other agents such as Grok Bot, Hermes, OpenClaw or Muse. We list those as compatible by format only, not as tested.

Tools needed

MCP clients and gatewayswhere per-call and per-session checks live
Database MCP serverthe example's read and write path
You needAn AI coding agent or chat model
You needA small real task to try it on

Cost to run: Free with the agent plan you already use.
Time to result: One working session

How it works

  1. List for each agent session: does it see untrusted text, private data,

    List for each agent session: does it see untrusted text, private data, and can it send anything out?

    Expected: Done before you move to the next step.

  2. If all three are true, remove one: read-only, no outbound, or a fresh

    If all three are true, remove one: read-only, no outbound, or a fresh session after untrusted input.

    Expected: Done before you move to the next step.

  3. Never give the agent an admin or service role key; use scoped tokens

    Never give the agent an admin or service role key; use scoped tokens.

    Expected: Done before you move to the next step.

  4. Put a human approval in front of anything leaving the organisation

    Put a human approval in front of anything leaving the organisation.

    Expected: Done before you move to the next step.

  5. Test with an instruction hidden inside a ticket or document

    Test with an instruction hidden inside a ticket or document.

    Expected: Done before you move to the next step.

Sample prompt from the pack

Workflow template · MCP clients and gateways, Database MCP server
Apply this workflow to [your project]:
1. List for each agent session: does it see untrusted text, private data, and can it send anything out?
2. If all three are true, remove one: read-only, no outbound, or a fresh session after untrusted input.
3. Never give the agent an admin or service role key; use scoped tokens.
4. Put a human approval in front of anything leaving the organisation.
5. Test with an instruction hidden inside a ticket or document.
Stop and ask me before anything irreversible: deploys, payments, sends or deletes.

Adapted by PaperChaseWebb. Not the original author's prompt.

Free preview of the file

check-the-whole-mcp-session-not-just-each-tool-call-for-the-untrusted-input-plus-private-data-plus-outbound-mix.md (excerpt)3 KB total
# Check the whole MCP session, not just each tool call, for the untrusted input plus private data plus outbound mix

PaperChase agent use case (free feed entry), version 1.0. Source: [u/Former-Economy404](https://www.reddit.com/r/mcp/comments/1xikqwl/anyone_enforcing_policy_across_a_whole_session/), 2026-10-29.

## What they did

Reading a table was allowed and replying to a ticket was allowed, yet together they sent secrets to whoever could read the ticket. The author's list: a human before anything leaves the organisation, never run the agent with a key that skips row-level security, read-only mode where possible, a fresh session when the trust level changes, and narrow outbound access. A separate thread about agents in Cloudflare reaches the same conclusion: prompts ask an agent to behave, scoped tokens actually limit it.

## Worth knowing

A generic SQL tool cannot be policed per call, because one query looks like another to the rule. Decide per session which of the three ingredients the agent gets, and drop one.

Worth knowing

  • A generic SQL tool cannot be policed per call, because one query looks like another to the rule. Decide per session which of the three ingredients the agent gets, and drop one.
  • Figures are as reported by the original author and were not re-measured by us.

Questions

Where does this come from?

A public post credited to u/Former-Economy404. Source: https://www.reddit.com/r/mcp/comments/1xikqwl/anyone_enforcing_policy_across_a_whole_session/

Is it free?

Yes. Feed entries are free to read and download.

Details

Version 1.0 · Updated Oct 29, 2026 · Markdown version of this page
License: Personal and commercial use. Credit the original source when you share the workflow. Download terms

mcpsecurityprompt-injectionpolicysupabaseleast-privilege