> ## Documentation Index
> Fetch the complete documentation index at: https://help.wonka.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Access Control

> Manage user roles, user access, agent permissions, and tool restrictions to control what AI agents can do in your organization.

Control who has access to what in your WonkaChat organization. Manage users, assign roles, define granular permissions for AI agents, and restrict which tools agents can use to ensure secure collaboration.

<Info>
  Access control implements the principle of least privilege that allows users and agents to receive only the permissions they need to do their work.
</Info>

***

## User Management

Add, manage, and remove users in your organization through the Settings panel.

<Steps>
  <Step title="Access Settings">
    Click your name in the bottom left corner of the WonkaChat dashboard, then select **User Management**. Only administrators can access user management functions.
  </Step>

  <Step title="Invite New Users">
    Send email invitations to users you want to add to your organization. Users receive an invitation link to create their account and join.
  </Step>

  <Step title="Assign Role">
    Choose whether the new user will be an **Admin** or a **User** when sending the invitation.

    <Check>
      You can change user roles at any time after they join the organization.
    </Check>
  </Step>

  <Step title="Managing Existing Users">
    <AccordionGroup>
      <Accordion title="Change Roles" icon="user-gear">
        Promote users to administrators or remove admin privileges as responsibilities change.

        <Warning>
          Administrators can manage their own admin rights, but cannot override or remove admin privileges from other administrators.
        </Warning>
      </Accordion>

      <Accordion title="Remove Users" icon="user-slash">
        Permanently remove users from your organization. While you can easily delete and re-add users, all data associated with the account is permanently deleted and cannot be recovered.

        <Warning>
          Removing a user deletes all their data irreversibly. You can re-add the user later, but their previous agents, configurations, and settings will be gone forever. Consider deactivation for temporary access removal.
        </Warning>
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

***

## Role-Based Permissions

WonkaChat uses a simple two-role system for clear permission boundaries.

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/HiCEHQkDpms" title="Governance and RBAC explained" frameBorder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

### Available Roles

<CardGroup cols={2}>
  <Card title="User" icon="user">
    **Personal agent creation**

    • Create their own personal AI agents\
    • Use agents shared by administrators\
    • Modify shared agents only if granted permission\
    • Access only the personal created agents or admin shared agents

    <Info>
      Users cannot share agents with others, only administrators can make agents available organization-wide.
    </Info>
  </Card>

  <Card title="Administrator" icon="user-shield">
    **Full organizational control**

    • Manage all users\
    • Create, modify, and share agents organization-wide\
    • Control agent permissions (who can view/modify)\
    • Promote users to administrator roles

    <Check>
      Admins have complete control except they cannot override other administrators' privileges.
    </Check>
  </Card>
</CardGroup>

<Tip>
  Keep the number of administrators limited to those who need full organizational control. Most team members should have User roles.
</Tip>

### Agent Visibility Scope

<Tabs>
  <Tab title="Personal Agents">
    Agents created by users are **private by default** and visible only to the creator.

    Users cannot share their personal agents organization-wide. Only administrators can share agents.

    <Tip>
      If a user creates a valuable agent and wants to share it, they should contact an administrator to review and share it.
    </Tip>
  </Tab>

  <Tab title="Shared Agents">
    Agents shared by administrators can be made available to:

    * **Specific users**: Select individuals who can access the agent
    * **Entire organization**: All users in the organization

    Admins control the exact permission level (Viewer, Editor, or Owner) for each shared agent.

    <Check>
      Shared agents appear in users' agent lists based on the permissions they've been granted.
    </Check>
  </Tab>
</Tabs>

***

## Sharing AI Agents

Administrators can share AI Agents directly from the Agent Builder panel.

