Building Security into AI Agents for Collaborative Workspaces

notion · Tech · 2026 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Secure autonomous agents in collaborative workspaces

Notion needed Custom Agents to be useful in multi-user workspaces without letting agents over-read, over-write, bypass permissions, or take risky actions such as posting to company-wide Slack channels.

Constraints:

Architecture

Notion Custom Agents use a build-from-nothing security architecture. Agents start with no permission to read, write, or interact with most resources; users then grant page-level view/edit permissions, Slack modes, email confirmation settings, and MCP tool/action approvals. Safety is enforced outside the model in access-control and deterministic layers rather than relying on the LLM to obey safety text. At runtime, layered controls monitor external data and suspicious agent behavior, pause risky actions for owner confirmation, and provide remediation such as deleting bad Slack posts. Alpha testing at large scale informed new permissions such as Slack read-and-reply and motivated first-party integrations where MCP lacked resource-level controls.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  custom-agent[Custom Agent] --> deterministic-access-control-layer[Deterministic access control layer]
  deterministic-access-control-layer --> page-permission-grants[Page permission grants]
  deterministic-access-control-layer --> slack-first-party-integration[Slack first party integration]
  deterministic-access-control-layer --> mcp-tool-controls[MCP tool controls]
  custom-agent --> page-permission-grants
  custom-agent --> slack-first-party-integration
  custom-agent --> email-confirmation-control[Email confirmation control]
  custom-agent --> mcp-tool-controls
  custom-agent --> runtime-warning-system[Runtime warning system]
  prompt-injection-monitor[Prompt injection monitor] --> runtime-warning-system
  prompt-injection-monitor --> custom-agent
  email-confirmation-control --> runtime-warning-system
  slack-first-party-integration --> remediation-delete-action[Remediation delete action]
  alpha-testing-program[Alpha testing program] --> slack-first-party-integration
  alpha-testing-program --> deterministic-access-control-layer
  security-team-agents[Security team agents] --> custom-agent
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Custom Agent Autonomous workspace agent configured by a user for tasks across Notion and integrations. Deterministic access control layer, Page permission grants, Slack first party integration, Email confirmation control, MCP tool controls, Runtime warning system
Deterministic access control layer Non-LLM enforcement layer where safety and permissions are baked into resource access decisions. Custom Agent, Page permission grants, Slack first party integration, MCP tool controls
Page permission grants Specific view/edit permissions for selected Notion pages rather than blanket workspace access. Deterministic access control layer, Custom Agent
Slack first party integration Notion-built Slack integration with granular modes such as read-and-reply. Deterministic access control layer, Custom Agent, Remediation delete action
Email confirmation control User-configurable approval setting for whether emails require confirmation before sending. Custom Agent, Runtime warning system
MCP tool controls Configuration for which MCP tools are available and which action types ask or always allow. Deterministic access control layer, Custom Agent
Prompt injection monitor Runtime defense that tags and monitors external data and suspicious behavior for possible attacks. Runtime warning system, Custom Agent
Runtime warning system Pauses risky setup or execution actions for user, owner, or workspace-admin confirmation. Custom Agent, Prompt injection monitor, Email confirmation control
Remediation delete action Undo capability allowing an agent owner to delete an incorrect Slack message. Slack first party integration
Alpha testing program Internal and customer scale testbed that exposed permission failures and drove model evolution. Slack first party integration, Deterministic access control layer
Security team agents Internal adoption path where Notion security uses agents such as Scruff for alerts, AppSec, code fixes, and adversarial tests. Custom Agent

Data flow

A Custom Agent starts with no access. During configuration, a user grants explicit page-level access, selects integration permissions, configures email confirmation, and chooses MCP tools/action approvals. If a configuration is risky, Notion shows confirmations or requires workspace-admin approval. At runtime, the agent executes only through the deterministic access-control layer. External data is tagged and monitored for prompt-injection risk; suspicious behavior or risky actions pause execution for the agent owner. For Slack, the first-party read-and-reply permission lets an agent respond only in threads where it was explicitly triggered. If the agent posts something wrong, the owner can delete the message.

