# suppress_warning

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/model_config/suppress_warning)

Add a warning key to the suppression list in the config file.

Reads existing config (if any), adds `key` to `[warnings].suppress`,
and writes back using atomic temp-file rename. Deduplicates entries.

## Signature

```python
suppress_warning(
    key: str,
    config_path: Path | None = None,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `key` | `str` | Yes | Warning identifier to suppress (e.g., `'ripgrep'`). |
| `config_path` | `Path \| None` | No | Path to config file.  Defaults to `~/.deepagents/config.toml`. (default: `None`) |

## Returns

`bool`

`True` if save succeeded, `False` if it failed due to I/O errors.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/model_config.py#L2741)