Skip to main content
A brass service bell beside a rubber stamp and ink pad on a counter, drawn in dots

Running an AI SOC from Slack and Teams

How to run AI security agents from Slack or Microsoft Teams: log access, scoped tools, channel design, approval patterns, app permission scopes, and audit trails.

Guide
Updated 12 min read

Summary

An AI SOC run from Slack or Microsoft Teams puts agent investigations, questions, and approval requests in the threads where analysts already work, while logs, tool credentials, and detection code stay in systems built for them. It needs four pieces: logs the agent can query, tool access scoped per agent, approval gates on any action that changes state, and a reviewed path for shipping detection and response changes.

Time a Slack app has to acknowledge a button click
3 seconds
Maximum age of a Slack request before apps should reject it
5 minutes
Allowed IP ranges per Slack app token restriction
20
Window to use a Slack response_url, up to 5 times
30 minutes

Key takeaways

  1. Split channels by purpose: one for agent escalations, one for approvals, and a private one for sensitive cases, and restrict each agent's trigger to its channel.
  2. Put every state-changing tool behind an approval that names the target, and decide what happens on timeout before the first incident, not during it.
  3. Request the fewest Slack scopes or Teams resource-specific consent permissions the workflow needs, and turn on Slack's Require App Approval or a Teams app permission policy before anyone installs a security bot.
  4. Keep the agent's tool calls, approvals, and chat replies in one audit trail you can export to your SIEM; Slack's own Audit Logs API doesn't cover message content.
  5. Ship detection and agent changes as pull requests that a person merges, even when the review happens from a phone.

The short version

Chat is where a security team already argues about alerts, so it's the natural place for an agent to report what it found, ask what it doesn't know, and wait for permission before it acts. The chat app is only the front end, though. The agent still needs logs to query, credentials for the tools it calls, and a reviewed way to change detections. Get those wrong and a Slack bot becomes either a toy that can't answer anything or an over-privileged account anyone in a channel can steer.

The setup that works has four parts, covered in order below:

  1. Logs the agent can query without an analyst exporting them first.
  2. Scoped tool access, granted per agent, with read and write separated.
  3. Collaboration in the thread: escalations, questions, handoffs, and approvals.
  4. A fast, reviewed path for detection and response code.

After those, the chat app itself needs hardening: permission scopes, request verification, install approval, and an audit trail. If you're still deciding what kind of platform should run the agents, start with what an AI SOC is.

Step by step

1. Get the logs where an agent can query them

An agent that can only see the alert text will guess. It needs the surrounding identity, endpoint, cloud, and network events, queried on demand. Two patterns work: ingest the logs into one store, or let the agent query each source where the logs already live. Most teams end up with both, because some sources are too expensive to copy and others are too slow to query remotely. What security logs to store covers which sources are worth paying to keep.

Cotool supports both patterns. Its log storage can hold logs or query them in place in Splunk, Snowflake, or the CrowdStrike EDR API, with no per-seat or per-query fees. Connecting an integration and turning on log ingestion are separate steps, so a connected tool can be available to agents without its logs being collected, and ingested logs can be mirrored to storage you own. Cotool also sends a notification when a log source's ingest health changes, with states such as Degraded, Stalled, and Failing, which matters because an agent querying a stalled source will report "no evidence" with confidence.

2. Wire up context with scoped tool access

Every tool you hand an agent is a permission it can be tricked into using. OWASP's LLM06:2025 entry calls this excessive agency and names three root causes: excessive functionality, excessive permissions, and excessive autonomy. Its fixes are to limit the extensions an agent may call to the minimum necessary, give each extension only the downstream permissions it needs, require human approval for high-impact actions, and enforce authorization in the downstream system rather than trusting the model to decide.

The Model Context Protocol (MCP) security guidance says the same for MCP servers: start with a minimal scope set of low-risk read operations and request more only when a task needs it. It also forbids token passthrough, where a server forwards a client's token to a downstream API without checking it was issued to that server. Security MCP servers lists the vendor servers worth connecting.