<Tabs>
  <Tab title="I'm an Administrator">
    As an administrator, you control agent sharing from the Agent Builder panel.

    ### How to Share an Agent

    <Steps>
      <Step title="Open Agent Builder">
        Navigate to the agent you want to share (or create a new one) in the Agent Builder.
      </Step>

      <Step title="Configure Sharing Settings">
        In the Agent Builder panel, you'll find sharing options:

        <Frame caption="Agent Sharing location">
          <img src="https://mintcdn.com/wonkaai/HF-VZnkNRH--btoI/images/share.png?fit=max&auto=format&n=HF-VZnkNRH--btoI&q=85&s=b81c9b2ce7ca1aad155fe0788172f085" alt="Agent Sharing showing sharing options" width="511" height="272" data-path="images/share.png" />
        </Frame>

        **Visibility:**

        * Share with the entire organization, or
        * Share with specific users

        **Permission Levels:**

        * **Viewer**: Can view and use the agent (no modifications)
        * **Editor**: Can view, use, and modify the agent
        * **Owner**: Has full control including sharing and deletion

        <Tip>
          For important organizational agents, use Viewer permissions for most users and grant Editor access only to trusted collaborators.
        </Tip>
      </Step>

      <Step title="Review Tool Access">
        Before sharing, verify which tools and MCP connections the agent has access to. Ensure they're appropriate for all users who will have access.

        <Warning>
          When users interact with a shared agent, the agent inherits that user's permissions in connected tools. Consider what data different users can access.
        </Warning>
      </Step>

      <Step title="Save and Share">
        Save your sharing configuration. The agent immediately becomes available to the specified users based on the permissions you set.

        <Check>
          Users will see the shared agent in their agent list and can start using it according to their granted permissions.
        </Check>
      </Step>
    </Steps>
  </Tab>

  <Tab title="I'm a User">
    As a standard user, you can create personal agents but need administrator involvement to share them organization-wide.\
    If you create an agent that would benefit others, contact an administrator to request organization-wide sharing.

    Provide:

    * Clear description of what the agent does
    * Intended use cases
    * Why it would benefit the organization
    * Which tools it requires

    <Tip>
      Administrators need to review agents for security, tool access, and compliance before sharing them widely.
    </Tip>

    ### Using Shared Agents

    When an administrator shares an agent, they can assign one of three permission levels:

    <AccordionGroup>
      <Accordion title="Viewer" icon="eye">
        **Can view and use the agent but cannot modify it**

        Viewers can:

        * Use the agent in conversations
        * See the agent in their agent list
        * Access the agent's capabilities

        Viewers cannot:

        * Modify the agent's configuration, prompts, or tools
        * Share the agent with others
        * Change agent settings

        <Check>
          Viewer permission is ideal for most users who need to use the agent without making changes.
        </Check>
      </Accordion>

      <Accordion title="Editor" icon="pen-to-square">
        **Can view and modify the agent**

        Editors can:

        * Use the agent in conversations
        * View the agent's configuration and settings
        * Modify the agent's prompts, tools, and configuration
        * Make changes that affect all users

        Editors cannot:

        * Share the agent with others
        * Change ownership or delete the agent

        <Warning>
          Granting editor permission allows users to change agent behavior for everyone. Use this carefully for collaborative agent development.
        </Warning>
      </Accordion>

      <Accordion title="Owner" icon="crown">
        **Has full control over the agent including sharing it**

        Owners can:

        * Use the agent in conversations
        * View and modify all agent settings
        * Share the agent with others (assign Viewer/Editor/Owner permissions)
        * Change or transfer ownership
        * Delete the agent

        <Info>
          Only administrators can be assigned as owners when sharing agents organization-wide. The agent creator is automatically the original owner.
        </Info>
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

***

## Tool Restriction

When creating an AI agent, you can control exactly which tools it has access to. This ensures agents only have the capabilities they need to perform their intended function.

### How Tool Restriction Works

When you add an MCP connection (like Outlook, GitHub, or Slack) to an agent, you can selectively enable or disable individual tools within that connection.

**For example**, if you add the Outlook MCP connection to an agent:

* You can **keep** tools like "draft email" and "read emails"
* You can **remove** tools like "send email" and "delete email"

Removing the "send email" tool means the agent cannot send emails, even if instructed to, because the capability simply doesn't exist for that agent.

<Check>
  Tool restriction happens at the agent creation level. Each agent can have different tool access based on its intended purpose.
</Check>

### Why Restrict Tools?

<AccordionGroup>
  <Accordion title="Prevent Unintended Actions">
    By removing tools that perform irreversible actions (sending emails, deleting files, deploying code), you eliminate the risk of agents making mistakes or misinterpreting prompts.

    **Security through absence**: If an agent doesn't have the "send email" tool, it's impossible for it to send an email (even by accident).
  </Accordion>

  <Accordion title="Minimize Risk Surface">
    The fewer tools an agent has, the less can go wrong. Reduce the attack surface by giving agents only the specific capabilities they need.

    **Example**: A data analysis agent doesn't need tools to modify or delete data. He should only receive read access.
  </Accordion>

  <Accordion title="Purpose-Built Agents">
    Create specialized agents optimized for specific tasks by giving them precise tool sets.

    **Example**: A "Draft Email" agent with Outlook MCP but only drafting tools enabled. He should not receive any sending, deleting, or forwarding capabilities.
  </Accordion>
