Preventing an AI agent from posting client NPI to Slack through an MCP server
Treat the Slack MCP server's message-posting tools as a data egress path. Apply least-privilege Slack permissions and a channel allowlist as baseline, then enforce policy on each tool call in the execution path. Inspect the outbound arguments for NPI, check the target channel, and apply allow, redact, block or escalate-for-approval before the message is delivered. Record every decision as evidence.
Four control points and what each one can stop
- 1
Agent configuration
Expose only the tools the task needs. NIST recommends strict tool scopes and avoiding open-ended tools. A prompt instruction not to post NPI is guidance, not enforcement.
- 2
MCP server scoping
Run the Slack MCP server with only the posting tools the use case requires. Leave out tools that edit messages, upload files or read broadly unless they are needed.
- 3
Slack app permissions
Grant the app the narrowest permissions it needs and add it only to approved channels. This limits reach but cannot judge message content.
- 4
Runtime policy enforcement
Inspect each tool call in the execution path, evaluate content and destination together, and enforce a decision before delivery.
Capture evidence and test the policy
- Seed synthetic client records and check that direct inclusion, summarization and forwarded tool output are each detected.
- Place injected instructions in a retrieved document and confirm the resulting post is blocked or held.
- Send identical content to each channel class and confirm decisions differ as the policy specifies.
- Use near-miss values to measure false positives and tune thresholds.
- Try edits, replies and file uploads to confirm no write path bypasses inspection.
- Verify every test call produced a complete evidence record, including approver details for escalations.
How NPI reaches Slack through a tool call
An MCP server lets an agent discover and call external capabilities. For Slack, the relevant capability is any tool that writes content into a workspace, usually by taking a target channel and a message body. The agent decides both values at call time, from whatever is in its context.
Three paths put NPI into those arguments. The first is direct inclusion: the agent copies a name, account number or other client identifier from a record into a status update. The second is summarization: the agent condenses a retrieved document or case file, and the summary carries identifying details even though no field was copied verbatim. The third is forwarded tool output: a result from a database, CRM or document tool is passed into the message with little transformation. These categories are a practical working taxonomy, not a formal standard.
Prompt injection adds a fourth route. NIST identifies manipulation of generative AI systems as one of the most concerning vulnerabilities, and a retrieved document can carry instructions to post its contents somewhere. NIST also advises against trusting prompt instructions or artefacts from users or other agents. For this problem, that means the arguments of every outbound call should be treated as untrusted input, regardless of what the system prompt says.
Why the posting step needs enforcement in the path
Prompt instructions can be overridden by injected content or simply misapplied by the model. Workspace permissions answer who may post and where, not whether this particular message contains a client's nonpublic information. Review by DLP tooling or people after the post means the message has already been delivered, possibly to guests or external participants, and cleanup becomes incident response.
Enforcement at the tool call closes that gap because the content and the destination are both known at the moment of decision, and the call has not yet happened. This is the same idea as reviewing content before posting to a public system, a control NIST describes in a different context. Applying it to agent-initiated Slack messages is a design choice, and it fits because the agent is acting without a person reading the message first.
Trussed enforces policy in the execution path across agents, tools and MCP servers, on individual tool calls. Decisions are enforced at runtime, not reviewed after the fact.
Define the policy
Write the policy so that destination and content are evaluated together. A default-deny posture on channels keeps the content rules from carrying the whole burden.
- 1. Classify destinations: Resolve each target channel to a class such as private internal, broad internal, contains guests, or shared externally. Unlisted channels are denied by default.
- 2. Detect NPI in arguments: Scan the message body and any other free-text parameters. Combine pattern matching with checksum validation, client identifier lookups, and entity or classifier detection, and attach a confidence level to each finding.
- 3. Map findings to decisions: No NPI in an allowlisted channel is allowed. Confirmed NPI in a guest or externally shared channel is blocked. High-confidence NPI in an approved internal channel is redacted or blocked.
- 4. Route ambiguity to approval: Low-confidence findings or unusual targets go to a human approver, with the call held until a decision is made.
- 5. Cover every write path: Apply the same rules to replies, edits, file uploads and any other tool that places content in Slack.
- 6. Version the policy: Give each policy a version so every decision can be tied to the rules in force.
Handling ambiguity, false positives and redaction
Detection is probabilistic. A nine-digit number may be an identifier or an order code, and a name in a summary may be a client or a public figure. Strict patterns miss paraphrased details, while broad detection blocks legitimate work. Set thresholds per destination class: tighter for channels with guests or external members, looser for small private channels approved for client work.
Redaction suits messages where the sensitive element is incidental, such as an account number in an otherwise useful status line. Replace values with typed placeholders so the message stays readable, and return a clear result to the agent so it does not retry with a reworded version of the same content. Blocking suits cases where the destination is wrong regardless of content.
Escalation is for the middle ground. Keep the approval request short: the proposed message, the findings, the target channel and the reason the call was held. Track approval rates and overturned blocks, and use them to adjust thresholds. A high override rate signals noisy detection, not a reason to remove the control.
Guidance from NIST points to approval or confirmation flows for state-changing actions such as POST requests, which describes posting to Slack well.
Slack tool call, inspected before delivery
Agent proposes a call
The agent builds a post-message call with a channel and message body.
Policy inspects arguments
NPI detection and channel classification run on the outbound call.
Decision is enforced
Allow, redact, block or escalate for human approval.
Evidence is retained
Arguments, decision, policy version and approver are recorded.
Enforce policy on Slack tool calls before delivery
See how enforcement in the execution path applies allow, redact, block or escalate-for-approval to agent tool calls and produces audit-ready evidence for a regulated enterprise.
Explore Agent and Tool-Call EnforcementHow does your AI governance program compare?
See where your program has gaps in less than 2 minutes.