In Cotool, agents "only have access to tools you explicitly grant" and can't discover tools they haven't been granted. A Read-only + Custom tool mode keeps every read action and adds only selected write actions, and role-based permissions such as tool.use and agent.execute can be scoped to all, specific, or all-except resources. Going the other direction, Cotool's MCP server lets a coding agent such as Claude Code or Cursor work in Cotool with the signed-in user's role over OAuth, without API keys; admins can turn it off, and apps connected through it can't approve tuning proposals or delete anything.

3. Design the channels

Channel design decides who can steer an agent and who sees what it finds. A layout that works for most teams:

  • #sec-alerts: agent escalations only. Each alert gets one parent message and a thread; status changes edit the parent instead of posting again.
  • #sec-approvals: requests for state-changing actions. Keep membership to people who are allowed to approve.
  • #sec-ir-<case> (private): one per declared incident, so evidence about a named employee or an active intrusion doesn't sit in a channel the whole company can join.
  • #sec-agent-requests: where anyone can @mention the agent with a question ("is this email phishing?") without seeing other cases.

Then restrict each agent's trigger to the channels it serves. Cotool's Slack trigger can be limited by user, user group, and channel, and its docs recommend restricting channel access so sensitive agents can't be triggered from public channels. By default anyone in the workspace can @mention the bot, but only Slack users linked to a Cotool account can continue the thread, and a reply scope setting decides whether a trigger responds to anyone or only Cotool users. Slack tool actions can also be limited to approved channels, so an agent can't post case details somewhere else. Alert routing is ordered and first-match-wins, which makes it easy to send identity alerts to one agent and channel and endpoint alerts to another.

4. Approvals, handoffs, and questions in the thread

Three interactions do most of the work.

Approvals for destructive actions. The agent posts what it wants to do, the exact target, and the evidence, with Approve and Decline buttons. The pattern needs four decisions made in advance: who may approve (a role or channel, not "anyone who sees it"), whether the requester can approve their own request, what happens on timeout, and whether an approval covers one target or a batch. On Slack, the app must acknowledge the button click within 3 seconds and can use the response_url up to 5 times within 30 minutes to update the message. In Cotool, approval controls are set per action on each agent tool, with review in Cotool and optional requests through Slack or Microsoft Teams, and the agent waits for an answer. Unanswered prompts time out by alert severity, from 15 minutes for critical to 24 hours for low, unless you set a fixed timeout.

Questions. Agents often lack one fact only a person knows: was this login you, is this service account supposed to run on weekends. Cotool agents ask these in the originating Slack thread, and a suggested disposition lets someone confirm a statement about the environment from Slack to close the alert; later triage runs reuse it as context.

Handoffs. When the agent escalates, the thread should carry the verdict, the evidence, and what's still unknown. Cotool's agents end with a summary of evidence, conclusion, and gaps, and escalate confirmed malicious alerts for human review. When someone changes the alert's status, the Slack notification is edited and the thread gets a reply saying who changed it and why. Thread replies are mirrored into the alert's activity log, so a decision made in chat is recorded on the case.

5. Ship detection and response code from the thread

The fastest feedback loop in an AI SOC runs from a false positive straight to a detection fix. Treat detections and agent definitions as code, with detection as code practices: version control, tests, review, and a backtest before merge.

Ramp's detection and response team runs this loop from Slack. Its agent writes a disposition into the ticket and Slack and escalates true positives to a person; for false positives, it opens a pull request against the detection repository, and an engineer reviews and merges it, often from Slack on a phone. "Humans merge," as the case study puts it. On the Cotool side, Python detections are tuned against a 30-day backtest that checks the true positives still fire, and new detections pushed by a coding agent over MCP are published turned off. Response agents can live as YAML in your own GitHub repository; Cotool syncs it roughly every 5 minutes and records each change against the source commit, and secrets never live in the YAML.

Securing the Slack app

A Slack app has no access until you grant scopes, and bot scopes are separate from user scopes. Request only what the workflow uses:

ScopeWhat it allowsNeeded for
app_mentions:readSee messages that @mention the botMention triggers
chat:writePost, update, and delete the bot's messagesReplies, approvals
channels:historyRead public channels the bot was added toReading threads
groups:historyRead private channels the bot was added toPrivate case channels
users:read.emailRead user email addressesMatching users to accounts
files:readRead files shared where the bot isAttachment analysis
search:readSearch the workspace (user token only)Rarely; avoid

