> For the complete documentation index, see [llms.txt](https://help.sleuth.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sleuth.io/sleuth-dora/modeling-your-deployments/code-deployments/deployment-locking.md).

# Deployment locking

The Lock feature in Sleuth prevents pull requests from merging into deployment branches, and generates automatic notifications via your [Slack](/sleuth-dora/integrations-1/slack.md) channel.

![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-8187d86e590d6aa8835de6767b4b91751474e555%2FSleuth%20-%20Sleuth%202021-01-31%2013-41-32.png?alt=media)

#### Manual locking

You can manually lock a deployment or all deployments within a project with one click of a button from your dashboards. You can view your lock history so you can learn how frequently your team locks their deploys and why.

![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-1e43ab1a72455944b2e8a03e7705cd99d900780d%2Fsleuth%20lock%20history%20-%20Sleuth%202021-01-31%2021-16-27.png?alt=media)

#### Automatic locking

You can also configure Sleuth to auto-lock deployments [when PRs are merged for the deployment branch](https://help.sleuth.io/settings/project/code-deployments#automatically-lock-deployments).

Read Sleuth CTO [Don Brown's blog post](https://www.sleuth.io/post/prevent-unwanted-changes-with-sleuth-deployment-locking) on how Sleuth's locking feature can make your DevOps life easier!

##


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sleuth.io/sleuth-dora/modeling-your-deployments/code-deployments/deployment-locking.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