</AccordionGroup>

### Example: Email Draft Agent

The difference between a helpful drafting assistant and a potential security risk often comes down to a single tool.

<Tip>
  When creating agents, disable tools that execute final actions unless the agent specifically needs them. Enable tools for preparation and analysis, but restrict tools that send, delete, deploy, or modify production systems.
</Tip>

<Tabs>
  <Tab title="✅ Good Example: Send Tool Disabled">
    The same agent, but with the `send-email` tool restricted.

    **The Result:**

    ```
    User prompt: "Draft an email to john@example.com about the Q4 report."

    Agent response: "Here's a draft email for john@example.com about the Q4 report:

    Subject: Q4 Report Update

    Hi John,
    [draft content]

    Would you like me to revise anything?"
    ```

    Without access to the `send-email` tool, the agent can only draft content. The user reviews it, makes changes if needed, and manually sends when ready.

    <Check>
      **Safe**: User maintains full control over when and what gets sent. Agent provides value without risk.
    </Check>
  </Tab>

  <Tab title="❌ Bad Example: Send Tool Enabled">
    An agent configured to help draft emails but with the `send-email` tool still enabled.

    **The Problem:**

    ```
    User prompt: "Draft an email to john@example.com about the Q4 report."

    Agent response: "I've drafted and sent the following email to john@example.com..."
    ```

    Because the agent had access to the `send-email` tool, it interpreted "draft an email" as permission to also send it. The email went out before the user could review it.

    <Warning>
      **Risk**: Unreviewed emails being sent, potential data leaks, unprofessional communication, or sending to wrong recipients.
    </Warning>
  </Tab>
</Tabs>

***

## Safe Mode: Human-in-the-Loop

Safe Mode ensures you approve every action an AI Agent wants to take before it executes.

<Info>
  **Visual Guide Coming Soon**: We're creating a step-by-step visual guide with screenshots showing exactly how Safe Mode works, including the approval dialog and decision workflow.
</Info>

### How Safe Mode Works

<Steps>
  <Step title="Identify When to Use Safe Mode">
    Enable Safe Mode for agents that perform high-risk operations:

    * Send communications (emails, messages, posts)
    * Modify or delete production data
    * Deploy code or configurations
    * Execute financial transactions

    <Warning>
      Safe Mode provides essential oversight to prevent mistakes and unauthorized actions in critical operations.
    </Warning>
  </Step>

  <Step title="Agent Requests Action">
    When an AI agent wants to use a tool or execute an action, it pauses and requests your approval.

    You see exactly what the agent wants to do, which tool it wants to use, and what parameters it will pass.
  </Step>

  <Step title="You Review & Decide">
    Review the requested action and decide whether to:

    * **Allow**: The action executes as requested
    * **Deny**: The action is blocked, and the agent continues without executing it

    <Tip>
      This is your opportunity to catch potential mistakes, verify actions are appropriate, and maintain oversight.
    </Tip>
  </Step>

  <Step title="Action Executes or Blocks">
    * If approved, the action executes and the agent receives the results
    * If denied, the agent is informed the action was not permitted and can adjust its approach

    <Check>
      You can disable Safe Mode for trusted agents performing routine tasks, but it's recommended for agents with access to powerful tools.
    </Check>
  </Step>
</Steps>

***

## Access Control Advices

<CardGroup cols={2}>
  <Card title="Limit Administrators" icon="user-shield">
    Grant admin roles only to those who need full organizational control. Fewer admins = easier auditing and reduced risk.
  </Card>

  <Card title="Start Restrictive" icon="user-lock">
    Begin with minimal tool access and permissions, then add only as needed. It's easier to grant access than to recover from mistakes.
  </Card>

  <Card title="Review Regularly" icon="calendar-check">
    Periodically audit who has access to which agents and tools, adjusting as roles and responsibilities change.
  </Card>

  <Card title="Test with Safe Mode" icon="flask">
    Always test new agents with Safe Mode enabled to observe what actions they attempt before granting autonomous operation.
  </Card>
</CardGroup>

<Tip>
  Clear communication about agent purposes, permissions, and tool restrictions helps users understand what they can do and reduces support requests.
</Tip>