Then apply Slack's own security guidance:

  • Require app approval. By default any member can install an app. Turn on Require App Approval so security bots go through review, and classify scopes into always allowed, requires approval, and restricted.
  • Verify every request. Check the X-Slack-Signature header, an HMAC-SHA256 of the request with your signing secret, and reject requests whose timestamp is more than five minutes old.
  • Restrict token IPs. Slack can reject Web API calls from addresses outside an allowlist of up to 20 entries; IPv6 isn't supported.
  • Rotate tokens. Use token rotation and revoke tokens with auth.revoke when a workflow is retired.
  • Block exfiltration through links. Slack warns that a prompt-injected message can make an LLM-backed app post a URL containing sensitive data, which link unfurling then fetches from the attacker's server. Disable unfurling on agent messages and don't process messages from other bots.

Securing the Teams app

Teams uses a different model. Resource-specific consent (RSC) scopes an app's permissions to the teams, chats, and meetings where it's installed. Users consent to all of an app's RSC permissions at once and can't grant them individually. Any member can grant delegated RSC permissions, but only owners or admins can grant app-only ones. Channel permissions such as ChannelMessage.Read.Group, which reads all of a team's channel messages, extend to every channel except private and shared channels unless the app is added there.

Admins control which users can install which apps with app permission policies: a Global org-wide default plus custom policies for specific users, or app centric management, which replaces permission policies in organizations that have moved to it. For approval buttons, Adaptive Cards with Universal Actions send an Action.Execute click to the bot backend and work across Teams and Outlook.

A Workflows incoming webhook is the simpler option and needs no premium license, but it only posts into a channel or chat. Cotool's public docs describe Teams as an output destination for agents and detections, a notification destination, and a channel for approval requests; its Teams destinations use a workflow webhook URL rather than a browser channel link.

Keep one audit trail

Slack's Audit Logs API is available only on Enterprise plans, is read-only, and doesn't monitor message content. It tells you who installed an app, not what the app did. So the agent platform has to record the actions itself: each agent run, each tool call with its parameters, who approved it, and the chat replies that informed the verdict.

Cotool's audit log records agent executions, tool calls and their parameters, user actions, integration authentication, API calls, and configuration changes, and exports through an API to your SIEM. Tool calls made through its MCP server are audited too. Whatever platform you use, send that log to the same SIEM as everything else, and alert on approvals granted outside working hours or by unexpected people.

Common mistakes

One channel for everything. Escalations, approvals, and open questions in one busy channel means approvals get missed and anyone in the channel can steer the agent.

Approval by anyone who sees the button. Tie approval to a role. An attacker with a compromised Slack account in #sec-alerts shouldn't be able to approve their own containment bypass.

No timeout rule. Decide in advance whether an unanswered request for host isolation expires, escalates to on-call, or proceeds. Expiry is the safe default for destructive actions.

Granting scopes "for later." Every unused scope and tool is OWASP's excessive functionality. Add search:read or write tools when a workflow needs them, not at install.

Trusting chat as the record. Threads get edited, deleted, and lost to retention settings. The case record belongs in the platform, with chat replies mirrored into it.

Letting the agent merge its own fixes. Automated tuning is fine; automated merging of detection changes without review isn't. The AI SOC vendor evaluation guide covers what to test before trusting any platform's autotuning.

Checklist

  • Agents can query identity, endpoint, cloud, and network logs without a human export.
  • Log ingest health alerts go to a channel someone watches.
  • Each agent has an explicit tool list, with write tools separated from read tools.
  • MCP servers use OAuth with the user's role, not shared API keys.
  • Channels are split by purpose, and each trigger is restricted to its channel.
  • Every state-changing tool requires approval from a named role, with a timeout rule.
  • Slack: Require App Approval is on, scopes are minimal, requests are signature-checked, and token IPs are restricted.
  • Teams: an app permission policy or app centric management controls installs, and RSC permissions are reviewed.
  • Link unfurling is off for agent messages, and the agent ignores other bots.
  • Agent tool calls and approvals are exported to the SIEM.
  • Detection and agent changes ship as reviewed pull requests.