5 supporting quotes
“Custom Agents use a build-from-nothing security model where agents start without access to most resources, meaning no permissions to read, write, or interact with anything. This approach is a deliberate contrast to many personal AI assistants, which often”article, stated
“ones: * Page-level granularity for permissions: Users can grant view or edit access to specific pages, not just broad workspace access * First party Slack Integration: Offering a first party integration for Slack allows us to bring easy-to-configure granular permissions in a way MCP doesn’t”article, stated
“When using an MCP integration, it’s not resource-based, but you can specify the tools you want to be made available”article, stated
“Warning system: When the agent is about to do something potentially risky, it pauses and asks the user first.”article, stated
“read and reply” permission for Slack that allows agents to reply on to threads they were triggered in explicitly.”article, stated

Why this architecture

Notion intentionally keeps security out of the model's discretion. A zero-permission default and deterministic access controls create a hard boundary before the LLM reasons about tasks. Resource-level grants keep agents useful without broad workspace power. Runtime warnings and prompt-injection monitoring recognize that static permissions alone do not handle all execution-time risks. First-party integrations are used where standardized protocols such as MCP do not yet provide the collaborative, resource-based controls Notion needs.

5 supporting quotes
“broad access and require users to ensure that safety instructions don’t get compressed out. We don’t want to leave safety to the model’s decision-making. Instead, we wanted safety baked into the access control and deterministic layer. In this way, we’ve been able to give users”article, stated
“Instead, we wanted safety baked into the access control and deterministic layer. In this way, we’ve been able to give users granular controls to make the right security decisions for their use cases while enabling advanced users to build incredibly capable”article, stated
“Giving them permission to do everything is dangerous, and having permission to do nothing is rarely useful. With our Custom Agents, we’ve been meticulous in trying to balance both: Have enough access in collaborative environments to be just the right amount”article, stated
“While it remains an unsolved problem, we don’t design our system assuming that all prompt injections will get caught”article, stated
“because most MCPs today are designed more for single-player use cases, they generally don’t natively handle resource-based permissions or triggers.”article, stated

Models used: Notion Custom Agents · Scruff security agent

Scale

Alternatives considered (roads not taken)

Start agents with broad access and rely on safety instructions

Rejected because: Prompt safety text can be compressed out and leaves security to model reasoning.

“many personal AI assistants, which often start with broad access and require users to ensure that safety instructions don’t get compressed out.”article, stated
“broad access and require users to ensure that safety instructions don’t get compressed out. We don’t want to leave safety to the model’s decision-making. Instead, we wanted safety baked into the access control and deterministic layer. In this way, we’ve been able to give users”article, stated

Grant broad workspace access

Rejected because: Collaborative agents should receive specific resource permissions, not broad workspace access.

“ones: * Page-level granularity for permissions: Users can grant view or edit access to specific pages, not just broad workspace access * First party Slack Integration: Offering a first party integration for Slack allows us to bring easy-to-configure granular permissions in a way MCP doesn’t”article, stated
“introduce permissions like this that allow users to safely get their work done, instead of forcing users to “allow everything.” This also led us to the deliberate decision to build some first-party integrations rather than relying solely on MCPs. As”article, stated

Use MCP alone for Slack-style integrations

Rejected because: MCP did not natively handle the resource-based permissions and triggers needed for multi-user collaborative workspaces.

“Offering a first party integration for Slack allows us to bring easy-to-configure granular permissions in a way MCP doesn’t”article, stated
“already discussed, because most MCPs today are designed more for single-player use cases, they generally don’t natively handle resource-based permissions or triggers. Building first-party integrations gave us the control to enforce our permission model without extra work for our customers.”article, stated

Assume prompt injection can be fully caught

Rejected because: Notion treats prompt injection as unsolved and designs to block impact rather than claim perfect detection.

“Prompt injection is one of the biggest and most well-known challenges for AI agents.”article, stated
“for AI agents. While it remains an unsolved problem, we don’t design our system assuming that all prompt injections will get caught (though we catch many of them). Instead, we designed it such that we have layered controls to block the impact of prompt injection while paying special attention”article, stated

Only prevent mistakes up front

Rejected because: Agents will still sometimes do the wrong thing, so users need remediation paths.

