> For the complete documentation index, see [llms.txt](https://securitybot.gitbook.io/securitybot-knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://securitybot.gitbook.io/securitybot-knowledge-hub/command-reference/lock.md).

# /lock

{% hint style="info" %}
**Premium Feature** — Channel locks require a Premium subscription. [Compare plans →](/securitybot-knowledge-hub/plans-and-pricing/plans-and-pricing.md)
{% endhint %}

Channel locks restrict who can send messages in a channel by requiring authentication. SecurityBot supports two lock types: **Password** and **2FA (MFA)**. When a lock is active, all messages in the channel are automatically deleted and users must authenticate via a button to unlock.

***

## Usage

| Subcommand | Options                                         | Permission | Description                                    |
| ---------- | ----------------------------------------------- | ---------- | ---------------------------------------------- |
| `create`   | `lock_type` (Choice: Password or 2FA, required) | Admin      | Create a new channel lock                      |
| `toggle`   | None                                            | Moderator+ | Toggle a channel lock on/off                   |
| `update`   | None                                            | Admin      | Update a channel lock's password               |
| `remove`   | None                                            | Admin      | Remove a channel lock from the current channel |

### Example

```
/lock create lock_type: Password
```

```
/lock toggle
```

***

## Lock Types

### Password

Users must enter the correct password to access the channel. When creating a password lock, a modal prompts you to set the password.

### 2FA (MFA)

Users must have 2FA registered and provide a valid TOTP code to access the channel. The creating user must have 2FA registered before creating an MFA lock.

{% hint style="info" %}
Discord does not support hidden input fields. Your password or 2FA code will be visible while typing -- make sure no one can see your screen.
{% endhint %}

***

## Subcommand Details

### `/lock create`

Run this command in the channel you want to lock. You will be prompted to configure the lock via a modal (password entry for password locks). For MFA locks, SecurityBot validates that you have 2FA registered first.

### `/lock toggle`

Presents an authentication modal (password or MFA code depending on lock type). Toggles the lock between active and inactive states. When inactive, normal messaging resumes.

### `/lock update`

Changes the password for a password-type lock. Presents a modal to enter the new password.

{% hint style="info" %}
Only password locks can be updated. MFA locks cannot have their configuration changed.
{% endhint %}

### `/lock remove`

Shows a confirmation embed with "Confirm" and "Cancel" buttons before permanently removing the lock from the channel.

***

## Permissions

* **`/lock create`** -- Administrator
* **`/lock toggle`** -- Moderator+
* **`/lock update`** -- Administrator
* **`/lock remove`** -- Administrator


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://securitybot.gitbook.io/securitybot-knowledge-hub/command-reference/lock.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