FAQ

Can an AI security agent take actions from Slack?
An AI security agent can take actions from Slack if its app has the right tool access, but destructive actions should go through an approval button first. A common pattern is that the agent posts what it wants to do and the target, a person approves or declines in the thread, and only then does the tool call run. OWASP lists missing human approval for high-impact actions as a cause of excessive agency in LLM systems.
What Slack scopes does a security agent need?
A security agent in Slack usually needs app_mentions:read to see @mentions, chat:write to post and update messages, and channels:history or groups:history to read threads in channels it has been added to. Reading user emails to match Slack users to accounts needs users:read.email, and file analysis needs files:read. Search across the workspace needs search:read, which is a user-token scope, so most bots shouldn't request it.
Does Microsoft Teams work for AI SOC approvals?
Microsoft Teams works for AI SOC approvals through Adaptive Cards with Universal Actions, where an Action.Execute button sends the click to the bot backend. Teams also supports resource-specific consent, which scopes an app's permissions to the teams and chats where it's installed. Some tools only post to Teams through a Workflows incoming webhook, which can notify but can't collect an approval by itself.
Is it safe to give an AI agent access to Slack channels?
Giving an AI agent access to Slack channels is safe enough when the agent is limited to the channels it needs and can't send data out through links. Slack's security guidance warns that prompt injection can trick an LLM-backed app into posting a URL containing sensitive data, which link unfurling then sends to the attacker. Disable unfurling on agent messages and don't let the agent respond to other bots.

Sources

  1. Slack Integration - Cotool Documentation · accessed November 16, 2026
  2. Triggering Agents - Cotool Documentation · accessed November 16, 2026
  3. Notifications - Cotool Documentation · accessed November 16, 2026
  4. Cotool Release Notes - Cotool Documentation · accessed November 16, 2026
  5. Alert Routing - Cotool Documentation · accessed November 16, 2026
  6. Working Alerts - Cotool Documentation · accessed November 16, 2026
  7. Tools and Integrations - Cotool Documentation · accessed November 16, 2026
  8. Roles & Permissions Overview - Cotool Documentation · accessed November 16, 2026
  9. Audit Logs - Cotool Documentation · accessed November 16, 2026
  10. MCP Server - Cotool Documentation · accessed November 16, 2026
  11. Response Agents as Code - Cotool Documentation · accessed November 16, 2026
  12. Cotool Log Ingest - Cotool Documentation · accessed November 16, 2026
  13. Security Log Storage and Federated Search for Agents · accessed November 16, 2026
  14. AI Detection Engineering with Python Detections · accessed November 16, 2026
  15. AI SOC Without the Black Box · accessed November 16, 2026
  16. How Ramp Scaled Detection & Response With Cotool · accessed November 16, 2026
  17. Scopes | Slack Developer Docs · accessed November 16, 2026
  18. chat:write scope | Slack Developer Docs · accessed November 16, 2026
  19. channels:history scope | Slack Developer Docs · accessed November 16, 2026
  20. search:read scope | Slack Developer Docs · accessed November 16, 2026
  21. Security best practices | Slack Developer Docs · accessed November 16, 2026
  22. Verifying requests from Slack | Slack Developer Docs · accessed November 16, 2026
  23. Handling user interaction in your Slack apps | Slack Developer Docs · accessed November 16, 2026
  24. Using the Audit Logs API | Slack Developer Docs · accessed November 16, 2026
  25. Resource-Specific Consent for Teams Agents and Apps - Teams · accessed November 16, 2026
  26. Manage app permission policies in Microsoft Teams - Microsoft Teams · accessed November 16, 2026
  27. Universal Actions for Cards - Overview - Teams · accessed November 16, 2026
  28. Send messages in Teams using incoming webhooks | Microsoft Support · accessed November 16, 2026
  29. Security Best Practices - Model Context Protocol · accessed November 16, 2026
  30. LLM06:2025 Excessive Agency · accessed November 16, 2026

Keep reading

Attackers are scaling with tokens

Cotool helps defenders operate at machine speed. See how security teams are scaling Detection & Response.

Book a demo