“If an agent does mess up, like if it posts something incorrect to Slack, the agent owner can delete that message.”article, stated
“it’s important to give users a way to undo damage if it happens, not just prevent it. ### How we evolved our permission model To get to this model, we ran an extensive alpha-testing program, both internally across Notion and externally with customers. We”article, stated

Patterns

safety-policy-enforcement (security)

Notion enforces agent safety through deterministic access controls and resource-level permissions rather than relying on model reasoning.

“Instead, we wanted safety baked into the access control and deterministic layer. In this way, we’ve been able to give users granular controls to make the right security decisions for their use cases while enabling advanced users to build incredibly capable autonomous agents.”article, stated
“* Page-level granularity for permissions: Users can grant view or edit access to specific pages, not just broad workspace access * **First party Slack Integration:”article, stated

human-in-the-loop-gate (control)

Risky configurations and runtime actions pause for user, owner, or workspace-admin approval.

“When the agent is about to do something potentially risky, it pauses and asks the user first. How this happens depends on whether the user is configuring or running the agent.”article, stated
“can range from a simple confirmation to needing to get workspace-admin approvals.”article, stated

tool-use-orchestration (integration)

Notion controls which Slack, email, and MCP tools agents can use and which action types require approval.

“you can specify the tools you want to be made available, and if you want to ask or always allow certain types of actions”article, stated
“Email: You can choose if you want to confirm before sending emails”article, stated

guardrails-io-filtering (security)

Runtime layers tag and monitor external data, detect suspicious behavior, stop execution, and ask for confirmation.

“paying special attention to tagging and monitoring external data to identify potential attacks.”article, stated
“In the event that something looks suspicious or the agent performs actions that indicate a potential attack, we can stop the agent and ask a user for confirmation. Warning system: When the agent is about to do something potentially risky, it pauses and asks the user first.”article, stated

privacy-preserving-processing (security)

Build-from-nothing permissions and page-level grants limit which workspace resources an agent can read or modify.

“agents start without access to most resources, meaning no permissions to read, write, or interact with anything.”article, stated
“fine-grain controls of their agents so that they can be as secure as possible in their workspaces.”article, stated

eval-driven-development (quality)

Notion used a large alpha-testing program to stress-test security in practice and convert observed failures into new permission modes.

“we ran an extensive alpha-testing program, both internally across Notion and externally with customers.”article, stated
“We learned some lessons very quickly. For example, early internal versions of Custom Agents encouraged users to be too permissive without understanding the potential consequences.”article, stated

Tradeoffs

Start agents with zero permissions

Chose Build-from-nothing security model over Broad default access with prompt-level safety instructions.

Rationale: Deterministic access control makes safety enforceable even when prompts are compressed or bypassed.

“Custom Agents use a build-from-nothing security model where agents start without access to most resources”article, stated
“This approach is a deliberate contrast to many personal AI assistants, which often start with broad access”article, stated

Build first-party Slack integration

Chose Custom resource-level Slack permissions over Relying solely on MCP.

Rationale: First-party integration let Notion enforce read-and-reply and other collaborative permissions without extra customer work.

“Offering a first party integration for Slack allows us to bring easy-to-configure granular permissions in a way MCP doesn’t”article, stated
“Building first-party integrations gave us the control to enforce our permission model without extra work for our customers.”article, stated

Use confirmations for riskier actions

Chose Config-time and runtime approval prompts over Fully autonomous execution of every granted action.

Rationale: Confirmation keeps low-risk autonomy possible while adding a human gate for sensitive setups or actions.

“When configuring an agent that might do something risky, we give users a set of pop-ups”article, stated
“When the agent does something risky during runtime, we force it to confirm that action with an owner of the custom agent.”article, stated

Permit extensibility through MCP with controls

Chose Specify tools and action approval modes over Reject MCP integrations entirely.

Rationale: MCP gives extensibility, but Notion wraps it in explicit tool availability and action-approval settings.

