# contains_dangerous_patterns

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/config/contains_dangerous_patterns)

Check if a command contains dangerous shell patterns.

These patterns can be used to bypass allow-list validation by embedding
arbitrary commands within seemingly safe commands. The check includes
both literal substring patterns (redirects, substitution operators, etc.)
and regex patterns for bare variable expansion (`$VAR`) and the background
operator (`&`).

## Signature

```python
contains_dangerous_patterns(
    command: str,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `command` | `str` | Yes | The shell command to check. |

## Returns

`bool`

True if dangerous patterns are found, False otherwise.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3bcc51a95da80094cfc8bc4bcaf25dc1e2ad8f44/libs/cli/deepagents_cli/config.py#L1511)