“MCP integrations: When using an MCP integration, it’s not resource-based, but you can specify the tools you want to be made available”article, stated
“an MCP integration, it’s not resource-based, but you can specify the tools you want to be made available, and if you want to ask or always allow certain types of actions ### Security safeguards and warnings We also had to think about unexpected behaviors during runtime when the agent is actually”article, stated

Conservative permissions first, broader scopes later

Chose Phased rollout with future admin-approved broader scopes over Launching with broad advanced permissions immediately.

Rationale: Notion preferred to establish guardrails before reintroducing broader permissions for advanced use cases.

“Reintroducing broader permission scopes which require workspace admin approval for advanced use cases”article, stated
“Consider additional permission modes for different use cases once more guardrails are in place”article, stated

Gotchas (what bit them)

Single-user agent permission models fail in collaborative workspaces.

Root cause: Agents operating around multiple users and shared resources need resource-level controls, not permissions mapped to one user.

Resolution: Use build-from-nothing permissions and granular resource grants.

“Most AI agents today are built for a single user with a relatively simple set of permissions that map to that user.”article, stated
“However, agents in a collaborative environment have different needs. Giving them permission to do everything is dangerous, and having permission to do nothing is rarely useful.”article, stated

Broad Slack write access let agents post to company-wide channels.

Root cause: Early agents encouraged overly permissive Slack access without users understanding consequences.

Resolution: Introduce a custom read-and-reply Slack permission limited to explicitly triggered threads.

“early internal versions of Custom Agents encouraged users to be too permissive without understanding the potential consequences.”article, stated
“This is what led us to introduce a new custom “read and reply” permission for Slack”article, stated

MCP did not satisfy collaborative resource-permission needs by itself.

Root cause: Most MCPs were designed for single-player use cases and lacked native resource-based permissions or triggers.

Resolution: Build first-party integrations for core services while still supporting MCP with explicit tool/action controls.

“This also led us to the deliberate decision to build some first-party integrations rather than relying solely on MCPs.”article, stated
“Building first-party integrations gave us the control to enforce our permission model without extra work for our customers.”article, stated

Prompt injection cannot be treated as solved.

Root cause: Even with detection, some attacks may pass, so the architecture must reduce blast radius.

Resolution: Layer permission controls, external-data tagging, runtime monitoring, and confirmation pauses.

“While it remains an unsolved problem, we don’t design our system assuming that all prompt injections will get caught”article, stated
“we designed it such that we have layered controls to block the impact of prompt injection”article, stated

Prevention alone is incomplete for autonomous agents.

Root cause: Agents can still post incorrect messages or take actions that need reversal.

Resolution: Provide owner-level remediation such as deleting the incorrect Slack message.

“If an agent does mess up, like if it posts something incorrect to Slack, the agent owner can delete that message.”article, stated
“give users a way to undo damage if it happens, not just prevent it.”article, stated

Evaluation

Notion evaluated Custom Agents through a large internal and external alpha-testing program, stress-testing security at increasing scale and converting observed failures into permission-model changes. The source also reports internal security-team adoption for alert triage, AppSec automation, code fixes, and adversarial tests.

Metrics: More than 3,000 internal Custom Agents · More than 25,000 alpha customer-created agents · Observed over-permissive Slack write failures · Security-team internal adoption · Beta-period customer feedback

4 supporting quotes
“we ran an extensive alpha-testing program, both internally across Notion and externally with customers.”article, stated
“By the end of our alpha testing period, Notion had more than 3,000 internal Custom Agents and our alpha customers had created more than 25,000.”article, stated
“early internal versions of Custom Agents encouraged users to be too permissive without understanding the potential consequences.”article, stated
“our own security team has become one of the most active internal users of Custom Agents.”article, stated

Outcomes

The security model was tested across more than 3,000 internal agents and more than 25,000 alpha customer-created agents before the beta period.

5 supporting quotes
“enabling advanced users to build incredibly capable autonomous agents.”article, stated
“This is what led us to introduce a new custom “read and reply” permission for Slack”article, stated
“they built an agent called Scruff to triage and enrich security alerts”article, stated
“they’re using agents for AppSec automation, generating code fixes, and running adversarial tests.”article, stated
“Our Custom Agents beta period over the next couple of months will also help us to continue to improve alongside our customers.”article, stated